occlum/.github/workflows/composite_action/sim/action.yml
2024-07-23 17:29:54 +08:00

54 lines
2.0 KiB
YAML

name: 'Occlum composite action'
description: 'Occlum container run and source build/install'
inputs:
container-name:
description: 'Occlum container name'
required: true
build-envs:
description: 'Occlum build environments'
required: false
default: 'OCCLUM_RELEASE_BUILD=1'
os:
description: 'Occlum docker image base OS'
required: false
default: 'ubuntu20.04'
runs:
using: "composite"
steps:
- name: Print info
run: echo Occlum build environment ${{ inputs.build-envs }}
shell: bash
- name: Get occlum version
run: echo "OCCLUM_VERSION=$(grep "Version =" src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV
shell: bash
- name: Create container
run: docker run -itd --name=${{ inputs.container-name }} --privileged -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-${{ inputs.os }}
shell: bash
- uses: ./.github/workflows/composite_action/prebuild
with:
container-name: ${{ inputs.container-name }}
- name: Build dependencies
run: docker exec ${{ inputs.container-name }} bash -c "cd /root/occlum; make submodule"
shell: bash
- name: Make install
run: docker exec ${{ inputs.container-name }} bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; ${{ inputs.build-envs}} make install"
shell: bash
# When there comes new features, the configuration should be enabled accordingly
- name: Configure Occlum features
run: |
if [[ "${{ matrix.features }}" == "IO_Uring" ]]; then
docker exec ${{ inputs.container-name }} bash -c "jq '.feature.io_uring = 1' /opt/occlum/etc/template/Occlum.json > /tmp.json && mv /tmp.json /opt/occlum/etc/template/Occlum.json";
fi;
shell: bash
- name: Remove occlum installation package
run: docker exec ${{ inputs.container-name }} bash -c "cd /root/occlum; rm -rf ./build; rm -rf ./src; rm -rf ./deps"
shell: bash