[ci] Update occlum rt docker image ci build

This commit is contained in:
Qi Zheng 2024-03-20 14:30:47 +08:00 committed by volcano
parent 295361df0b
commit 06fd64e74c

@ -5,26 +5,26 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
OS: OS:
description: 'OS name (must choose from <ubuntu20>)' description: 'OS name (must choose from <ubuntu20, ubuntu22>)'
required: true required: true
default: 'ubuntu20' default: 'ubuntu20'
OCCLUM_VERSION: OCCLUM_VERSION:
description: 'The Occlum version is built on, e.g "0.29.7"' description: 'The Occlum version is built on, e.g "0.30.1"'
required: true required: true
default: '0.29.7' default: '0.30.1'
SGX_PSW_VERSION: SGX_PSW_VERSION:
description: 'The SGX PSW version libraries expected to be installed, e.g "2.17.100.3"' description: 'The SGX PSW version libraries expected to be installed, e.g "2.20.100.4"'
required: true required: true
default: '2.17.100.3' default: '2.20.100.4'
SGX_DCAP_VERSION: SGX_DCAP_VERSION:
description: 'The SGX DCAP version libraries expected to be installed, e.g "1.14.100.3"' description: 'The SGX DCAP version libraries expected to be installed, e.g "1.17.100.4"'
required: true required: true
default: '1.14.100.3' default: '1.17.100.4'
jobs: jobs:
generate-ubuntu20-rt-image: generate-ubuntu-rt-image:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
if: github.event.inputs.OS == 'ubuntu20' if: github.event.inputs.OS == 'ubuntu20' || github.event.inputs.OS == 'ubuntu22'
steps: steps:
- name: Checkout code - name: Checkout code
@ -50,15 +50,23 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Choose image base OS
run: |
if [[ "${{ github.event.inputs.OS }}" == "ubuntu22" ]]; then
echo "IMAGE_BASE=ubuntu22.04" >> $GITHUB_ENV
else
echo "IMAGE_BASE=ubuntu20.04" >> $GITHUB_ENV
fi;
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ./tools/docker context: ./tools/docker
file: ./tools/docker/Dockerfile.ubuntu20.04-rt file: ./tools/docker/Dockerfile.${{ env.IMAGE_BASE }}-rt
platforms: linux/amd64 platforms: linux/amd64
build-args: | build-args: |
"OCCLUM_VERSION=${{ github.event.inputs.OCCLUM_VERSION }}" "OCCLUM_VERSION=${{ github.event.inputs.OCCLUM_VERSION }}"
"SGX_PSW_VERSION=${{ github.event.inputs.SGX_PSW_VERSION }}" "SGX_PSW_VERSION=${{ github.event.inputs.SGX_PSW_VERSION }}"
"SGX_DCAP_VERSION=${{ github.event.inputs.SGX_DCAP_VERSION }}" "SGX_DCAP_VERSION=${{ github.event.inputs.SGX_DCAP_VERSION }}"
push: true push: true
tags: occlum/occlum:${{ github.event.inputs.OCCLUM_VERSION }}-rt-ubuntu20.04 tags: occlum/occlum:${{ github.event.inputs.OCCLUM_VERSION }}-rt-${{ env.IMAGE_BASE }}