mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 02:26:00 +08:00
🧶 feat: Big job! kubernetes Deployment Design (#1055)
* fix: fix docker compose file Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add options about helm deploy Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add openim server test about openim web Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim server test about openim web Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim server test about openim web Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim test: Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim test: Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * fix: fix env api url Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * fix: fix openim server deployment Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * fix: fix openim server deployment Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: add openim task list Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: remove openim config Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> * feat: remote tools imctl * feat: add tools imctl * feat: add tools imctl * feat: add config * feat: add config * feat: add openim config * feat: add openim config --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -62,6 +62,7 @@ echo "+++ The port being checked: ${OPENIM_DEPENDENCY_PORT_LISTARIES[@]}"
|
||||
|
||||
set +e
|
||||
|
||||
# Later, after discarding Docker, the Docker keyword is unreliable, and Kubepods is used
|
||||
if grep -qE 'docker|kubepods' /proc/1/cgroup || [ -f /.dockerenv ]; then
|
||||
openim::color::echo ${COLOR_BLUE} "Environment in the interior of the container"
|
||||
else
|
||||
|
||||
@@ -25,7 +25,6 @@ source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
trap 'openim::util::onCtrlC' INT
|
||||
|
||||
chmod +x "${OPENIM_ROOT}"/scripts/*.sh
|
||||
"${OPENIM_ROOT}"/scripts/init-config.sh
|
||||
|
||||
openim::util::ensure_docker_daemon_connectivity
|
||||
|
||||
@@ -40,10 +39,12 @@ else
|
||||
fi
|
||||
|
||||
pushd "${OPENIM_ROOT}"
|
||||
|
||||
${DOCKER_COMPOSE_COMMAND} up -d
|
||||
${DOCKER_COMPOSE_COMMAND} stop
|
||||
curl https://gitee.com/openimsdk/openim-docker/raw/main/example/full-openim-server-and-chat.yml -o docker-compose.yml && make init && docker compose up -d
|
||||
"${OPENIM_ROOT}"/scripts/init-config.sh
|
||||
${DOCKER_COMPOSE_COMMAND} up --remove-orphans -d
|
||||
sleep 60
|
||||
${DOCKER_COMPOSE_COMMAND} logs
|
||||
${DOCKER_COMPOSE_COMMAND} logs openim-server
|
||||
${DOCKER_COMPOSE_COMMAND} ps
|
||||
|
||||
popd
|
||||
|
||||
@@ -69,6 +69,15 @@ def "ENV_FILE" ""${OPENIM_ROOT}"/scripts/install/environment.sh"
|
||||
def "CHAT_BRANCH" "main"
|
||||
def "SERVER_BRANCH" "main"
|
||||
|
||||
# Choose the appropriate image address, the default is GITHUB image,
|
||||
# you can choose docker hub, for Chinese users can choose Ali Cloud
|
||||
# export IMAGE_REGISTRY="ghcr.io/openimsdk"
|
||||
# export IMAGE_REGISTRY="openim"
|
||||
# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk"
|
||||
def "IMAGE_REGISTRY" "ghcr.io/openimsdk"
|
||||
# def "IMAGE_REGISTRY" "openim"
|
||||
# def "IMAGE_REGISTRY" "registry.cn-hangzhou.aliyuncs.com/openimsdk"
|
||||
|
||||
###################### OpenIM Docker Network ######################
|
||||
# 设置 Docker 网络的网段
|
||||
readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.28.0.0/16'}
|
||||
@@ -289,11 +298,16 @@ def "WEBSOCKET_TIMEOUT" "10" # Websocket超时
|
||||
def "PUSH_ENABLE" "getui" # 推送是否启用
|
||||
# GeTui推送URL
|
||||
readonly GETUI_PUSH_URL=${GETUI_PUSH_URL:-'https://restapi.getui.com/v2/$appId'}
|
||||
def "GETUI_MASTER_SECRET" "" # GeTui主密钥
|
||||
def "GETUI_APP_KEY" "" # GeTui应用密钥
|
||||
def "GETUI_INTENT" "" # GeTui推送意图
|
||||
def "GETUI_CHANNEL_ID" "" # GeTui渠道ID
|
||||
def "GETUI_CHANNEL_NAME" "" # GeTui渠道名称
|
||||
def "FCM_SERVICE_ACCOUNT" "x.json" # FCM服务账户
|
||||
def "JPNS_APP_KEY" # JPNS应用密钥
|
||||
def "JPNS_MASTER_SECRET" # JPNS主密钥
|
||||
def "JPNS_PUSH_URL" # JPNS推送URL
|
||||
def "JPNS_PUSH_INTENT" # JPNS推送意图
|
||||
def "JPNS_APP_KEY" "" # JPNS应用密钥
|
||||
def "JPNS_MASTER_SECRET" "" # JPNS主密钥
|
||||
def "JPNS_PUSH_URL" "" # JPNS推送URL
|
||||
def "JPNS_PUSH_INTENT" "" # JPNS推送意图
|
||||
def "MANAGER_USERID_1" "openIM123456" # 管理员ID 1
|
||||
def "MANAGER_USERID_2" "openIM654321" # 管理员ID 2
|
||||
def "MANAGER_USERID_3" "openIMAdmin" # 管理员ID 3
|
||||
|
||||
@@ -48,7 +48,7 @@ function openim::crontask::start()
|
||||
openim::log::info "Start OpenIM Cron, binary root: ${SERVER_NAME}"
|
||||
openim::log::status "Start OpenIM Cron, path: ${OPENIM_CRONTASK_BINARY}"
|
||||
|
||||
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||
openim::util::stop_services_with_name ${OPENIM_CRONTASK_BINARY}
|
||||
|
||||
openim::log::status "start cron_task process, path: ${OPENIM_CRONTASK_BINARY}"
|
||||
nohup ${OPENIM_CRONTASK_BINARY} >> ${LOG_FILE} 2>&1 &
|
||||
|
||||
@@ -54,14 +54,14 @@ function openim::push::start()
|
||||
openim::log::status "Start OpenIM Push, binary root: ${SERVER_NAME}"
|
||||
openim::log::info "Start OpenIM Push, path: ${OPENIM_PUSH_BINARY}"
|
||||
|
||||
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||
|
||||
openim::log::status "prepare start push process, path: ${OPENIM_PUSH_BINARY}"
|
||||
openim::log::status "prepare start push process, port: ${OPENIM_PUSH_PORT}, prometheus port: ${PUSH_PROM_PORT}"
|
||||
|
||||
OPENIM_PUSH_PORTS_ARRAY=$(openim::util::list-to-string ${OPENIM_PUSH_PORT} )
|
||||
PUSH_PROM_PORTS_ARRAY=$(openim::util::list-to-string ${PUSH_PROM_PORT} )
|
||||
|
||||
openim::util::stop_services_with_name ${SERVER_NAME}
|
||||
|
||||
openim::log::status "push port list: ${OPENIM_PUSH_PORTS_ARRAY[@]}"
|
||||
openim::log::status "prometheus port list: ${PUSH_PROM_PORTS_ARRAY[@]}"
|
||||
|
||||
@@ -94,7 +94,7 @@ function openim::push::install()
|
||||
|
||||
# 1. Build openim-push
|
||||
make build BINS=${SERVER_NAME}
|
||||
openim::common::sudo "cp ${OPENIM_OUTPUT_HOSTBIN}/${SERVER_NAME} ${OPENIM_INSTALL_DIR}/bin"
|
||||
openim::common::sudo "cp -r ${OPENIM_OUTPUT_HOSTBIN}/${SERVER_NAME} ${OPENIM_INSTALL_DIR}/bin"
|
||||
|
||||
openim::log::status "${SERVER_NAME} binary: ${OPENIM_INSTALL_DIR}/bin/${SERVER_NAME}"
|
||||
|
||||
@@ -150,4 +150,4 @@ function openim::push::status()
|
||||
|
||||
if [[ "$*" =~ openim::push:: ]];then
|
||||
eval $*
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -129,7 +129,7 @@ function openim::tools::post-start() {
|
||||
openim::log::info "Post-start actions for OpenIM Tools..."
|
||||
for tool in "${OPENIM_TOOLS_POST_START_NAME_LISTARIES[@]}"; do
|
||||
openim::log::info "Starting ${tool}..."
|
||||
# openim::tools::start_service ${tool}
|
||||
openim::tools::start_service ${tool}
|
||||
sleep 0.2
|
||||
done
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#
|
||||
|
||||
GO := go
|
||||
GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20|1.21
|
||||
GO_SUPPORTED_VERSIONS ?= 1.18|1.19|1.20|1.21|1.22
|
||||
|
||||
GO_LDFLAGS += -X $(VERSION_PACKAGE).gitVersion=$(GIT_TAG) \
|
||||
-X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \
|
||||
@@ -125,6 +125,10 @@ go.check-component:
|
||||
@echo "===========> Checking openim component"
|
||||
@$(ROOT_DIR)/scripts/install/openim-tools.sh openim::tools::pre-start
|
||||
|
||||
## go.versionchecker: Design, detect some environment variables and versions
|
||||
go.versionchecker:
|
||||
@$(ROOT_DIR)/scripts/install/openim-tools.sh openim::tools::post-start
|
||||
|
||||
## go.build.verify: Verify that a suitable version of Go exists
|
||||
.PHONY: go.build.verify
|
||||
go.build.verify:
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#
|
||||
|
||||
DOCKER := docker
|
||||
DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41
|
||||
DOCKER_SUPPORTED_API_VERSION ?= 1.32|1.40|1.41|1.42
|
||||
|
||||
# read: https://github.com/openimsdk/open-im-server/blob/main/docs/conversions/images.md
|
||||
REGISTRY_PREFIX ?= ghcr.io/openimsdk
|
||||
|
||||
Reference in New Issue
Block a user