From 73e75c273b783358e1d7053bcf05292ab905c624 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 11 Sep 2024 16:33:28 +0800 Subject: [PATCH] fix: del some files and modify dockerfile.allinone Signed-off-by: Qi Zhang --- .drone.yml | 89 --------------------------------------------- Dockerfile | 37 ------------------- Dockerfile.allinone | 47 +++++++----------------- Dockerfile.base | 12 ------ daemon.json | 15 -------- local_update.sh | 11 ------ rainbond.conf | 19 ---------- supervisord.conf | 22 ----------- tips.md | 15 -------- update_ui.sh | 27 -------------- 10 files changed, 13 insertions(+), 281 deletions(-) delete mode 100644 .drone.yml delete mode 100644 Dockerfile delete mode 100644 Dockerfile.base delete mode 100644 daemon.json delete mode 100755 local_update.sh delete mode 100644 rainbond.conf delete mode 100644 supervisord.conf delete mode 100644 tips.md delete mode 100755 update_ui.sh diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 0c4cc55ea6..0000000000 --- a/.drone.yml +++ /dev/null @@ -1,89 +0,0 @@ -kind: pipeline -name: build arm64 - -platform: - os: linux - arch: arm64 - -trigger: - event: - include: - - custom - -node: - city: sydney - -steps: -- name: clone rainbond-ui - image: alpine/git - environment: - UI_BRANCH: - from_secret: ui_branch - commands: - - git clone -b $UI_BRANCH --depth=1 https://github.com/goodrain/rainbond-ui.git - -- name: build rainbond-ui dist - image: node:14 - commands: - - cd rainbond-ui - - yarn install - - yarn run build - -- name: build rainbond-ui - image: rainbond/docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - environment: - VERSION: - from_secret: version - commands: - - sleep 10 # give docker enough time to start - - cd rainbond-ui - - docker build -t rainbond/rainbond-ui:$VERSION . - -- name: build rainbond-console - image: rainbond/docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - environment: - VERSION: - from_secret: version - DOCKER_USERNAME: - from_secret: docker_username - DOCKER_PASSWORD: - from_secret: docker_password - GOOS: linux - GOARCH: arm64 - OPERATOR_BRANCH: - from_secret: operator_branch - ADAPTOR_BRANCH: - from_secret: adaptor_branch - DOMESTIC_DOCKER_USERNAME: - from_secret: domestic_docker_username - DOMESTIC_DOCKER_PASSWORD: - from_secret: domestic_docker_password - DOMESTIC_BASE_NAME: - from_secret: domestic_base_name - commands: - - rm -rf rainbond-ui - - BUILD_ARCH=$GOARCH ./release.sh dind - when: - event: - include: - - custom - -services: -- name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index e3f6fc2d9e..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -ARG BASE_VERSION=V5.3 -FROM rainbond/rbd-ui-base:${BASE_VERSION} - -ARG RELEASE_DESC= -ARG PIP_SOURCE_URL=http://mirrors.aliyun.com/pypi/simple -ARG PIP_SOURCE_HOST=mirrors.aliyun.com - -LABEL author="zengqg@goodrain.com" - -RUN mkdir -p /app/ui /usr/share/zoneinfo/Asia/ - -ADD . /app/ui - -WORKDIR /app/ui - -RUN chmod +x /app/ui/entrypoint.sh \ - && mkdir /app/logs \ - && mkdir /app/data \ - && pip config set global.index-url "$PIP_SOURCE_URL" \ - && pip config set install.trusted-host "$PIP_SOURCE_HOST" \ - && python -m pip install --upgrade pip \ - && pip install -r requirements.txt \ - && python manage.py collectstatic --noinput --ignore weavescope-src --ignore drf-yasg --ignore rest_framework\ - && rm -rf /root/.cache \ - && rm -rf /tmp/* \ - && rm -rf /app/ui/www/static/www/weavescope - -ENV PORT 7070 -ENV IS_OPEN_API=true -ENV RELEASE_DESC=${RELEASE_DESC} -ENV HOME_DIR=/app -ENV MYSQL_DB=console - -VOLUME /app/data -VOLUME /app/logs - -ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file diff --git a/Dockerfile.allinone b/Dockerfile.allinone index 09783f6c84..4b9343eea2 100644 --- a/Dockerfile.allinone +++ b/Dockerfile.allinone @@ -1,26 +1,6 @@ ARG IMAGE_NAMESPACE=rainbond ARG VERSION=V5.4-dev -FROM rainbond/golang-gcc-buildstack:1.17-alpine3.16 as builder -ARG ADAPTOR_BRANCH=v5.7.1-release -ARG GOPROXY -ARG GITPROXY -ARG LDFLAGS="-w -s -linkmode external -extldflags '-static'" -ARG ARCH=amd64 - -ENV GOPROXY=${GOPROXY} -ENV CGO_ENABLED=1 -ENV GOPATH=/go - -RUN if [ ${ARCH} = "arm64" ] || [ ${ARCH} = "aarch64" ]; then \ - wget https://pkg.rainbond.com/upx/upx-4.0.2-arm64_linux/upx && chmod +x upx && mv upx /usr/local/bin/upx; \ - else \ - apk add upx; \ - fi && \ - apk add git && git clone -b ${ADAPTOR_BRANCH} --depth=1 ${GITPROXY}https://github.com/goodrain/cloud-adaptor /go/src/goodrain.com/cloud-adaptor -WORKDIR /go/src/goodrain.com/cloud-adaptor/ -RUN go build -ldflags "$LDFLAGS" -o /cloud-adaptor $PWD/cmd/cloud-adaptor && upx --best --lzma /cloud-adaptor && chmod +x /cloud-adaptor - # build ui FROM ${IMAGE_NAMESPACE}/rainbond-ui:${VERSION} AS ui @@ -47,20 +27,25 @@ RUN python -m venv --copies /app/ui/py_venv && \ python manage.py collectstatic --noinput --ignore weavescope-src --ignore drf-yasg --ignore rest_framework # build console image -FROM rainbond/python:3.6-slim-stretch +FROM python:3.6-slim-stretch + +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ + echo 'Asia/Shanghai' >/etc/timezone && \ + echo "deb http://archive.debian.org/debian/ stretch main" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list && \ + apt-get update && apt-get --no-install-recommends install -y \ + curl mysql-client sqlite3 default-libmysqlclient-dev && \ + rm -rf /var/lib/apt/lists/* + ARG RELEASE_DESC= ARG VERSION ARG ARCH=amd64 ARG INSTALL_VERSION -COPY --from=builder /go/src/goodrain.com/cloud-adaptor/chart /app/chart -COPY --from=builder /cloud-adaptor /app/cloudadaptor COPY --from=build-console /app/ui /app/ui WORKDIR /app/ui RUN mkdir -p /app/logs /app/data /root/.ssh && \ - mv /app/ui/supervisord.conf /etc/supervisor/supervisord.conf && \ - mv /app/ui/rainbond.conf /etc/supervisor/conf.d/rainbond.conf && \ apt-get update && apt-get install wget -y && \ if [ ${ARCH} = "arm64" ] || [ ${ARCH} = "aarch64" ]; then \ wget -O /usr/local/bin/helm "https://pkg.goodrain.com/pkg/helm/v3.10.1/helm-arm64" && chmod +x /usr/local/bin/helm; \ @@ -74,17 +59,11 @@ ENV PORT 7070 ENV IS_OPEN_API=true ENV RELEASE_DESC=${RELEASE_DESC} ENV HOME_DIR=/app -# cloud adaptor -ENV DB_PATH=/app/data/cloudadaptor -ENV CHART_PATH=/app/chart -ENV CONFIG_DIR=/app/data/cloudadaptor -ENV HELM_PATH=/usr/local/bin/helm -ENV MYSQL_DB=console -ENV RAINBOND_VERSION=$INSTALL_VERSION -ENV OPERATOR_VERSION=$INSTALL_VERSION VOLUME /app/data VOLUME /app/logs VOLUME /root/.ssh -CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf" ] +EXPOSE 7070 + +CMD [ "bash", "/app/ui/entrypoint.sh" ] diff --git a/Dockerfile.base b/Dockerfile.base deleted file mode 100644 index 4749f1e25a..0000000000 --- a/Dockerfile.base +++ /dev/null @@ -1,12 +0,0 @@ -FROM python:3.6-slim-stretch - -LABEL runtime="rainbond" -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ - echo 'Asia/Shanghai' >/etc/timezone && \ - echo "deb http://archive.debian.org/debian/ stretch main" > /etc/apt/sources.list && \ - echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list && \ - apt-get update && apt-get --no-install-recommends install -y \ - curl supervisor iptables mysql-client net-tools sqlite3 default-libmysqlclient-dev && \ - rm -rf /var/lib/apt/lists/* - -EXPOSE 7070 diff --git a/daemon.json b/daemon.json deleted file mode 100644 index fe6b7173fc..0000000000 --- a/daemon.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "registry-mirrors": [ - "https://dockerhub.azk8s.cn", - "https://docker.mirrors.ustc.edu.cn", - "http://hub-mirror.c.163.com" - ], - "max-concurrent-downloads": 10, - "max-concurrent-uploads": 10, - "log-driver": "json-file", - "log-level": "info", - "log-opts": { - "max-size": "10m", - "max-file": "3" - } -} diff --git a/local_update.sh b/local_update.sh deleted file mode 100755 index 6b85e1bb96..0000000000 --- a/local_update.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -[ -d "./www/static/dists" ] && rm -rf ./www/static/dists/* || mkdir -p ./www/static/dists - -cp -a dist/* ./www/static/dists/ - -cp dist/index.html www/templates/index.html - -rm -rf ./static - -cp -r www/static ./ \ No newline at end of file diff --git a/rainbond.conf b/rainbond.conf deleted file mode 100644 index a2573b3338..0000000000 --- a/rainbond.conf +++ /dev/null @@ -1,19 +0,0 @@ -[program:console] -priority=20 -directory=/app/ui/ -command=/app/ui/entrypoint.sh -user=root -autostart=true -autorestart=true -stdout_logfile=/app/logs/console.log -stderr_logfile=/app/logs/console_error.log - -[program:cloudadaptor] -priority=20 -directory=/app/ -command=/app/cloudadaptor daemon -user=root -autostart=true -autorestart=true -stdout_logfile=/app/logs/cloudadaptor.log -stderr_logfile=/app/logs/cloudadaptor_error.log diff --git a/supervisord.conf b/supervisord.conf deleted file mode 100644 index def296bb54..0000000000 --- a/supervisord.conf +++ /dev/null @@ -1,22 +0,0 @@ -[unix_http_server] -file=/var/run/supervisor.sock ; (the path to the socket file) -chmod=0700 ; sockef file mode (default 0700) - -[supervisord] -nodaemon=true -logfile=/app/logs/supervisord.log ; -pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) -childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) -loglevel=error -user=root -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket - -[include] -files = /etc/supervisor/conf.d/*.conf \ No newline at end of file diff --git a/tips.md b/tips.md deleted file mode 100644 index e6305dfa15..0000000000 --- a/tips.md +++ /dev/null @@ -1,15 +0,0 @@ -**问题** - -```bash -cc -bundle -undefined dynamic_lookup -Wl,-F. build/temp.macosx-10.14-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.14-intel-2.7/_mysql.so -ld: library not found for -lssl -clang: error: linker command failed with exit code 1 (use -v to see invocation) -error: command 'cc' failed with exit status 1 -``` - -解决方式: -``` -brew info openssl -export LDFLAGS="-L/usr/local/opt/openssl/lib" -export CPPFLAGS="-I/usr/local/opt/openssl/include" -``` \ No newline at end of file diff --git a/update_ui.sh b/update_ui.sh deleted file mode 100755 index f7f7929bb5..0000000000 --- a/update_ui.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -UI_REPO="https://github.com/goodrain/rainbond-ui.git" - -ui_dir="./test/ui" - -[ -d $ui_dir ] && rm -rf $ui_dir - -branch=$(git symbolic-ref --short -q HEAD) - -git clone -b "$branch" --depth 1 $UI_REPO $ui_dir - -if [ -d "./www/static/dists" ]; then - rm -rf ./www/static/dists/* -else - mkdir -p ./www/static/dists -fi - -pushd $ui_dir yarn install && yarn build || exit 1 -popd || exit 1 - -mkdir ./www/static/dists/ -cp -a $ui_dir/dist/* ./www/static/dists/ - -mv ./www/static/dists/index.html www/templates/index.html - -rm -rf $ui_dir