You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2023/03/17 06:41:20 UTC

[inlong] branch master updated: [INLONG-7626][Docker] Optimize the docker push workflow (#7627)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new d1bd10742 [INLONG-7626][Docker] Optimize the docker push workflow (#7627)
d1bd10742 is described below

commit d1bd1074274436a83d051ce3dadcaca3d678988e
Author: Lucas <10...@users.noreply.github.com>
AuthorDate: Fri Mar 17 14:41:13 2023 +0800

    [INLONG-7626][Docker] Optimize the docker push workflow (#7627)
---
 .github/workflows/ci_docker.yml | 20 ++++++++++++++++++++
 docker/build-docker-images.sh   |  4 +---
 docker/publish-by-arch.sh       | 24 ++++++------------------
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml
index 2665f4015..325de38bb 100644
--- a/.github/workflows/ci_docker.yml
+++ b/.github/workflows/ci_docker.yml
@@ -81,6 +81,26 @@ jobs:
           key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
           restore-keys: ${{ runner.os }}-m2
 
+      - name: Set up swapfile path
+        run: |
+          sudo sysctl -w vm.max_map_count=262144
+          sudo sysctl -w fs.file-max=65536
+          sudo fallocate -l 5G /swapfile
+          sudo chmod 600 /swapfile
+          sudo mkswap /swapfile
+          sudo swapon /swapfile
+
+      - name: Remove unnecessary packages
+        run: |
+          echo "=== Before pruning ==="
+          df -h
+          sudo rm -rf /usr/share/dotnet
+          sudo rm -rf /usr/local/lib/android
+          sudo rm -rf /opt/ghc
+          echo
+          echo "=== After pruning ==="
+          df -h
+
       - name: Build Docker images
         run: mvn --batch-mode --update-snapshots -e -V clean package -DskipTests -Pdocker
         env:
diff --git a/docker/build-docker-images.sh b/docker/build-docker-images.sh
index 592daf27b..53a435d0f 100644
--- a/docker/build-docker-images.sh
+++ b/docker/build-docker-images.sh
@@ -138,10 +138,9 @@ docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/dataproxy:${tag}
 docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/audit:${tag}          inlong-audit/audit-docker/          --build-arg AUDIT_TARBALL=${AUDIT_TARBALL}
 docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/dashboard:${tag}      inlong-dashboard/                   --build-arg DASHBOARD_FILE=${DASHBOARD_FILE}
 docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/agent:${tag}          inlong-agent/agent-docker/          --build-arg AGENT_TARBALL=${AGENT_TARBALL}
-docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/tubemq-all:${tag}     inlong-tubemq/tubemq-docker/tubemq-all/     --build-arg TUBEMQ_TARBALL=${TUBEMQ_TARBALL}
 docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/tubemq-manager:${tag} inlong-tubemq/tubemq-docker/tubemq-manager/ --build-arg TUBEMQ_MANAGER_TARBALL=${TUBEMQ_MANAGER_TARBALL}
 if [ "$BUILD_ARCH" = "$ARCH_X86" ]; then
-  docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/tubemq-cpp:${tag}    inlong-tubemq/tubemq-docker/tubemq-cpp/
+  docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/tubemq-all:${tag}     inlong-tubemq/tubemq-docker/tubemq-all/     --build-arg TUBEMQ_TARBALL=${TUBEMQ_TARBALL}
   docker ${USE_BUILDX} build ${USE_PLATFORM} ${TYPE} -t inlong/tubemq-build:${tag}  inlong-tubemq/tubemq-docker/tubemq-build/
 fi
 
@@ -159,7 +158,6 @@ docker tag inlong/dashboard:${tag}       inlong/dashboard:latest${POSTFIX}
 docker tag inlong/agent:${tag}           inlong/agent:latest${POSTFIX}
 docker tag inlong/tubemq-all:${tag}      inlong/tubemq-all:latest${POSTFIX}
 if [ "$BUILD_ARCH" = "$ARCH_X86" ]; then
-  docker tag inlong/tubemq-cpp:${tag}   inlong/tubemq-cpp:latest${POSTFIX}
   docker tag inlong/tubemq-build:${tag} inlong/tubemq-build:latest${POSTFIX}
 fi
 
diff --git a/docker/publish-by-arch.sh b/docker/publish-by-arch.sh
index 8cfd5d30f..9ab0565c7 100644
--- a/docker/publish-by-arch.sh
+++ b/docker/publish-by-arch.sh
@@ -58,7 +58,6 @@ initTagImageForx86() {
   docker tag inlong/tubemq-all:latest${SRC_POSTFIX}      inlong/tubemq-all:latest${DES_POSTFIX}
   docker tag inlong/tubemq-build:latest${SRC_POSTFIX}    inlong/tubemq-build:latest${DES_POSTFIX}
   docker tag inlong/dashboard:latest${SRC_POSTFIX}       inlong/dashboard:latest${DES_POSTFIX}
-  docker tag inlong/tubemq-cpp:latest${SRC_POSTFIX}      inlong/tubemq-cpp:latest${DES_POSTFIX}
   docker tag inlong/audit:latest${SRC_POSTFIX}           inlong/audit:latest${DES_POSTFIX}
 
   docker tag inlong/manager:${MVN_VERSION}${SRC_POSTFIX}         inlong/manager:${MVN_VERSION}${DES_POSTFIX}
@@ -68,7 +67,6 @@ initTagImageForx86() {
   docker tag inlong/tubemq-all:${MVN_VERSION}${SRC_POSTFIX}      inlong/tubemq-all:${MVN_VERSION}${DES_POSTFIX}
   docker tag inlong/tubemq-build:${MVN_VERSION}${SRC_POSTFIX}    inlong/tubemq-build:${MVN_VERSION}${DES_POSTFIX}
   docker tag inlong/dashboard:${MVN_VERSION}${SRC_POSTFIX}       inlong/dashboard:${MVN_VERSION}${DES_POSTFIX}
-  docker tag inlong/tubemq-cpp:${MVN_VERSION}${SRC_POSTFIX}      inlong/tubemq-cpp:${MVN_VERSION}${DES_POSTFIX}
   docker tag inlong/audit:${MVN_VERSION}${SRC_POSTFIX}           inlong/audit:${MVN_VERSION}${DES_POSTFIX}
 }
 
@@ -94,9 +92,8 @@ tagImage() {
   docker tag inlong/tubemq-manager:latest${SRC_POSTFIX}  ${docker_registry_org}/tubemq-manager:latest${DES_POSTFIX}
   docker tag inlong/dashboard:latest${SRC_POSTFIX}       ${docker_registry_org}/dashboard:latest${DES_POSTFIX}
   docker tag inlong/audit:latest${SRC_POSTFIX}           ${docker_registry_org}/audit:latest${DES_POSTFIX}
-  docker tag inlong/tubemq-all:latest${SRC_POSTFIX}      ${docker_registry_org}/tubemq-all:latest${DES_POSTFIX}
   if [ "$BUILD_ARCH" = "$ARCH_X86" ]; then
-    docker tag inlong/tubemq-cpp:latest${SRC_POSTFIX}      ${docker_registry_org}/tubemq-cpp:latest${DES_POSTFIX}
+    docker tag inlong/tubemq-all:latest${SRC_POSTFIX}      ${docker_registry_org}/tubemq-all:latest${DES_POSTFIX}
     docker tag inlong/tubemq-build:latest${SRC_POSTFIX}    ${docker_registry_org}/tubemq-build:latest${DES_POSTFIX}
   fi
 
@@ -106,9 +103,8 @@ tagImage() {
   docker tag inlong/tubemq-manager:${MVN_VERSION}${SRC_POSTFIX}  ${docker_registry_org}/tubemq-manager:${MVN_VERSION}${DES_POSTFIX}
   docker tag inlong/dashboard:${MVN_VERSION}${SRC_POSTFIX}       ${docker_registry_org}/dashboard:${MVN_VERSION}${DES_POSTFIX}
   docker tag inlong/audit:${MVN_VERSION}${SRC_POSTFIX}           ${docker_registry_org}/audit:${MVN_VERSION}${DES_POSTFIX}
-  docker tag inlong/tubemq-all:${MVN_VERSION}${SRC_POSTFIX}      ${docker_registry_org}/tubemq-all:${MVN_VERSION}${DES_POSTFIX}
   if [ "$BUILD_ARCH" = "$ARCH_X86" ]; then
-    docker tag inlong/tubemq-cpp:${MVN_VERSION}${SRC_POSTFIX}      ${docker_registry_org}/tubemq-cpp:${MVN_VERSION}${DES_POSTFIX}
+    docker tag inlong/tubemq-all:${MVN_VERSION}${SRC_POSTFIX}      ${docker_registry_org}/tubemq-all:${MVN_VERSION}${DES_POSTFIX}
     docker tag inlong/tubemq-build:${MVN_VERSION}${SRC_POSTFIX}    ${docker_registry_org}/tubemq-build:${MVN_VERSION}${DES_POSTFIX}
   fi
   echo "End tagging images"
@@ -148,7 +144,6 @@ pushDefaultImage() {
   docker push inlong/tubemq-all:latest
   docker push inlong/tubemq-build:latest
   docker push inlong/dashboard:latest
-  docker push inlong/tubemq-cpp:latest
   docker push inlong/audit:latest
   docker push inlong/manager:${MVN_VERSION}
   docker push inlong/agent:${MVN_VERSION}
@@ -157,7 +152,6 @@ pushDefaultImage() {
   docker push inlong/tubemq-all:${MVN_VERSION}
   docker push inlong/tubemq-build:${MVN_VERSION}
   docker push inlong/dashboard:${MVN_VERSION}
-  docker push inlong/tubemq-cpp:${MVN_VERSION}
   docker push inlong/audit:${MVN_VERSION}
 }
 
@@ -183,10 +177,9 @@ pushImage() {
   docker push inlong/tubemq-manager:latest${SRC_POSTFIX}
   docker push inlong/dashboard:latest${SRC_POSTFIX}
   docker push inlong/audit:latest${SRC_POSTFIX}
-  docker push inlong/tubemq-all:latest${SRC_POSTFIX}
   if [ "$BUILD_ARCH" = "$ARCH_X86" ]; then
     docker push inlong/tubemq-build:latest${SRC_POSTFIX}
-    docker push inlong/tubemq-cpp:latest${SRC_POSTFIX}
+    docker push inlong/tubemq-all:latest${SRC_POSTFIX}
   fi
 
   docker push inlong/manager:${MVN_VERSION}${SRC_POSTFIX}
@@ -195,10 +188,9 @@ pushImage() {
   docker push inlong/tubemq-manager:${MVN_VERSION}${SRC_POSTFIX}
   docker push inlong/dashboard:${MVN_VERSION}${SRC_POSTFIX}
   docker push inlong/audit:${MVN_VERSION}${SRC_POSTFIX}
-  docker push inlong/tubemq-all:${MVN_VERSION}${SRC_POSTFIX}
   if [ "$BUILD_ARCH" = "$ARCH_X86" ]; then
     docker push inlong/tubemq-build:${MVN_VERSION}${SRC_POSTFIX}
-    docker push inlong/tubemq-cpp:${MVN_VERSION}${SRC_POSTFIX}
+    docker push inlong/tubemq-all:${MVN_VERSION}${SRC_POSTFIX}
   fi
 
   echo "Finished pushing images to inlong"
@@ -211,9 +203,8 @@ pushManifest() {
   docker manifest create --insecure --amend inlong/dataproxy:latest      inlong/dataproxy:latest-aarch64      inlong/dataproxy:latest-x86
   docker manifest create --insecure --amend inlong/dashboard:latest      inlong/dashboard:latest-aarch64      inlong/dashboard:latest-x86
   docker manifest create --insecure --amend inlong/audit:latest          inlong/audit:latest-aarch64          inlong/audit:latest-x86
-  docker manifest create --insecure --amend inlong/tubemq-all:latest     inlong/tubemq-all:latest-aarch64     inlong/tubemq-all:latest-x86
+  docker manifest create --insecure --amend inlong/tubemq-all:latest     inlong/tubemq-all:latest-x86
   docker manifest create --insecure --amend inlong/tubemq-manager:latest inlong/tubemq-manager:latest-aarch64 inlong/tubemq-manager:latest-x86
-  docker manifest create --insecure --amend inlong/tubemq-cpp:latest     inlong/tubemq-cpp:latest-x86
   docker manifest create --insecure --amend inlong/tubemq-build:latest   inlong/tubemq-build:latest-x86
 
   docker manifest push inlong/manager:latest
@@ -223,7 +214,6 @@ pushManifest() {
   docker manifest push inlong/tubemq-all:latest
   docker manifest push inlong/tubemq-build:latest
   docker manifest push inlong/dashboard:latest
-  docker manifest push inlong/tubemq-cpp:latest
   docker manifest push inlong/audit:latest
 
   docker manifest create --insecure --amend inlong/manager:${MVN_VERSION}        inlong/manager:${MVN_VERSION}-aarch64        inlong/manager:${MVN_VERSION}-x86
@@ -232,9 +222,8 @@ pushManifest() {
   docker manifest create --insecure --amend inlong/dashboard:${MVN_VERSION}      inlong/dashboard:${MVN_VERSION}-aarch64      inlong/dashboard:${MVN_VERSION}-x86
   docker manifest create --insecure --amend inlong/audit:${MVN_VERSION}          inlong/audit:${MVN_VERSION}-aarch64          inlong/audit:${MVN_VERSION}-x86
   docker manifest create --insecure --amend inlong/tubemq-manager:${MVN_VERSION} inlong/tubemq-manager:${MVN_VERSION}-aarch64 inlong/tubemq-manager:${MVN_VERSION}-x86
-  docker manifest create --insecure --amend inlong/tubemq-all:${MVN_VERSION}     inlong/tubemq-all:${MVN_VERSION}-aarch64     inlong/tubemq-all:${MVN_VERSION}-x86
+  docker manifest create --insecure --amend inlong/tubemq-all:${MVN_VERSION}     inlong/tubemq-all:${MVN_VERSION}-x86
   docker manifest create --insecure --amend inlong/tubemq-build:${MVN_VERSION}   inlong/tubemq-build:${MVN_VERSION}-x86
-  docker manifest create --insecure --amend inlong/tubemq-cpp:${MVN_VERSION}     inlong/tubemq-cpp:${MVN_VERSION}-x86
 
   docker manifest push inlong/manager:${MVN_VERSION}
   docker manifest push inlong/agent:${MVN_VERSION}
@@ -243,7 +232,6 @@ pushManifest() {
   docker manifest push inlong/tubemq-all:${MVN_VERSION}
   docker manifest push inlong/tubemq-build:${MVN_VERSION}
   docker manifest push inlong/dashboard:${MVN_VERSION}
-  docker manifest push inlong/tubemq-cpp:${MVN_VERSION}
   docker manifest push inlong/audit:${MVN_VERSION}
   echo "End pushing manifest"
 }