From ba4a729fa8a5b8d98d6b4f8c6dc7d60d178bd9fa Mon Sep 17 00:00:00 2001 From: "Zheng, Qi" Date: Tue, 26 Sep 2023 15:13:16 +0800 Subject: [PATCH] [ci] Add ci for Occlum runtime docker image build and push --- .../build_and_push_docker_rt_image.yml | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/build_and_push_docker_rt_image.yml diff --git a/.github/workflows/build_and_push_docker_rt_image.yml b/.github/workflows/build_and_push_docker_rt_image.yml new file mode 100644 index 00000000..b8ae2555 --- /dev/null +++ b/.github/workflows/build_and_push_docker_rt_image.yml @@ -0,0 +1,64 @@ +name: Occlum Runtime Docker Image Build and Push + +# This is a manual trigger. +on: + workflow_dispatch: + inputs: + OS: + description: 'OS name (must choose from )' + required: true + default: 'ubuntu20' + OCCLUM_VERSION: + description: 'The Occlum version is built on, e.g "0.29.7"' + required: true + default: '0.29.7' + SGX_PSW_VERSION: + description: 'The SGX PSW version libraries expected to be installed, e.g "2.17.100.3"' + required: true + default: '2.17.100.3' + SGX_DCAP_VERSION: + description: 'The SGX DCAP version libraries expected to be installed, e.g "1.14.100.3"' + required: true + default: '1.14.100.3' + +jobs: + generate-ubuntu20-rt-image: + runs-on: ubuntu-20.04 + if: github.event.inputs.OS == 'ubuntu20' + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + # Because "Build and push" step `context` field can't be subdir, + # we need to copy files needed by dockerfile to root dir of the project + - name: Copy context for docker build + run: | + cp -r tools/docker . + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=104857600 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: ./tools/docker + file: ./tools/docker/Dockerfile.ubuntu20.04-rt + platforms: linux/amd64 + build-args: | + "OCCLUM_VERSION=${{ github.event.inputs.OCCLUM_VERSION }}" + "SGX_PSW_VERSION=${{ github.event.inputs.SGX_PSW_VERSION }}" + "SGX_DCAP_VERSION=${{ github.event.inputs.SGX_DCAP_VERSION }}" + push: true + tags: occlum/occlum:${{ github.event.inputs.OCCLUM_VERSION }}-rt-ubuntu20.04