From fbcf20d383241363ea71934aa40f95b68d512e33 Mon Sep 17 00:00:00 2001 From: zhubojun Date: Tue, 1 Mar 2022 13:22:59 +0800 Subject: [PATCH] Upgrade CI image to ubuntu20.04 --- .github/workflows/build_and_push_ci_image.yml | 20 +++---- .github/workflows/code_coverage.yaml | 4 +- .github/workflows/demo_test.yml | 60 +++++++++---------- demos/grpc/download_and_install_grpc.sh | 3 +- demos/openvino/download_and_build_openvino.sh | 4 +- demos/xgboost/install_cmake.sh | 2 +- tools/docker/ci/Dockerfile.grpc | 2 +- tools/docker/ci/Dockerfile.gvisor_test | 2 +- tools/docker/ci/Dockerfile.openvino | 2 +- tools/docker/ci/Dockerfile.python | 2 +- tools/docker/ci/Dockerfile.tf_serving_occlum | 2 +- 11 files changed, 52 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build_and_push_ci_image.yml b/.github/workflows/build_and_push_ci_image.yml index 7944b2c1..776ff7ea 100644 --- a/.github/workflows/build_and_push_ci_image.yml +++ b/.github/workflows/build_and_push_ci_image.yml @@ -22,7 +22,7 @@ on: jobs: Build_grpc_image: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.event.inputs.image_name == 'grpc' steps: @@ -67,11 +67,11 @@ jobs: "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" "OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}" push: true - tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-grpc + tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu20.04-grpc Build_gvisor_test_image: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.event.inputs.image_name == 'gvisor_test' steps: @@ -110,11 +110,11 @@ jobs: "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" "OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}" push: true - tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-gvisor_test + tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu20.04-gvisor_test Build_openvino_image: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.event.inputs.image_name == 'openvino' steps: @@ -158,11 +158,11 @@ jobs: "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" "OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}" push: true - tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-openvino + tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu20.04-openvino Build_python_image: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.event.inputs.image_name == 'python' steps: @@ -206,7 +206,7 @@ jobs: "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" "OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}" push: true - tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-python + tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu20.04-python # TODO: Add actions to build tf_serving_base image. @@ -214,7 +214,7 @@ jobs: # Thus dividing into two jobs. Build_tf_serving_image: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 if: github.event.inputs.image_name == 'tf_serving' steps: @@ -259,4 +259,4 @@ jobs: "OCCLUM_VERSION=${{ env.OCCLUM_VERSION }}" "OCCLUM_BRANCH=${{ env.OCCLUM_BRANCH }}" push: true - tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu18.04-tf_serving + tags: occlumbackup/occlum:${{ github.event.inputs.tag }}-ubuntu20.04-tf_serving diff --git a/.github/workflows/code_coverage.yaml b/.github/workflows/code_coverage.yaml index 02656d39..07cab37e 100644 --- a/.github/workflows/code_coverage.yaml +++ b/.github/workflows/code_coverage.yaml @@ -8,7 +8,7 @@ env: jobs: Collect-code-coverage: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: @@ -18,7 +18,7 @@ jobs: run: echo "OCCLUM_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; - name: Create container - run: docker run -itd --name=code_coverage -e OCCLUM_LOG_LEVEL=trace -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04 + run: docker run -itd --name=code_coverage -e OCCLUM_LOG_LEVEL=trace -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu20.04 - name: Build dependencies run: docker exec code_coverage bash -c "cargo uninstall sccache || true; cd /root/occlum; make submodule" diff --git a/.github/workflows/demo_test.yml b/.github/workflows/demo_test.yml index c422e5c1..32b4dd00 100644 --- a/.github/workflows/demo_test.yml +++ b/.github/workflows/demo_test.yml @@ -9,7 +9,7 @@ env: jobs: C_cpp_rust_golang_embedded_mode_support_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -77,7 +77,7 @@ jobs: docker exec ${{ github.job }} bash -c "curl http://127.0.0.1:8090/ping" Java_support_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -101,7 +101,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/java && SGX_MODE=SIM ./run_java_on_occlum.sh processBuilder" Fish_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -122,7 +122,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/fish && SGX_MODE=SIM ./run_per_process_config_test.sh" Bazel_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -149,7 +149,7 @@ jobs: Https_server_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -173,7 +173,7 @@ jobs: Local_attestation_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -193,7 +193,7 @@ jobs: Sqlite_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -212,7 +212,7 @@ jobs: Xgboost_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -234,7 +234,7 @@ jobs: Tensorflow_lite_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -256,7 +256,7 @@ jobs: Pytorch_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -286,7 +286,7 @@ jobs: Tensorflow_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -306,14 +306,14 @@ jobs: # Below tests needs test image to run faster Grpc_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: submodules: true - name: Create container - run: docker run -itd --name=${{ github.job }} -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-grpc + run: docker run -itd --name=${{ github.job }} -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu20.04-grpc - name: Build dependencies run: docker exec ${{ github.job }} bash -c "cd /root/occlum; make submodule" @@ -333,7 +333,7 @@ jobs: docker exec ${{ github.job }} bash -c "cd /root/demos/grpc && SGX_MODE=SIM ./run_client_on_occlum.sh" Grpc_tls_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -364,14 +364,14 @@ jobs: Openvino_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: submodules: true - name: Create container - run: docker run -itd --name=${{ github.job }} -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-openvino + run: docker run -itd --name=${{ github.job }} -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu20.04-openvino - name: Build dependencies run: docker exec ${{ github.job }} bash -c "cd /root/occlum; make submodule" @@ -385,13 +385,13 @@ jobs: # Python test also needs its own image because in Alpine environment, modules are built locally and consumes a lot of time. Python_musl_support_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: submodules: true - name: Create container - run: docker run -itd --name=${{ github.job }} -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-python + run: docker run -itd --name=${{ github.job }} -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu20.04-python - name: Build dependencies run: docker exec ${{ github.job }} bash -c "cd /root/occlum; make submodule" @@ -407,7 +407,7 @@ jobs: # Python glibc support test Python_glibc_support_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -429,7 +429,7 @@ jobs: # Redis test Redis_support_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -458,7 +458,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/redis; SGX_MODE=SIM ./benchmark_glibc.sh" flink_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -488,7 +488,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/flink; cat occlum_instance_taskmanager/flink--taskmanager-0.log" Cluster_serving_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -506,7 +506,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/cluster_serving; source ./environment.sh; SGX_MODE=SIM ./start-all.sh; ./push-image.sh" enclave_ra_tls_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -530,7 +530,7 @@ jobs: docker exec ${{ github.job }} bash -c "/usr/share/enclave-tls/samples/enclave-tls-client" || true vault_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -553,7 +553,7 @@ jobs: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/vault && ./run_occlum_vault_test.sh" sofaboot_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -579,7 +579,7 @@ jobs: docker exec ${{ github.job }} bash -c "curl -s http://localhost:8080/actuator/readiness | grep -v DOWN" Bash_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -597,7 +597,7 @@ jobs: run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/bash && SGX_MODE=SIM ./run_bash_demo.sh" Sysbench_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -620,7 +620,7 @@ jobs: Gvisor_syscalls_test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 with: @@ -628,8 +628,8 @@ jobs: - name: Create container run: | - docker pull occlumbackup/occlum:latest-ubuntu18.04-gvisor_test - gvisor_test=$(docker run -itd -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-gvisor_test); + docker pull occlumbackup/occlum:latest-ubuntu20.04-gvisor_test + gvisor_test=$(docker run -itd -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu20.04-gvisor_test); echo "gvisor_test=$gvisor_test" >> $GITHUB_ENV - name: Build dependencies diff --git a/demos/grpc/download_and_install_grpc.sh b/demos/grpc/download_and_install_grpc.sh index 5daec3ed..4c2110e9 100755 --- a/demos/grpc/download_and_install_grpc.sh +++ b/demos/grpc/download_and_install_grpc.sh @@ -47,7 +47,8 @@ cmake ../ \ -Dprotobuf_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=TRUE \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=occlum-gcc \ -DCMAKE_CXX_COMPILER=occlum-g++ -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \ - -DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE + -DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE \ + -DZLIB_INCLUDE_DIR=/usr/local/occlum/x86_64-linux-musl/include if [ $? -ne 0 ] then diff --git a/demos/openvino/download_and_build_openvino.sh b/demos/openvino/download_and_build_openvino.sh index 1dac1794..34bd0142 100755 --- a/demos/openvino/download_and_build_openvino.sh +++ b/demos/openvino/download_and_build_openvino.sh @@ -28,7 +28,7 @@ build_opencv() { -DBUILD_opencv_python=OFF -DBUILD_PYTHON_SUPPORT=OFF \ -DBUILD_EXAMPLES=OFF -DWITH_FFMPEG=OFF \ -DWITH_QT=OFF -DWITH_CUDA=OFF - make -j4 + make -j$(nproc) sudo make install popd } @@ -79,7 +79,7 @@ build_openvino() { -DENABLE_MYRIAD=OFF \ -DENABLE_GNA=OFF \ -DENABLE_VPU=OFF - make -j4 + make -j$(nproc) popd } diff --git a/demos/xgboost/install_cmake.sh b/demos/xgboost/install_cmake.sh index cc99829c..87992079 100755 --- a/demos/xgboost/install_cmake.sh +++ b/demos/xgboost/install_cmake.sh @@ -4,5 +4,5 @@ cd ~ wget https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz && tar xf cmake-3.15.5.tar.gz cd cmake-3.15.5 ./bootstrap -make -j4 +make -j$(nproc) sudo make install diff --git a/tools/docker/ci/Dockerfile.grpc b/tools/docker/ci/Dockerfile.grpc index 1c6b1228..3daa4bfa 100644 --- a/tools/docker/ci/Dockerfile.grpc +++ b/tools/docker/ci/Dockerfile.grpc @@ -1,5 +1,5 @@ ARG OCCLUM_VERSION -FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base +FROM occlum/occlum:$OCCLUM_VERSION-ubuntu20.04 as base LABEL maintainer="Chunyang Hui " ARG OCCLUM_BRANCH diff --git a/tools/docker/ci/Dockerfile.gvisor_test b/tools/docker/ci/Dockerfile.gvisor_test index 000e27df..4b79d7fc 100644 --- a/tools/docker/ci/Dockerfile.gvisor_test +++ b/tools/docker/ci/Dockerfile.gvisor_test @@ -1,5 +1,5 @@ ARG OCCLUM_VERSION -FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base +FROM occlum/occlum:$OCCLUM_VERSION-ubuntu20.04 as base LABEL maintainer="He Sun " # Install bazel diff --git a/tools/docker/ci/Dockerfile.openvino b/tools/docker/ci/Dockerfile.openvino index f25ea10f..866f23ef 100644 --- a/tools/docker/ci/Dockerfile.openvino +++ b/tools/docker/ci/Dockerfile.openvino @@ -1,5 +1,5 @@ ARG OCCLUM_VERSION -FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base +FROM occlum/occlum:$OCCLUM_VERSION-ubuntu20.04 as base LABEL maintainer="Chunyang Hui " ARG OCCLUM_BRANCH diff --git a/tools/docker/ci/Dockerfile.python b/tools/docker/ci/Dockerfile.python index 259d8816..dd1a42c8 100644 --- a/tools/docker/ci/Dockerfile.python +++ b/tools/docker/ci/Dockerfile.python @@ -4,7 +4,7 @@ FROM python:3.7-alpine3.10 as alpine RUN apk add g++ lapack-dev gfortran && \ pip3 install numpy pandas scipy==1.3.1 Cython scikit-learn==0.21.1 -FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base +FROM occlum/occlum:$OCCLUM_VERSION-ubuntu20.04 as base LABEL maintainer="Chunyang Hui " WORKDIR /root/demos/python diff --git a/tools/docker/ci/Dockerfile.tf_serving_occlum b/tools/docker/ci/Dockerfile.tf_serving_occlum index 4f520755..a5b1ddf4 100644 --- a/tools/docker/ci/Dockerfile.tf_serving_occlum +++ b/tools/docker/ci/Dockerfile.tf_serving_occlum @@ -2,7 +2,7 @@ ARG OCCLUM_VERSION FROM occlumbackup/occlum:latest-ubuntu18.04-tf_serving_base as binary_build WORKDIR /root -FROM occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 as base +FROM occlum/occlum:$OCCLUM_VERSION-ubuntu20.04 as base LABEL maintainer="Chunyang Hui " WORKDIR /root