From 4373af1cdcc91407c896032d4d97b8ed137611ac Mon Sep 17 00:00:00 2001 From: "Zheng, Qi" Date: Tue, 9 Nov 2021 10:47:25 +0800 Subject: [PATCH] Use github.job as the name of the created container --- .github/workflows/demo_test.yml | 206 ++++++++++++++++---------------- .github/workflows/main.yml | 20 ++-- 2 files changed, 113 insertions(+), 113 deletions(-) diff --git a/.github/workflows/demo_test.yml b/.github/workflows/demo_test.yml index afc0cf8b..e2f1b3e1 100644 --- a/.github/workflows/demo_test.yml +++ b/.github/workflows/demo_test.yml @@ -17,11 +17,11 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'language_support_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: C test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/hello_c && make; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/hello_c && make; occlum new occlum_instance; cd occlum_instance && rm -rf image; copy_bom -f ../hello.yaml --root image --include-dir /opt/occlum/etc/template; @@ -29,7 +29,7 @@ jobs: occlum run /bin/hello_world" - name: C with encrypted image test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/hello_c && make; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/hello_c && make; rm -rf occlum_instance && occlum new occlum_instance; occlum gen-image-key occlum_instance/image_key; cd occlum_instance && rm -rf image; @@ -38,7 +38,7 @@ jobs: occlum run /bin/hello_world" - name: C++ test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/hello_cc && make; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/hello_cc && make; occlum new occlum_instance; cd occlum_instance && rm -rf image; copy_bom -f ../hello.yaml --root image --include-dir /opt/occlum/etc/template; @@ -46,35 +46,35 @@ jobs: occlum run /bin/hello_world" - name: Rust test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/rust && SGX_MODE=SIM ./run_rust_demo_on_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/rust && SGX_MODE=SIM ./run_rust_demo_on_occlum.sh" - name: Embedded mode test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/embedded_mode && SGX_MODE=SIM make; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/embedded_mode && SGX_MODE=SIM make; SGX_MODE=SIM make test" - name: Run Golang sqlite test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/golang/go_sqlite/ && SGX_MODE=SIM ./run_go_sqlite_demo.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/go_sqlite/ && SGX_MODE=SIM ./run_go_sqlite_demo.sh" - name: Go Server set up and run - run: docker exec language_support_test bash -c "cd /root/occlum/demos/golang/web_server && occlum-go mod init web_server && occlum-go get -u -v github.com/gin-gonic/gin; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/web_server && occlum-go mod init web_server && occlum-go get -u -v github.com/gin-gonic/gin; occlum-go build -o web_server ./web_server.go; SGX_MODE=SIM ./run_golang_on_occlum.sh" & - name: Set up Golang grpc pingpong test - run: docker exec language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && ./prepare_ping_pong.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/grpc_pingpong && ./prepare_ping_pong.sh" - name: Start Golang grpc pingpong server - run: docker exec language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && SGX_MODE=SIM ./run_pong_on_occlum.sh" & + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/grpc_pingpong && SGX_MODE=SIM ./run_pong_on_occlum.sh" & - name: Run Golang grpc ping test run: | sleep ${{ env.nap_time }}; - docker exec language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && SGX_MODE=SIM ./run_ping_on_occlum.sh" & + docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/grpc_pingpong && SGX_MODE=SIM ./run_ping_on_occlum.sh" & - name: Curl test run: | sleep ${{ env.nap_time }}; - docker exec language_support_test bash -c "curl http://127.0.0.1:8090/ping" + docker exec ${{ github.job }} bash -c "curl http://127.0.0.1:8090/ping" Java_support_test: runs-on: ubuntu-18.04 @@ -85,20 +85,20 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'java_support_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Compile Java - run: docker exec java_support_test bash -c "cd /root/occlum/demos/java && occlum-javac ./hello_world/Main.java" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/java && occlum-javac ./hello_world/Main.java" - name: Run hello world - run: docker exec java_support_test bash -c "cd /root/occlum/demos/java && SGX_MODE=SIM ./run_java_on_occlum.sh hello" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/java && SGX_MODE=SIM ./run_java_on_occlum.sh hello" - name: Compile processBuilder demo - run: docker exec java_support_test bash -c "cd /root/occlum/demos/java && occlum-javac ./processBuilder/processBuilder.java" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/java && occlum-javac ./processBuilder/processBuilder.java" - name: Run processBuilder - run: docker exec java_support_test bash -c "cd /root/occlum/demos/java && SGX_MODE=SIM ./run_java_on_occlum.sh processBuilder" + 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 @@ -109,17 +109,17 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'fish_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build Fish dependencies - run: docker exec fish_test bash -c "cd /root/occlum/demos/fish && ./download_and_build.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/fish && ./download_and_build.sh" - name: Run Fish test - run: docker exec fish_test bash -c "cd /root/occlum/demos/fish && SGX_MODE=SIM ./run_fish_test.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/fish && SGX_MODE=SIM ./run_fish_test.sh" - name: Run Fish process rlimit test - run: docker exec fish_test bash -c "cd /root/occlum/demos/fish && SGX_MODE=SIM ./run_per_process_config_test.sh" + 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 @@ -130,19 +130,19 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'hello_bazel_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Install bazel - run: docker exec hello_bazel_test bash -c "cd /root/occlum/demos/hello_bazel && wget https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-linux-x86_64.sh; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/hello_bazel && wget https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-installer-linux-x86_64.sh; chmod +x bazel-3.2.0-installer-linux-x86_64.sh; ./bazel-3.2.0-installer-linux-x86_64.sh" - name: Build bazel dependencies - run: docker exec hello_bazel_test bash -c "cd /root/occlum/demos/hello_bazel && ./build_bazel_sample.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/hello_bazel && ./build_bazel_sample.sh" - name: Test bazel - run: docker exec hello_bazel_test bash -c "cd /root/occlum/demos/hello_bazel && occlum new occlum_instance; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/hello_bazel && occlum new occlum_instance; cd occlum_instance && rm -rf image && copy_bom -f ../bazel.yaml --root image --include-dir /opt/occlum/etc/template; SGX_MODE=SIM occlum build; occlum run /bin/hello-world" @@ -157,19 +157,19 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'https_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build https server dependencies - run: docker exec https_test bash -c "cd /root/occlum/demos/https_server && ./download_and_build_mongoose.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/https_server && ./download_and_build_mongoose.sh" - name: Run https server - run: docker exec https_test bash -c "cd /root/occlum/demos/https_server && SGX_MODE=SIM ./run_https_server_in_occlum.sh" & + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/https_server && SGX_MODE=SIM ./run_https_server_in_occlum.sh" & - name: Curl test run: | sleep ${{ env.nap_time }}; - docker exec https_test bash -c "curl -k https://127.0.0.1:8443" + docker exec ${{ github.job }} bash -c "curl -k https://127.0.0.1:8443" Local_attestation_test: @@ -181,14 +181,14 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'la_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build LA dependencies - run: docker exec la_test bash -c "cd /root/occlum/demos/local_attestation && ./download_src_and_build_deps.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/local_attestation && ./download_src_and_build_deps.sh" - name: Run LA test - run: docker exec la_test bash -c "cd /root/occlum/demos/local_attestation && SGX_MODE=SIM make; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/local_attestation && SGX_MODE=SIM make; SGX_MODE=SIM make test" @@ -201,14 +201,14 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'sqlite_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build sqlite dependencies - run: docker exec sqlite_test bash -c "cd /root/occlum/demos/sqlite && ./download_and_build_sqlite.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sqlite && ./download_and_build_sqlite.sh" - name: Run sqlite test - run: docker exec sqlite_test bash -c "cd /root/occlum/demos/sqlite && SGX_MODE=SIM ./run_sqlite_on_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sqlite && SGX_MODE=SIM ./run_sqlite_on_occlum.sh" Xgboost_test: @@ -220,17 +220,17 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'xgboost_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build xgboost dependencies - run: docker exec xgboost_test bash -c "cd /root/occlum/demos/xgboost && ./download_and_build_xgboost.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/xgboost && ./download_and_build_xgboost.sh" - name: Run xgboost test - run: docker exec xgboost_test bash -c "cd /root/occlum/demos/xgboost && SGX_MODE=SIM make test" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/xgboost && SGX_MODE=SIM make test" - name: Run xgboost cluster test - run: docker exec xgboost_test bash -c "cd /root/occlum/demos/xgboost && SGX_MODE=SIM make test-local-cluster" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/xgboost && SGX_MODE=SIM make test-local-cluster" Tensorflow_lite_test: @@ -242,17 +242,17 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'tflite_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build Tensorflow-lite dependencies - run: docker exec tflite_test bash -c "cd /root/occlum/demos/tensorflow_lite && ./download_and_build_tflite.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/tensorflow_lite && ./download_and_build_tflite.sh" - name: Run Tensorflow-lite demo - run: docker exec tflite_test bash -c "cd /root/occlum/demos/tensorflow_lite && SGX_MODE=SIM ./run_tflite_in_occlum.sh demo" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/tensorflow_lite && SGX_MODE=SIM ./run_tflite_in_occlum.sh demo" - name: Run Tensorflow-lite benchmark - run: docker exec tflite_test bash -c "cd /root/occlum/demos/tensorflow_lite && SGX_MODE=SIM ./run_tflite_in_occlum.sh benchmark" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/tensorflow_lite && SGX_MODE=SIM ./run_tflite_in_occlum.sh benchmark" Pytorch_test: @@ -264,14 +264,14 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'pytorch_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build python and pytorch - run: docker exec pytorch_test bash -c "cd /root/occlum/demos/pytorch; ./install_python_with_conda.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/pytorch; ./install_python_with_conda.sh" - name: Run pytorch test - run: docker exec -d pytorch_test bash -c "cd /root/occlum/demos/pytorch; SGX_MODE=SIM ./run_pytorch_on_occlum.sh 2>&1 | tee /root/occlum/log" + run: docker exec -d ${{ github.job }} bash -c "cd /root/occlum/demos/pytorch; SGX_MODE=SIM ./run_pytorch_on_occlum.sh 2>&1 | tee /root/occlum/log" # FIXME: PyTorch can't exit normally in SIM mode - name: Kill the container @@ -279,7 +279,7 @@ jobs: sleep 360; cat "$GITHUB_WORKSPACE/log"; if grep -q Done "$GITHUB_WORKSPACE/log"; then - docker stop pytorch_test + docker stop ${{ github.job }} else exit 1 fi @@ -294,14 +294,14 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'tensorflow_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Build python and tensorflow - run: docker exec tensorflow_test bash -c "cd /root/occlum/demos/tensorflow/tensorflow_training; ./install_python_with_conda.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/tensorflow/tensorflow_training; ./install_python_with_conda.sh" - name: Run tensorflow test - run: docker exec tensorflow_test bash -c "cd /root/occlum/demos/tensorflow/tensorflow_training; SGX_MODE=SIM ./run_tensorflow_on_occlum.sh 2>&1 | tee /root/occlum/log" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/tensorflow/tensorflow_training; SGX_MODE=SIM ./run_tensorflow_on_occlum.sh 2>&1 | tee /root/occlum/log" # Below tests needs test image to run faster @@ -313,24 +313,24 @@ jobs: submodules: true - name: Create container - run: docker run -itd --name=grpc_test -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-ubuntu18.04-grpc - name: Build dependencies - run: docker exec grpc_test bash -c "cd /root/occlum; make submodule" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; make submodule" - name: Make install - run: docker exec grpc_test bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; OCCLUM_RELEASE_BUILD=y make install" + run: docker exec ${{ github.job }} bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; OCCLUM_RELEASE_BUILD=y make install" - name: Prepare grpc sample project - run: docker exec grpc_test bash -c "cd /root/demos/grpc && ./prepare_client_server.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/demos/grpc && ./prepare_client_server.sh" - name: Run grpc server - run: docker exec grpc_test bash -c "cd /root/demos/grpc && SGX_MODE=SIM ./run_server_on_occlum.sh" & + run: docker exec ${{ github.job }} bash -c "cd /root/demos/grpc && SGX_MODE=SIM ./run_server_on_occlum.sh" & - name: Run grpc client run: | sleep ${{ env.nap_time }}; - docker exec grpc_test bash -c "cd /root/demos/grpc && SGX_MODE=SIM ./run_client_on_occlum.sh" + docker exec ${{ github.job }} bash -c "cd /root/demos/grpc && SGX_MODE=SIM ./run_client_on_occlum.sh" Openvino_test: @@ -341,16 +341,16 @@ jobs: submodules: true - name: Create container - run: docker run -itd --name=openvino_test -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-ubuntu18.04-openvino - name: Build dependencies - run: docker exec openvino_test bash -c "cd /root/occlum; make submodule" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; make submodule" - name: Make install - run: docker exec openvino_test bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; OCCLUM_RELEASE_BUILD=y make install" + run: docker exec ${{ github.job }} bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; OCCLUM_RELEASE_BUILD=y make install" - name: Run openVINO benchmark - run: docker exec openvino_test bash -c "cd /root/demos/openvino && cp -rf /root/occlum/demos/openvino/* . && SGX_MODE=SIM ./run_benchmark_on_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/demos/openvino && cp -rf /root/occlum/demos/openvino/* . && SGX_MODE=SIM ./run_benchmark_on_occlum.sh" # Python test also needs its own image because in Alpine environment, modules are built locally and consumes a lot of time. @@ -361,19 +361,19 @@ jobs: with: submodules: true - name: Create container - run: docker run -itd --name=python_musl_support_test -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-ubuntu18.04-python - name: Build dependencies - run: docker exec python_musl_support_test bash -c "cd /root/occlum; make submodule" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; make submodule" - name: Make install - run: docker exec python_musl_support_test bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" + run: docker exec ${{ github.job }} bash -c "source /opt/intel/sgxsdk/environment; cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" - name: Run python support test - run: docker exec python_musl_support_test bash -c "cd /root/occlum/demos/python/python_musl; SGX_MODE=SIM ./run_python_on_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/python/python_musl; SGX_MODE=SIM ./run_python_on_occlum.sh" - name: Check result - run: docker exec python_musl_support_test bash -c "cd /root/occlum/demos/python/python_musl/occlum_instance; cat smvlight.dat" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/python/python_musl/occlum_instance; cat smvlight.dat" # Python glibc support test Python_glibc_support_test: @@ -385,17 +385,17 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'python_glibc_support_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: download conda and build python - run: docker exec python_glibc_support_test bash -c "cd /root/occlum/demos/python/python_glibc; ./install_python_with_conda.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/python/python_glibc; ./install_python_with_conda.sh" - name: Run python glibc support test - run: docker exec python_glibc_support_test bash -c "cd /root/occlum/demos/python/python_glibc; SGX_MODE=SIM ./run_python_on_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/python/python_glibc; SGX_MODE=SIM ./run_python_on_occlum.sh" - name: Check result - run: docker exec python_glibc_support_test bash -c "cd /root/occlum/demos/python/python_glibc/occlum_instance; cat smvlight.dat" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/python/python_glibc/occlum_instance; cat smvlight.dat" # Redis test Redis_support_test: @@ -407,25 +407,25 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'redis_support_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: download and build redis - run: docker exec redis_support_test bash -c "cd /root/occlum/demos/redis; ./download_and_build_redis.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/redis; ./download_and_build_redis.sh" - name: Run redis benchmark - run: docker exec redis_support_test bash -c "cd /root/occlum/demos/redis; SGX_MODE=SIM ./benchmark.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/redis; SGX_MODE=SIM ./benchmark.sh" - name: Restart the container run: | sleep ${{ env.nap_time }}; - docker restart redis_support_test + docker restart ${{ github.job }} - name: download and build redis with glibc - run: docker exec redis_support_test bash -c "cd /root/occlum/demos/redis; ./download_and_build_redis_glibc.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/redis; ./download_and_build_redis_glibc.sh" - name: Run redis benchmark - run: docker exec redis_support_test bash -c "cd /root/occlum/demos/redis; SGX_MODE=SIM ./benchmark_glibc.sh" + 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 @@ -436,22 +436,22 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'flink_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Download flink - run: docker exec flink_test bash -c "cd /root/occlum/demos/flink && ./download_flink.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/flink && ./download_flink.sh" - name: Run jobmanager on host - run: docker exec flink_test bash -c "cd /root/occlum/demos/flink && SGX_MODE=SIM ./run_flink_jobmanager_on_host.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/flink && SGX_MODE=SIM ./run_flink_jobmanager_on_host.sh" - name: Run flink taskmanager - run: docker exec flink_test bash -c "cd /root/occlum/demos/flink && SGX_MODE=SIM ./run_flink_on_occlum_glibc.sh tm" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/flink && SGX_MODE=SIM ./run_flink_on_occlum_glibc.sh tm" - name: Run flink task run: | sleep ${{ env.nap_time }}; - docker exec flink_test bash -c "cd /root/occlum/demos/flink && SGX_MODE=SIM ./run_flink_on_occlum_glibc.sh task" + docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/flink && SGX_MODE=SIM ./run_flink_on_occlum_glibc.sh task" Cluster_serving_test: runs-on: ubuntu-18.04 @@ -462,14 +462,14 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'cluster_serving_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Set up environment - run: docker exec cluster_serving_test bash -c "cd /root/occlum/demos/cluster_serving; source ./environment.sh; ./install-dependencies.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/cluster_serving; source ./environment.sh; ./install-dependencies.sh" - name: Run cluster serving test - run: docker exec cluster_serving_test bash -c "cd /root/occlum/demos/cluster_serving; source ./environment.sh; SGX_MODE=SIM ./start-all.sh; ./push-image.sh" + 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 @@ -480,20 +480,20 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'enclave_ra_tls_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Download and build Enclave TLS - run: docker exec enclave_ra_tls_test bash -c "cd /root/occlum/demos/enclave_tls && ./download_and_build_enclave_tls.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/enclave_tls && ./download_and_build_enclave_tls.sh" - name: Run the encalve tls server on Occlum - run: docker exec enclave_ra_tls_test bash -c "cd /root/occlum/demos/enclave_tls && SGX_MODE=SIM ./run_enclave_tls_server_in_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/enclave_tls && SGX_MODE=SIM ./run_enclave_tls_server_in_occlum.sh" # Ignore the result here as simulation mode doesn't have RA capabilities - name: Run the encalve tls client run: | sleep ${{ env.nap_time }}; - docker exec enclave_ra_tls_test bash -c "/usr/share/enclave-tls/samples/enclave-tls-client" || true + docker exec ${{ github.job }} bash -c "/usr/share/enclave-tls/samples/enclave-tls-client" || true vault_test: runs-on: ubuntu-18.04 @@ -504,19 +504,19 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'vault_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Download and build HashiCorp Vault - run: docker exec vault_test bash -c "cd /root/occlum/demos/golang/vault && ./prepare_vault.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/vault && ./prepare_vault.sh" - name: Run the Vault server on Occlum - run: docker exec vault_test bash -c "cd /root/occlum/demos/golang/vault && SGX_MODE=SIM ./run_occlum_vault_server.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/vault && SGX_MODE=SIM ./run_occlum_vault_server.sh" - name: Run the Vault client run: | sleep ${{ env.nap_time }}; - docker exec vault_test bash -c "cd /root/occlum/demos/golang/vault && ./run_occlum_vault_test.sh" + docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/golang/vault && ./run_occlum_vault_test.sh" sofaboot_test: runs-on: ubuntu-18.04 @@ -527,22 +527,22 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'sofaboot_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Install Maven - run: docker exec sofaboot_test bash -c "apt update && apt install -y maven" + run: docker exec ${{ github.job }} bash -c "apt update && apt install -y maven" - name: Download and compile sofaboot web demos - run: docker exec sofaboot_test bash -c "cd /root/occlum/demos/sofaboot && ./download_compile_sofaboot.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sofaboot && ./download_compile_sofaboot.sh" - name: Run SOFABoot web demo - run: docker exec sofaboot_test bash -c "cd /root/occlum/demos/sofaboot && SGX_MODE=SIM ./run_sofaboot_on_occlum.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sofaboot && SGX_MODE=SIM ./run_sofaboot_on_occlum.sh" - name: Check SOFABoot result run: | sleep ${{ env.nap_time }}; - docker exec sofaboot_test bash -c "curl -s http://localhost:8080/actuator/readiness | grep -v DOWN" + docker exec ${{ github.job }} bash -c "curl -s http://localhost:8080/actuator/readiness | grep -v DOWN" Bash_test: runs-on: ubuntu-18.04 @@ -553,14 +553,14 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'bash_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Run musl-libc Bash test - run: docker exec bash_test bash -c "cd /root/occlum/demos/bash && SGX_MODE=SIM ./run_bash_demo.sh musl" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/bash && SGX_MODE=SIM ./run_bash_demo.sh musl" - name: Run glibc Bash test - run: docker exec bash_test bash -c "cd /root/occlum/demos/bash && SGX_MODE=SIM ./run_bash_demo.sh" + 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 @@ -571,15 +571,15 @@ jobs: - uses: ./.github/workflows/composite_action with: - container-name: 'sysbench_test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Run sysbench download and build - run: docker exec sysbench_test bash -c "cd /root/occlum/demos/sysbench && SGX_MODE=SIM ./dl_and_build.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sysbench && SGX_MODE=SIM ./dl_and_build.sh" - name: Run prepare sysbench occlum instance - run: docker exec sysbench_test bash -c "cd /root/occlum/demos/sysbench && SGX_MODE=SIM ./prepare_sysbench.sh" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sysbench && SGX_MODE=SIM ./prepare_sysbench.sh" - name: Run sysbench threads benchmark - run: docker exec sysbench_test bash -c "cd /root/occlum/demos/sysbench/occlum_instance; + run: docker exec ${{ github.job }} bash -c "cd /root/occlum/demos/sysbench/occlum_instance; occlum run /bin/sysbench threads --threads=200 --thread-yields=100 --thread-locks=4 --time=30 run" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d5a9931f..6d98960b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,11 +18,11 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'ubuntu-test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' - name: Check format - run: docker exec ubuntu-test bash -c 'cd /root/occlum; info=$(make format-check); + run: docker exec ${{ github.job }} bash -c 'cd /root/occlum; info=$(make format-check); if [[ -n $info ]]; then echo "Format error detected."; echo "$info"; @@ -30,14 +30,14 @@ jobs: fi' - name: Integration test - run: docker exec ubuntu-test bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test" - name: Integration test with Glibc - run: docker exec ubuntu-test bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test-glibc" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test-glibc" - name: Show failed cases if: ${{ failure() }} - run: docker exec ubuntu-test bash -c "cat /root/occlum/build/test/.fail" + run: docker exec ${{ github.job }} bash -c "cat /root/occlum/build/test/.fail" Make_test_on_centos: runs-on: ubuntu-18.04 @@ -49,12 +49,12 @@ jobs: - uses: ./.github/workflows/composite_action/sim with: - container-name: 'centos-test' + container-name: ${{ github.job }} build-envs: 'OCCLUM_RELEASE_BUILD=1' os: 'centos8.2' - name: Check format - run: docker exec centos-test bash -c 'cd /root/occlum; info=$(make format-check); + run: docker exec ${{ github.job }} bash -c 'cd /root/occlum; info=$(make format-check); if [[ -n $info ]]; then echo "Format error detected."; echo "$info"; @@ -62,11 +62,11 @@ jobs: fi' - name: Integration test - run: docker exec centos-test bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test" - name: Integration test with Glibc - run: docker exec centos-test bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test-glibc" + run: docker exec ${{ github.job }} bash -c "cd /root/occlum; OCCLUM_LOG_LEVEL=trace SGX_MODE=SIM make test-glibc" - name: Show failed cases if: ${{ failure() }} - run: docker exec centos-test bash -c "cat /root/occlum/build/test/.fail" + run: docker exec ${{ github.job }} bash -c "cat /root/occlum/build/test/.fail"