From 9088ab1a9feefb36971f9fa55c14fa354a15aaf2 Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 25 Apr 2024 16:23:15 +0800 Subject: [PATCH 1/8] init .github/workflows/publish_latest_pd_store_server_image.yml --- .../publish_latest_pd_store_server_image.yml | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 .github/workflows/publish_latest_pd_store_server_image.yml diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml new file mode 100644 index 0000000..264806a --- /dev/null +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -0,0 +1,129 @@ +name: "Publish pd-store-server image(latest)" + +on: + workflow_dispatch: + inputs: + mvn_args: + required: false + default: 'MAVEN_ARGS=-P stage' + description: 'mvn build args, like "MAVEN_ARGS=-P stage"' + +jobs: + build_latest: + runs-on: ubuntu-latest + env: + REPOSITORY_URL: apache/hugegraph + BRANCH: pd-store-docker + PD_IMAGE_URL: hugegraph/pd:latest + STORE_IMAGE_URL: hugegraph/store:latest + SERVER_IMAGE_URL: hugegraph/server:latest + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + OWNER: hugegraph + REPO: actions + LAST_SERVER_HASH: ${{vars.LAST_SERVER_HASH}} + MVN_ARGS: ${{inputs.mvn_args}} + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Checkout latest + uses: actions/checkout@v4 + with: + repository: ${{ env.REPOSITORY_URL }} + ref: ${{ env.BRANCH }} + fetch-depth: 2 + + - name: Build Hugegraph + run: | + docker build -f Dockerfile.build -t hugegraph/hugegraph.build . + + - name: Build X86 PD Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./hugegraph-pd/Dockerfile + load: true + tags: ${{ env.PD_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} + + - name: Build X86 Store Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./hugegraph-store/Dockerfile + load: true + tags: ${{ env.STORE_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} + + - name: Build X86 Server Image + uses: docker/build-push-action@v5 + with: + context: . + file: ./hugegraph-server/Dockerfile + load: true + tags: ${{ env.SERVER_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} + + - name: Test X86 Images + run: | + docker images + docker run -itd --name=pd --network host $PD_IMAGE_URL + sleep 10s + docker run -itd --name=store --network host $STORE_IMAGE_URL + sleep 10s + docker run -itd --name=server --network host $SERVER_IMAGE_URL + sleep 10s + curl 0.0.0.0:8080 || exit + docker ps -a + sleep 10s + curl 0.0.0.0:8080 || exit + docker ps -a + + - name: Push X86 & ARM PD Images + uses: docker/build-push-action@v5 + with: + context: . + file: ./hugegraph-pd/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ env.PD_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} + + - name: Push X86 & ARM Store Images + uses: docker/build-push-action@v5 + with: + context: . + file: ./hugegraph-store/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ env.STORE_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} + + - name: Push X86 & ARM Server Images + uses: docker/build-push-action@v5 + with: + context: . + file: ./hugegraph-server/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ env.SERVER_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} From 2c42325b4cfb7cafd7f0399a811d5d3990ef844b Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 25 Apr 2024 16:28:29 +0800 Subject: [PATCH 2/8] remove useless --- .github/workflows/publish_latest_pd_store_server_image.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index 264806a..2dd44d5 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -17,10 +17,8 @@ jobs: PD_IMAGE_URL: hugegraph/pd:latest STORE_IMAGE_URL: hugegraph/store:latest SERVER_IMAGE_URL: hugegraph/server:latest - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} OWNER: hugegraph REPO: actions - LAST_SERVER_HASH: ${{vars.LAST_SERVER_HASH}} MVN_ARGS: ${{inputs.mvn_args}} steps: From f7a75ee31b2d23824da99ae418b71e9d6ac3a091 Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 25 Apr 2024 16:33:21 +0800 Subject: [PATCH 3/8] fix typo --- .../publish_latest_pd_store_server_image.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index 2dd44d5..41ba2d0 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -38,11 +38,11 @@ jobs: ref: ${{ env.BRANCH }} fetch-depth: 2 - - name: Build Hugegraph + - name: Build HugeGraph run: | docker build -f Dockerfile.build -t hugegraph/hugegraph.build . - - name: Build X86 PD Image + - name: Build x86 PD Image uses: docker/build-push-action@v5 with: context: . @@ -53,7 +53,7 @@ jobs: cache-to: type=gha,mode=max build-args: ${{ env.MVN_ARGS }} - - name: Build X86 Store Image + - name: Build x86 Store Image uses: docker/build-push-action@v5 with: context: . @@ -64,7 +64,7 @@ jobs: cache-to: type=gha,mode=max build-args: ${{ env.MVN_ARGS }} - - name: Build X86 Server Image + - name: Build x86 Server Image uses: docker/build-push-action@v5 with: context: . @@ -75,7 +75,7 @@ jobs: cache-to: type=gha,mode=max build-args: ${{ env.MVN_ARGS }} - - name: Test X86 Images + - name: Test x86 Images run: | docker images docker run -itd --name=pd --network host $PD_IMAGE_URL @@ -90,7 +90,7 @@ jobs: curl 0.0.0.0:8080 || exit docker ps -a - - name: Push X86 & ARM PD Images + - name: Push x86 & ARM PD Images uses: docker/build-push-action@v5 with: context: . @@ -102,7 +102,7 @@ jobs: cache-to: type=gha,mode=max build-args: ${{ env.MVN_ARGS }} - - name: Push X86 & ARM Store Images + - name: Push x86 & ARM Store Images uses: docker/build-push-action@v5 with: context: . @@ -114,7 +114,7 @@ jobs: cache-to: type=gha,mode=max build-args: ${{ env.MVN_ARGS }} - - name: Push X86 & ARM Server Images + - name: Push x86 & ARM Server Images uses: docker/build-push-action@v5 with: context: . From 6cbe80fd232db86417504e276cdddba4d3dce198 Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 25 Apr 2024 16:38:18 +0800 Subject: [PATCH 4/8] fix --- .../publish_latest_pd_store_server_image.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index 41ba2d0..a6fddf2 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -14,6 +14,7 @@ jobs: env: REPOSITORY_URL: apache/hugegraph BRANCH: pd-store-docker + HG_BUILD_IMAGE_URL: hugegraph/hugegraph.build:latest PD_IMAGE_URL: hugegraph/pd:latest STORE_IMAGE_URL: hugegraph/store:latest SERVER_IMAGE_URL: hugegraph/server:latest @@ -39,8 +40,15 @@ jobs: fetch-depth: 2 - name: Build HugeGraph - run: | - docker build -f Dockerfile.build -t hugegraph/hugegraph.build . + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile.build + load: true + tags: ${{ env.HG_BUILD_IMAGE_URL }} + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: ${{ env.MVN_ARGS }} - name: Build x86 PD Image uses: docker/build-push-action@v5 From 55a693bb9414dc8dcd79ea3659dc947a22bf5dcc Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 25 Apr 2024 17:08:19 +0800 Subject: [PATCH 5/8] test --- .github/workflows/publish_latest_pd_store_server_image.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index a6fddf2..41219ec 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -50,6 +50,10 @@ jobs: cache-to: type=gha,mode=max build-args: ${{ env.MVN_ARGS }} + - name: Test + run: | + docker images + - name: Build x86 PD Image uses: docker/build-push-action@v5 with: From a02cd1c25145a6809f26c67911e90e4feca077d7 Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 25 Apr 2024 18:14:07 +0800 Subject: [PATCH 6/8] reset --- .../publish_latest_pd_store_server_image.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index 41219ec..9046e64 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -14,12 +14,9 @@ jobs: env: REPOSITORY_URL: apache/hugegraph BRANCH: pd-store-docker - HG_BUILD_IMAGE_URL: hugegraph/hugegraph.build:latest PD_IMAGE_URL: hugegraph/pd:latest STORE_IMAGE_URL: hugegraph/store:latest SERVER_IMAGE_URL: hugegraph/server:latest - OWNER: hugegraph - REPO: actions MVN_ARGS: ${{inputs.mvn_args}} steps: @@ -39,21 +36,6 @@ jobs: ref: ${{ env.BRANCH }} fetch-depth: 2 - - name: Build HugeGraph - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile.build - load: true - tags: ${{ env.HG_BUILD_IMAGE_URL }} - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: ${{ env.MVN_ARGS }} - - - name: Test - run: | - docker images - - name: Build x86 PD Image uses: docker/build-push-action@v5 with: From c40ef01a078ec6aec35714e9ce6ba7e577606a18 Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Thu, 11 Jul 2024 00:37:44 +0800 Subject: [PATCH 7/8] test pd/store service --- .github/workflows/publish_latest_pd_store_server_image.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index 9046e64..f02bd1a 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -74,15 +74,14 @@ jobs: docker images docker run -itd --name=pd --network host $PD_IMAGE_URL sleep 10s + curl 0.0.0.0:8620 || exit docker run -itd --name=store --network host $STORE_IMAGE_URL sleep 10s + curl 0.0.0.0:8520 || exit docker run -itd --name=server --network host $SERVER_IMAGE_URL sleep 10s curl 0.0.0.0:8080 || exit docker ps -a - sleep 10s - curl 0.0.0.0:8080 || exit - docker ps -a - name: Push x86 & ARM PD Images uses: docker/build-push-action@v5 From 9af45bea49f5a591c113ad50e886ae673a559cee Mon Sep 17 00:00:00 2001 From: VGalaxies Date: Mon, 15 Jul 2024 22:47:44 +0800 Subject: [PATCH 8/8] update branch --- .github/workflows/publish_latest_pd_store_server_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_latest_pd_store_server_image.yml b/.github/workflows/publish_latest_pd_store_server_image.yml index f02bd1a..459d6e5 100644 --- a/.github/workflows/publish_latest_pd_store_server_image.yml +++ b/.github/workflows/publish_latest_pd_store_server_image.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest env: REPOSITORY_URL: apache/hugegraph - BRANCH: pd-store-docker + BRANCH: master PD_IMAGE_URL: hugegraph/pd:latest STORE_IMAGE_URL: hugegraph/store:latest SERVER_IMAGE_URL: hugegraph/server:latest