Skip to content

Commit

Permalink
fix: docker release v3.1.1 images optimize
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
  • Loading branch information
cubxxw committed Aug 4, 2023
1 parent 22c8cd7 commit 8c55ad1
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 35 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-server/_output/bin/platforms

VOLUME ["/openim/openim-server/logs","/openim/openim-server/config","/openim/openim-server/scripts"]

CMD ["bash","-c","${OPENIM_SERVER_CMDDIR}/docker_start_all.sh"]
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ services:


openim_server:
image: openim-server:v1 #ghcr.io/openimsdk/openim-server:latels
image: ghcr.io/openim-sigs/openim-server:v1.0.0-debug.0 #ghcr.io/openimsdk/openim-server:latels
container_name: openim-server
volumes:
- ./logs:/openim/openim-server/logs
Expand All @@ -122,7 +122,7 @@ services:
max-file: "2"

openim_chat:
image: openim-chat:v1.3 #ghcr.io/openimsdk/openim-chat:latels
image: ghcr.io/openim-sigs/openim-chat:v1.0.0-debug.0 #ghcr.io/openimsdk/openim-chat:latels
container_name: openim_chat
# volumes:
# - ./_output/openim/openim-chat/logs:/openim/openim-chat/logs
Expand Down
12 changes: 6 additions & 6 deletions scripts/enterprise/function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#input:[10023,2323,3434]
#output:10023 2323 3434
list_to_string(){
ports_list=$*
sub_s1=`echo $ports_list | sed 's/ //g'`
sub_s2=${sub_s1//,/ }
sub_s3=${sub_s2#*[}
sub_s4=${sub_s3%]*}
ports_array=$sub_s4
ports_list=$*
sub_s1=`echo $ports_list | sed 's/ //g'`
sub_s2=${sub_s1//,/ }
sub_s3=${sub_s2#*[}
sub_s4=${sub_s3%]*}
ports_array=$sub_s4
}
remove_space(){
value=$*
Expand Down
16 changes: 7 additions & 9 deletions scripts/enterprise/path_info.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Don't put the space between "="

demo_server_name="openim_chat_api"
demo_server_name="chat-api"
demo_server_binary_root="$BIN_DIR/"

#Global configuration file default dir
Expand All @@ -12,16 +12,14 @@ service_source_root=(
../cmd/api/chat/
../cmd/api/admin/
#rpc service file
../cmd/openim-rpc/admin/
../cmd/openim-rpc/chat/
../cmd/rpc/admin/
../cmd/rpc/chat/
)

#service filename
service_names=(
#api service filename
openim_chat_api
openim_admin_api
#rpc service filename
openim_admin
openim_chat
chat-api
admin-api
admin-rpc
chat-rpc
)
8 changes: 4 additions & 4 deletions scripts/msg_transfer_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ prome_ports=($ports_array)

#Check if the service exists
#If it is exists,kill this process
check=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
if [ $check -ge 1 ]
then
oldPid=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
oldPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
kill -9 $oldPid
fi
#Waiting port recycling
Expand All @@ -59,10 +59,10 @@ for ((i = 0; i < ${msg_transfer_service_num}; i++)); do
done

#Check launched service process
check=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
check=`ps | grep -w ./${openim_msgtransfer} | grep -v grep| wc -l`
if [ $check -ge 1 ]
then
newPid=`ps aux | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
newPid=`ps | grep -w ./${openim_msgtransfer} | grep -v grep|awk '{print $2}'`
allPorts=""
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${BACKGROUND_GREEN}${openim_msgtransfer}${COLOR_SUFFIX}
Expand Down
8 changes: 4 additions & 4 deletions scripts/push_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ prome_ports=($ports_array)

#Check if the service exists
#If it is exists,kill this process
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l)
if [ $check -ge 1 ]; then
oldPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
oldPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
kill -9 $oldPid
fi
#Waiting port recycling
Expand All @@ -61,9 +61,9 @@ done

sleep 3
#Check launched service process
check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l)
check=$(ps | grep -w ./${push_name} | grep -v grep | wc -l)
if [ $check -ge 1 ]; then
newPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
newPid=$(ps | grep -w ./${push_name} | grep -v grep | awk '{print $2}')
ports=$(netstat -netulp | grep -w ${newPid} | awk '{print $4}' | awk -F '[:]' '{print $NF}')
allPorts=""

Expand Down
8 changes: 4 additions & 4 deletions scripts/start_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ source $SCRIPTS_ROOT/function.sh

cd $SCRIPTS_ROOT

echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"

if [ ! -d "${OPENIM_ROOT}/_output/bin/platforms" ]; then
# exec build_all_service.sh
"${SCRIPTS_ROOT}/build_all_service.sh"
fi

echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"

bin_dir="$OPENIM_ROOT/_output/bin"
logs_dir="$OPENIM_ROOT/logs"
sdk_db_dir="$OPENIM_ROOT/sdk/db/"
Expand Down
8 changes: 4 additions & 4 deletions scripts/start_cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ sdk_db_dir="$OPENIM_ROOT/sdk/db/"

#Check if the service exists
#If it is exists,kill this process
check=`ps aux | grep -w ./${cron_task_name} | grep -v grep| wc -l`
check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l`
if [ $check -ge 1 ]
then
oldPid=`ps aux | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
oldPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
kill -9 $oldPid
fi
#Waiting port recycling
Expand All @@ -50,10 +50,10 @@ nohup ./${cron_task_name} >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
#done

#Check launched service process
check=`ps aux | grep -w ./${cron_task_name} | grep -v grep| wc -l`
check=`ps | grep -w ./${cron_task_name} | grep -v grep| wc -l`
if [ $check -ge 1 ]
then
newPid=`ps aux | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
newPid=`ps | grep -w ./${cron_task_name} | grep -v grep|awk '{print $2}'`
allPorts=""
echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX}
echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${BACKGROUND_GREEN}${cron_task_name}${COLOR_SUFFIX}
Expand Down
2 changes: 1 addition & 1 deletion scripts/start_rpc_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ service_prometheus_port_name=(

for ((i = 0; i < ${#service_filename[*]}; i++)); do
#Check whether the service exists
service_name="ps -aux |grep -w ${service_filename[$i]} |grep -v grep"
service_name="ps |grep -w ${service_filename[$i]} |grep -v grep"
count="${service_name}| wc -l"

if [ $(eval ${count}) -gt 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/stop_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cd "$SCRIPTS_ROOT"

for i in ${service_names[*]}; do
#Check whether the service exists
name="ps -aux |grep -w $i |grep -v grep"
name="ps |grep -w $i |grep -v grep"
count="${name}| wc -l"
if [ $(eval ${count}) -gt 0 ]; then
pid="${name}| awk '{print \$2}'"
Expand Down

0 comments on commit 8c55ad1

Please sign in to comment.