From 38ff9a1a94a4742c1e6e2397601ed0fc5b9ae851 Mon Sep 17 00:00:00 2001 From: jiazk1 Date: Fri, 29 Dec 2023 18:07:54 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E9=83=A8=E7=BD=B2sys?= =?UTF-8?q?om=5Fhotfix=5Fbuilder=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8Cmount?= =?UTF-8?q?=20nfs=E6=97=B6=E6=8F=90=E7=A4=BA=E7=9A=84=20init.sh:=20line=20?= =?UTF-8?q?24:=20sudo:=20command=20not=20found=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/server/sysom_hotfix_builder/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server/sysom_hotfix_builder/install.sh b/script/server/sysom_hotfix_builder/install.sh index 1110d561..3f4a690a 100644 --- a/script/server/sysom_hotfix_builder/install.sh +++ b/script/server/sysom_hotfix_builder/install.sh @@ -17,7 +17,7 @@ install_requirement() { } install_package() { - rpm -q --quiet make gcc patch bison flex openssl-devel elfutils elfutils-devel dwarves || yum install -y make gcc patch bison flex openssl-devel elfutils elfutils-devel dwarves || exit 1 + rpm -q --quiet make gcc patch bison flex openssl-devel elfutils elfutils-devel dwarves sudo || yum install -y make gcc patch bison flex openssl-devel elfutils elfutils-devel dwarves sudo || exit 1 rpm -q --quiet docker git || yum install -y docker git || echo "Warngin : Docker is not installed in this machine!" } -- Gitee From d36be8791c178d87bee97b6b9e0eaa8bb72a7244 Mon Sep 17 00:00:00 2001 From: jiazk1 Date: Fri, 29 Dec 2023 18:10:06 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E7=BD=B2=E8=BF=87=E7=A8=8B=E4=B8=AD=E6=8A=A5?= =?UTF-8?q?=E9=94=99=EF=BC=9Acan't=20read=20/usr/local/sysom/server/sysom?= =?UTF-8?q?=5Fhotfix/conf/hotfix=5Fgunicorn.py:=20No=20such=20file=20or=20?= =?UTF-8?q?directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/server/sysom_hotfix/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server/sysom_hotfix/init.sh b/script/server/sysom_hotfix/init.sh index 6839466a..d9979880 100644 --- a/script/server/sysom_hotfix/init.sh +++ b/script/server/sysom_hotfix/init.sh @@ -10,7 +10,7 @@ init_conf() { ###change the install dir base on param $1### sed -i "s;/usr/local/sysom;${APP_HOME};g" /etc/supervisord.d/${SERVICE_NAME}.ini cpu_num=`cat /proc/cpuinfo | grep processor | wc -l` - sed -i "s/threads = 3/threads = $cpu_num/g" ${SERVICE_HOME}/conf/hotfix_gunicorn.py + sed -i "s/threads = 3/threads = $cpu_num/g" ${SERVICE_HOME}/conf/gunicorn.py } init_nfs() -- Gitee From b6767d846daaada8a89c012acb16fae44a2d7e04 Mon Sep 17 00:00:00 2001 From: jiazk1 Date: Fri, 29 Dec 2023 18:13:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=E6=9B=B4=E6=96=B0README.md=E6=96=87?= =?UTF-8?q?=E6=A1=A3=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=AE=B9=E5=99=A8=E5=8C=96?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8C=E9=83=A8?= =?UTF-8?q?=E7=BD=B2sysom=5Fhotfix=5Fbuilder=E7=9A=84nfs=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=EF=BC=8C=E5=AF=BC=E8=87=B4=E7=9A=84sysom?= =?UTF-8?q?=E5=90=84=E4=B8=AA=E5=BE=AE=E6=9C=8D=E5=8A=A1=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=AF=BC=E8=87=B4=E6=95=B4=E4=BD=93=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E9=83=A8=E7=BD=B2=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 23c6eeb9..d5d4781d 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,8 @@ ```bash docker build -t sysom-base -f docker/sysom_base_dockerfile . - docker run -idt --privileged --name sysom-base sysom-base + mkdir -p /data/sysom/server/hotfix_builder/hotfix-nfs + docker run -idt --privileged=true --restart=always -p 8080:80 -v /data/sysom/server/hotfix_builder/hotfix-nfs:/usr/local/sysom/server/hotfix_builder/hotfix-nfs --name sysom-base sysom-base ``` 可以通过修改 docker/sysom_base_dockerfile 使能不同的微服务 -- Gitee From 39b72e90bffcd6ca4a905c97135663889dbb0e6e Mon Sep 17 00:00:00 2001 From: jiazk1 Date: Thu, 4 Jan 2024 18:03:31 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E5=8C=96=E9=83=A8=E7=BD=B2=EF=BC=8C=E5=BA=94=E7=94=A8=E5=8F=AF?= =?UTF-8?q?=E8=A7=82=E6=B5=8B=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E2=80=9CPanel=20plugin=20not=20found:=20sysom-network?= =?UTF-8?q?-topology-pannel=E2=80=9D=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deps/4_grafana/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/4_grafana/install.sh b/deps/4_grafana/install.sh index f10bd76e..750e6982 100644 --- a/deps/4_grafana/install.sh +++ b/deps/4_grafana/install.sh @@ -30,6 +30,7 @@ install_grafana() wget ${GRAFANA_PLUGIN_OSS_URL}/sysom-network-topology-panel-0.0.1.zip fi if [ ! -d sysom-network-topology-panel ]; then + rpm -q --quiet unzip || yum install -y unzip unzip sysom-network-topology-panel-0.0.1.zip rm -rf sysom-network-topology-panel-0.0.1.zip fi -- Gitee From 7c2cac270b15fc4762c3d91dbd0f3e52b13f4225 Mon Sep 17 00:00:00 2001 From: jiazk1 Date: Tue, 9 Jan 2024 10:08:07 +0800 Subject: [PATCH 5/5] =?UTF-8?q?update:=E6=96=B0=E5=A2=9E=20sysom=5Fwith=5F?= =?UTF-8?q?hotfix=5Fenable=5Fdockerfile=EF=BC=8C=E5=9C=A8=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E4=BD=BF=E8=83=BD=20hotfix=20=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++- docker/sysom_with_hotfix_enable_dockerfile | 53 ++++++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 docker/sysom_with_hotfix_enable_dockerfile diff --git a/README.md b/README.md index d5d4781d..b7cccfd8 100644 --- a/README.md +++ b/README.md @@ -230,12 +230,21 @@ ```bash docker build -t sysom-base -f docker/sysom_base_dockerfile . - mkdir -p /data/sysom/server/hotfix_builder/hotfix-nfs - docker run -idt --privileged=true --restart=always -p 8080:80 -v /data/sysom/server/hotfix_builder/hotfix-nfs:/usr/local/sysom/server/hotfix_builder/hotfix-nfs --name sysom-base sysom-base + docker run -idt --privileged --name sysom-base sysom-base ``` 可以通过修改 docker/sysom_base_dockerfile 使能不同的微服务 +### 3.2 基础服务+hotfix 部署 + 在 sysom 的基础服务上使能 hotfix 功能,需要在 sysom_base_dockerfile 文件的基础上新增安装 sysom_hotfix,sysom_hotfix_builder 两个微服务,详见 /docker/sysom_with_hotfix_enable_dockerfile + + 启动使能 hotfix 功能的 sysom 时需要注意,首先要在宿主系统上新建 hotfix-nfs 目录,用于挂载至容器中,使得容器中的 nfs 服务能够正常启动。具体执行命令如下: + + ```bash + docker build -t sysom-with-hotfix -f docker/sysom_with_hotfix_enable_dockerfile . + mkdir -p /data/sysom/server/hotfix_builder/hotfix-nfs + docker run -idt --privileged=true --restart=always -p 8080:80 -v /data/sysom/server/hotfix_builder/hotfix-nfs:/usr/local/sysom/server/hotfix_builder/hotfix-nfs --name sysom-with-hotfix sysom-with-hotfix + ``` ## 4. 通过 WEB 前端访问 diff --git a/docker/sysom_with_hotfix_enable_dockerfile b/docker/sysom_with_hotfix_enable_dockerfile new file mode 100644 index 00000000..9c4329bf --- /dev/null +++ b/docker/sysom_with_hotfix_enable_dockerfile @@ -0,0 +1,53 @@ + +FROM node:16.20.1 as web_builder +COPY sysom_web /root/sysom_web +WORKDIR /root/sysom_web +RUN npm config set registry https://registry.npmmirror.com +RUN yarn config set registry https://registry.npmmirror.com +RUN yarn +RUN yarn build + + +FROM openanolis/anolisos:8.8 as prod + +# Add epel +RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm +RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*" +RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*" + +# Add required yum packages +RUN yum makecache +RUN yum install -y supervisor cronie net-tools +RUN systemctl enable crond +RUN yum install -y python3 +RUN yum install -y nginx +RUN yum install -y redis +RUN yum install -y wget +RUN systemctl enable supervisord +RUN systemctl enable nginx + +# Init sysom-diagnosis +ARG SYSOM_HOME=/usr/local/sysom +ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server + +RUN mkdir /root/sysom +RUN mkdir -p /usr/local/sysom +COPY conf /root/sysom/conf +COPY script /root/sysom/script +COPY deps /root/sysom/deps +COPY environment /root/sysom/environment +COPY sysom_server /root/sysom/sysom_server + +COPY --from=web_builder /root/sysom_web/dist /usr/local/sysom/web + +RUN bash -x /root/sysom/script/sysom.sh install deps ALL +RUN bash -x /root/sysom/script/sysom.sh install env ALL +RUN bash -x /root/sysom/script/sysom.sh install ms sysom_api,sysom_diagnosis,sysom_channel,sysom_monitor_server,sysom_log,sysom_alarm,sysom_hotfix,sysom_hotfix_builder + +RUN yum clean all + +COPY docker/sysom-init.service /usr/lib/systemd/system/sysom-init.service +RUN systemctl enable sysom-init.service + +# # 环境准备 +ENTRYPOINT [ "/usr/sbin/init" ] \ No newline at end of file -- Gitee