From f58652da96f85caea092f4a71c01a7d126e5a1b6 Mon Sep 17 00:00:00 2001 From: "Hui, Chunyang" Date: Wed, 31 Jan 2024 06:33:03 +0000 Subject: [PATCH] Remove reuse actions for release image --- .../workflows/build_and_push_docker_image.yml | 68 ++++++------------- 1 file changed, 20 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build_and_push_docker_image.yml b/.github/workflows/build_and_push_docker_image.yml index 18f4a812..e95575d6 100644 --- a/.github/workflows/build_and_push_docker_image.yml +++ b/.github/workflows/build_and_push_docker_image.yml @@ -12,12 +12,6 @@ on: description: 'Whether it is a release image or test image (must choose from )' required: true default: 'N' - # If rc image works well, directly tag with the release version - # source image: "reuse_image" specified here - # target iamge: Get from the current source code - reuse_image: - description: 'Set reuse image name, e.g.: 0.30.0-rc (When release is set to , admin can choose to reuse an old rc image as the new release image)' - required: false jobs: generate-anolis-image: @@ -44,6 +38,16 @@ jobs: # ${GITHUB_REF##*/} == branch-name run: echo "OCCLUM_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV; + - name: Get image tag name for release image + if: github.event.inputs.release == 'Y' + run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV + - name: Get image tage name for dev image + if: github.event.inputs.release == 'N' + run: echo "IMAGE_TAG=latest-dev-${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Get image tage name for test image + if: github.event.inputs.release == 'T' + run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}-test" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -58,19 +62,7 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get image tag name for release image - if: github.event.inputs.release == 'Y' - run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV - - name: Get image tage name for dev image - if: github.event.inputs.release == 'N' - run: echo "IMAGE_TAG=latest-dev-${GITHUB_SHA:0:7}" >> $GITHUB_ENV - - name: Get image tage name for test image - if: github.event.inputs.release == 'T' - run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}-test" >> $GITHUB_ENV - - # Rebuild new image - name: Build and push - if: "${{ github.event.inputs.reuse_image == '' }}" uses: docker/build-push-action@v2 with: context: . @@ -80,15 +72,6 @@ jobs: push: true tags: occlum/occlum:${{ env.IMAGE_TAG }}-anolis8.8 - # Reuse old image - - name: Reuse old image - if: "${{ github.event.inputs.reuse_image != '' }}" - run: | - echo "REUSE_VERSION=${{ github.event.inputs.reuse_image }}" >> $GITHUB_ENV; - docker pull occlum/occlum:${{ env.REUSE_VERSION }}-anolis8.8 - docker tag occlum/occlum:${{ env.REUSE_VERSION }}-anolis8.8 occlum/occlum:${{ env.IMAGE_TAG }}-anolis8.8 - docker push occlum/occlum:${{ env.IMAGE_TAG }}-anolis8.8 - generate-ubuntu20-image: runs-on: ubuntu-20.04 @@ -113,6 +96,16 @@ jobs: # ${GITHUB_REF##*/} == branch-name run: echo "OCCLUM_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV; + - name: Get image tag name for release image + if: github.event.inputs.release == 'Y' + run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV + - name: Get image tage name for dev image + if: github.event.inputs.release == 'N' + run: echo "IMAGE_TAG=latest-dev-${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Get image tage name for test image + if: github.event.inputs.release == 'T' + run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}-test" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -127,19 +120,7 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get image tag name for release image - if: github.event.inputs.release == 'Y' - run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV - - name: Get image tage name for dev image - if: github.event.inputs.release == 'N' - run: echo "IMAGE_TAG=latest-dev-${GITHUB_SHA:0:7}" >> $GITHUB_ENV - - name: Get image tage name for test image - if: github.event.inputs.release == 'T' - run: echo "IMAGE_TAG=${{ env.RELEASE_VERSION }}-test" >> $GITHUB_ENV - - # Rebuild new image - name: Build and push - if: "${{ github.event.inputs.reuse_image == '' }}" uses: docker/build-push-action@v2 with: context: . @@ -148,12 +129,3 @@ jobs: build-args: OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }} push: true tags: occlum/occlum:${{ env.IMAGE_TAG }}-ubuntu20.04 - - # Reuse old image - - name: Reuse old image - if: "${{ github.event.inputs.reuse_image != '' }}" - run: | - echo "REUSE_VERSION=${{ github.event.inputs.reuse_image }}" >> $GITHUB_ENV; - docker pull occlum/occlum:${{ env.REUSE_VERSION }}-ubuntu20.04 - docker tag occlum/occlum:${{ env.REUSE_VERSION }}-ubuntu20.04 occlum/occlum:${{ env.IMAGE_TAG }}-ubuntu20.04 - docker push occlum/occlum:${{ env.IMAGE_TAG }}-ubuntu20.04