Enhance SGX hardware mode CI test
1. Enable gRPC test 2. Always clean the docker 3. Support parallel jobs
This commit is contained in:
		
							parent
							
								
									34288a5e37
								
							
						
					
					
						commit
						52fcc622ea
					
				
							
								
								
									
										250
									
								
								.github/workflows/hw_mode_test.yml
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										250
									
								
								.github/workflows/hw_mode_test.yml
									
									
									
									
										vendored
									
									
								
							| @ -22,12 +22,12 @@ jobs: | |||||||
| 
 | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f occlum_test || true |         occlum_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:$OCCLUM_VERSION-ubuntu18.04) | ||||||
|         docker run --name=occlum_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:$OCCLUM_VERSION-ubuntu18.04 |         echo "occlum_test=$occlum_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Change download source of crates.io |     - name: Change download source of crates.io | ||||||
|       run: | |       run: | | ||||||
|         docker exec occlum_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $occlum_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -36,40 +36,41 @@ jobs: | |||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     - name: Build Dependencies |     - name: Build Dependencies | ||||||
|       run:  docker exec occlum_test bash -c "cd /root/occlum; make submodule" |       run: docker exec $occlum_test bash -c "cd /root/occlum; make submodule" | ||||||
| 
 | 
 | ||||||
|     - name: Build Source |     - name: Build Source | ||||||
|       run: | |       run: docker exec $occlum_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=y make install" | ||||||
|         docker exec occlum_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=y make install" |  | ||||||
| 
 | 
 | ||||||
|     - name: Integration test |     - name: Integration test | ||||||
|       run:  docker exec occlum_test bash -c "cd /root/occlum; make test" |       run:  docker exec $occlum_test bash -c "cd /root/occlum; make test" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop occlum_test |       if: ${{ always() }} | ||||||
|  |       run: docker stop $occlum_test | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   C_cpp_rust_golang_embedded_mode_support_test: |   C_cpp_rust_golang_embedded_mode_support_test: | ||||||
|     needs: make-test-on-ubuntu |  | ||||||
|     runs-on: [self-hosted, SGX1-HW] |     runs-on: [self-hosted, SGX1-HW] | ||||||
|     steps: |     steps: | ||||||
|     - name: Clean before running |     - name: Clean before running | ||||||
|       run: | |       run: | | ||||||
|         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
| 
 | 
 | ||||||
|     - name: Get occlum version |     - uses: actions/checkout@v1 | ||||||
|       run: | |       with: | ||||||
|         cd ${{ github.workspace }} |         submodules: true | ||||||
|         echo "OCCLUM_VERSION=$(grep "Version =" src/pal/include/occlum_version.h |  awk '{print $4}')" >> $GITHUB_ENV | 
 | ||||||
|  |     - name: Get Occlum version | ||||||
|  |       run: echo "OCCLUM_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; | ||||||
| 
 | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f language_support_test || true |         language_support_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:$OCCLUM_VERSION-ubuntu18.04) | ||||||
|         docker run --name=language_support_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04 |         echo "language_support_test=$language_support_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Configure dependency source |     - name: Configure dependency source | ||||||
|       run: | |       run: | | ||||||
|         docker exec language_support_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $language_support_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -77,33 +78,35 @@ jobs: | |||||||
|         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     # Just re-use the build from "make-test-on-ubuntu" job |     - name: Build Dependencies | ||||||
|  |       run: docker exec $language_support_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|     - name: Make install |     - name: Make install | ||||||
|       run: docker exec language_support_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" |       run: docker exec $language_support_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" | ||||||
| 
 | 
 | ||||||
|     - name: C test |     - name: C test | ||||||
|       run: docker exec language_support_test bash -c "cd /root/occlum/demos/hello_c && make; |       run: docker exec $language_support_test bash -c "cd /root/occlum/demos/hello_c && make; | ||||||
|             occlum new occlum_instance; |             occlum new occlum_instance; | ||||||
|             cp hello_world occlum_instance/image/bin; |             cp hello_world occlum_instance/image/bin; | ||||||
|             cd occlum_instance && occlum build; |             cd occlum_instance && occlum build; | ||||||
|             occlum run /bin/hello_world" |             occlum run /bin/hello_world" | ||||||
| 
 | 
 | ||||||
|     - name: C++ test |     - name: C++ test | ||||||
|       run: docker exec language_support_test bash -c "cd /root/occlum/demos/hello_cc && make; |       run: docker exec $language_support_test bash -c "cd /root/occlum/demos/hello_cc && make; | ||||||
|             occlum new occlum_instance; |             occlum new occlum_instance; | ||||||
|             cp hello_world occlum_instance/image/bin; |             cp hello_world occlum_instance/image/bin; | ||||||
|             cd occlum_instance && occlum build; |             cd occlum_instance && occlum build; | ||||||
|             occlum run /bin/hello_world" |             occlum run /bin/hello_world" | ||||||
| 
 | 
 | ||||||
|     - name: Rust test |     - name: Rust test | ||||||
|       run: docker exec language_support_test bash -c "cd /root/occlum/demos/rust && ./run_rust_demo_on_occlum.sh" |       run: docker exec $language_support_test bash -c "cd /root/occlum/demos/rust && ./run_rust_demo_on_occlum.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Embedded mode test |     - name: Embedded mode test | ||||||
|       run: docker exec language_support_test bash -c "cd /root/occlum/demos/embedded_mode && make; |       run: docker exec $language_support_test bash -c "cd /root/occlum/demos/embedded_mode && make; | ||||||
|             make test" |             make test" | ||||||
| 
 | 
 | ||||||
|     - name: Go Server set up and run |     - name: Go Server set up and run | ||||||
|       run: docker exec language_support_test bash -c "export GO111MODULE=on && export GOPROXY=https://goproxy.cn; |       run: docker exec $language_support_test bash -c "export GO111MODULE=on && export GOPROXY=https://goproxy.cn; | ||||||
|             cd /root/occlum/demos/golang/web_server && occlum-go get -u -v github.com/gin-gonic/gin; |             cd /root/occlum/demos/golang/web_server && occlum-go get -u -v github.com/gin-gonic/gin; | ||||||
|             occlum-go build -o web_server ./web_server.go; |             occlum-go build -o web_server ./web_server.go; | ||||||
|             ./run_golang_on_occlum.sh" & |             ./run_golang_on_occlum.sh" & | ||||||
| @ -111,49 +114,51 @@ jobs: | |||||||
|     - name: Curl test |     - name: Curl test | ||||||
|       run: | |       run: | | ||||||
|         sleep ${{ env.nap_time }}; |         sleep ${{ env.nap_time }}; | ||||||
|         docker exec language_support_test bash -c "curl http://127.0.0.1:8090/ping" |         docker exec $language_support_test bash -c "curl http://127.0.0.1:8090/ping" | ||||||
| 
 | 
 | ||||||
|     - name: Set up Golang grpc pingpong test |     - name: Set up Golang grpc pingpong test | ||||||
|       run: docker exec language_support_test bash -c "export GO111MODULE=on && export GOPROXY=https://goproxy.cn; |       run: docker exec $language_support_test bash -c "export GO111MODULE=on && export GOPROXY=https://goproxy.cn; | ||||||
|             cd /root/occlum/demos/golang/grpc_pingpong && ./prepare_ping_pong.sh" |             cd /root/occlum/demos/golang/grpc_pingpong && ./prepare_ping_pong.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Start Golang grpc pingpong server |     - name: Start Golang grpc pingpong server | ||||||
|       run: docker exec language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && ./run_pong_on_occlum.sh" & |       run: docker exec $language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && ./run_pong_on_occlum.sh" & | ||||||
| 
 | 
 | ||||||
|     - name: Run Golang grpc ping test |     - name: Run Golang grpc ping test | ||||||
|       run: | |       run: | | ||||||
|         sleep ${{ env.nap_time }}; |         sleep ${{ env.nap_time }}; | ||||||
|         docker exec language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && ./run_ping_on_occlum.sh" |         docker exec $language_support_test bash -c "cd /root/occlum/demos/golang/grpc_pingpong && ./run_ping_on_occlum.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Run Golang sqlite test |     - name: Run Golang sqlite test | ||||||
|       run: docker exec language_support_test bash -c "export GO111MODULE=on && export GOPROXY=https://goproxy.cn; |       run: docker exec $language_support_test bash -c "export GO111MODULE=on && export GOPROXY=https://goproxy.cn; | ||||||
|             cd /root/occlum/demos/golang/go_sqlite/ && ./run_go_sqlite_demo.sh" |             cd /root/occlum/demos/golang/go_sqlite/ && ./run_go_sqlite_demo.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop language_support_test |       if: ${{ always() }} | ||||||
|  |       run: docker stop $language_support_test | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   Java_support_test: |   Java_support_test: | ||||||
|     needs: make-test-on-ubuntu |  | ||||||
|     runs-on: [self-hosted, SGX1-HW] |     runs-on: [self-hosted, SGX1-HW] | ||||||
|     steps: |     steps: | ||||||
|     - name: Clean before running |     - name: Clean before running | ||||||
|       run: | |       run: | | ||||||
|         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
| 
 | 
 | ||||||
|     - name: Get occlum version |     - uses: actions/checkout@v1 | ||||||
|       run: | |       with: | ||||||
|         cd ${{ github.workspace }} |         submodules: true | ||||||
|         echo "OCCLUM_VERSION=$(grep "Version =" src/pal/include/occlum_version.h |  awk '{print $4}')" >> $GITHUB_ENV | 
 | ||||||
|  |     - name: Get Occlum version | ||||||
|  |       run: echo "OCCLUM_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; | ||||||
| 
 | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f java_support_test || true |         java_support_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:$OCCLUM_VERSION-ubuntu18.04) | ||||||
|         docker run --name=java_support_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04 |         echo "java_support_test=$java_support_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Configure dependency source |     - name: Configure dependency source | ||||||
|       run: | |       run: | | ||||||
|         docker exec java_support_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $java_support_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -161,41 +166,45 @@ jobs: | |||||||
|         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     # Just re-use the build from "make-test-on-ubuntu" job |     - name: Build Dependencies | ||||||
|  |       run: docker exec $java_support_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|     - name: Make install |     - name: Make install | ||||||
|       run: docker exec java_support_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" |       run: docker exec $java_support_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" | ||||||
| 
 | 
 | ||||||
|     - name: Compile Java |     - 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 $java_support_test bash -c "cd /root/occlum/demos/java && occlum-javac ./hello_world/Main.java" | ||||||
| 
 | 
 | ||||||
|     - name: Run hello world |     - name: Run hello world | ||||||
|       run: docker exec java_support_test bash -c "cd /root/occlum/demos/java && ./run_java_on_occlum.sh hello" |       run: docker exec $java_support_test bash -c "cd /root/occlum/demos/java && ./run_java_on_occlum.sh hello" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop java_support_test |       if: ${{ always() }} | ||||||
|  |       run: docker stop $java_support_test | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   Bazel_test: |   Bazel_test: | ||||||
|     needs: make-test-on-ubuntu |  | ||||||
|     runs-on: [self-hosted, SGX1-HW] |     runs-on: [self-hosted, SGX1-HW] | ||||||
|     steps: |     steps: | ||||||
|     - name: Clean before running |     - name: Clean before running | ||||||
|       run: | |       run: | | ||||||
|         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
| 
 | 
 | ||||||
|     - name: Get occlum version |     - uses: actions/checkout@v1 | ||||||
|       run: | |       with: | ||||||
|         cd ${{ github.workspace }} |         submodules: true | ||||||
|         echo "OCCLUM_VERSION=$(grep "Version =" src/pal/include/occlum_version.h |  awk '{print $4}')" >> $GITHUB_ENV | 
 | ||||||
|  |     - name: Get Occlum version | ||||||
|  |       run: echo "OCCLUM_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; | ||||||
| 
 | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f hello_bazel_test || true |         hello_bazel_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:$OCCLUM_VERSION-ubuntu18.04) | ||||||
|         docker run --name=hello_bazel_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04 |         echo "hello_bazel_test=$hello_bazel_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Configure dependency source |     - name: Configure dependency source | ||||||
|       run: | |       run: | | ||||||
|         docker exec hello_bazel_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $hello_bazel_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -203,49 +212,52 @@ jobs: | |||||||
|         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     # Just re-use the build from "make-test-on-ubuntu" job |     - name: Build Dependencies | ||||||
|  |       run: docker exec $hello_bazel_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|     - name: Make install |     - name: Make install | ||||||
|       run: docker exec hello_bazel_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" |       run: docker exec $hello_bazel_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" | ||||||
| 
 | 
 | ||||||
|     - name: Install bazel |     - 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 $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; | ||||||
|               chmod +x 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" |               ./bazel-3.2.0-installer-linux-x86_64.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Build bazel dependencies |     - 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 $hello_bazel_test bash -c "cd /root/occlum/demos/hello_bazel && ./build_bazel_sample.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Test bazel |     - name: Test bazel | ||||||
|       run: docker exec hello_bazel_test bash -c "cd /root/occlum/demos/hello_bazel && occlum new occlum_instance; |       run: docker exec $hello_bazel_test bash -c "cd /root/occlum/demos/hello_bazel && occlum new occlum_instance; | ||||||
|             cp examples/cpp-tutorial/stage3/bazel-bin/main/hello-world occlum_instance/image/bin; |             cp examples/cpp-tutorial/stage3/bazel-bin/main/hello-world occlum_instance/image/bin; | ||||||
|             cd occlum_instance && occlum build; |             cd occlum_instance && occlum build; | ||||||
|             occlum run /bin/hello-world" |             occlum run /bin/hello-world" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop hello_bazel_test |       run: docker stop $hello_bazel_test | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   Sqlite_test: |   Sqlite_test: | ||||||
|     needs: make-test-on-ubuntu |  | ||||||
|     runs-on: [self-hosted, SGX1-HW] |     runs-on: [self-hosted, SGX1-HW] | ||||||
|     steps: |     steps: | ||||||
|     - name: Clean before running |     - name: Clean before running | ||||||
|       run: | |       run: | | ||||||
|         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
| 
 | 
 | ||||||
|     - name: Get occlum version |     - uses: actions/checkout@v1 | ||||||
|       run: | |       with: | ||||||
|         cd ${{ github.workspace }} |         submodules: true | ||||||
|         echo "OCCLUM_VERSION=$(grep "Version =" src/pal/include/occlum_version.h |  awk '{print $4}')" >> $GITHUB_ENV | 
 | ||||||
|  |     - name: Get Occlum version | ||||||
|  |       run: echo "OCCLUM_VERSION=$(grep 'Version =' src/pal/include/occlum_version.h | awk '{print $4}')" >> $GITHUB_ENV; | ||||||
| 
 | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f sqlite_test || true |         sqlite_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:$OCCLUM_VERSION-ubuntu18.04) | ||||||
|         docker run --name=sqlite_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlum/occlum:${{ env.OCCLUM_VERSION }}-ubuntu18.04 |         echo "sqlite_test=$sqlite_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Configure dependency source |     - name: Configure dependency source | ||||||
|       run: | |       run: | | ||||||
|         docker exec sqlite_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $sqlite_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -253,36 +265,43 @@ jobs: | |||||||
|         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     # Just re-use the build from "make-test-on-ubuntu" job |     - name: Build Dependencies | ||||||
|  |       run: docker exec $sqlite_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|     - name: Make install |     - name: Make install | ||||||
|       run: docker exec sqlite_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" |       run: docker exec $sqlite_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" | ||||||
| 
 | 
 | ||||||
|     - name: Build sqlite dependencies |     - name: Build sqlite dependencies | ||||||
|       run: docker exec sqlite_test bash -c "cd /root/occlum/demos/sqlite && ./download_and_build_sqlite.sh" |       run: docker exec $sqlite_test bash -c "cd /root/occlum/demos/sqlite && ./download_and_build_sqlite.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Run sqlite test |     - name: Run sqlite test | ||||||
|       run: docker exec sqlite_test bash -c "cd /root/occlum/demos/sqlite && ./run_sqlite_on_occlum.sh" |       run: docker exec $sqlite_test bash -c "cd /root/occlum/demos/sqlite && ./run_sqlite_on_occlum.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop sqlite_test |       if: ${{ always() }} | ||||||
|  |       run: docker stop $sqlite_test | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   Python_support_test: |   Python_support_test: | ||||||
|     needs: make-test-on-ubuntu |  | ||||||
|     runs-on: [self-hosted, SGX1-HW] |     runs-on: [self-hosted, SGX1-HW] | ||||||
|     steps: |     steps: | ||||||
|     - name: Clean before running |     - name: Clean before running | ||||||
|       run: | |       run: | | ||||||
|         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
| 
 | 
 | ||||||
|  |     - uses: actions/checkout@v1 | ||||||
|  |       with: | ||||||
|  |         submodules: true | ||||||
|  | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f python_support_test || true |         docker pull occlumbackup/occlum:latest-ubuntu18.04-python | ||||||
|         docker run --name=python_support_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-python |         python_support_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-python) | ||||||
|  |         echo "python_support_test=$python_support_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Configure dependency source |     - name: Configure dependency source | ||||||
|       run: | |       run: | | ||||||
|         docker exec python_support_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $python_support_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -290,36 +309,43 @@ jobs: | |||||||
|         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     # Just re-use the build from "make-test-on-ubuntu" job |     - name: Build Dependencies | ||||||
|  |       run: docker exec $python_support_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|     - name: Make install |     - name: Make install | ||||||
|       run: docker exec python_support_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" |       run: docker exec $python_support_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" | ||||||
| 
 | 
 | ||||||
|     - name: Run python support test |     - name: Run python support test | ||||||
|       run: docker exec python_support_test bash -c "cd /root/occlum/demos/python; ./run_python_on_occlum.sh" |       run: docker exec $python_support_test bash -c "cd /root/occlum/demos/python; ./run_python_on_occlum.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Check result |     - name: Check result | ||||||
|       run: docker exec python_support_test bash -c "cd /root/occlum/demos/python/occlum_instance; cat smvlight.dat" |       run: docker exec $python_support_test bash -c "cd /root/occlum/demos/python/occlum_instance; cat smvlight.dat" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop python_support_test |       if: ${{ always() }} | ||||||
|  |       run: docker stop $python_support_test | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   Openvino_test: |   Openvino_test: | ||||||
|     needs: make-test-on-ubuntu |  | ||||||
|     runs-on: [self-hosted, SGX1-HW] |     runs-on: [self-hosted, SGX1-HW] | ||||||
|     steps: |     steps: | ||||||
|     - name: Clean before running |     - name: Clean before running | ||||||
|       run: | |       run: | | ||||||
|         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
| 
 | 
 | ||||||
|  |     - uses: actions/checkout@v1 | ||||||
|  |       with: | ||||||
|  |         submodules: true | ||||||
|  | 
 | ||||||
|     - name: Create container |     - name: Create container | ||||||
|       run: | |       run: | | ||||||
|         docker rm -f openvino_test || true |         docker pull occlumbackup/occlum:latest-ubuntu18.04-openvino | ||||||
|         docker run --name=openvino_test -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-openvino |         openvino_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-openvino) | ||||||
|  |         echo "openvino_test=$openvino_test" >> $GITHUB_ENV | ||||||
| 
 | 
 | ||||||
|     - name: Configure dependency source |     - name: Configure dependency source | ||||||
|       run: | |       run: | | ||||||
|         docker exec openvino_test bash -c "cat <<- EOF >/root/.cargo/config |         docker exec $openvino_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|         [source.crates-io] |         [source.crates-io] | ||||||
|         registry = \"https://github.com/rust-lang/crates.io-index\" |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|         replace-with = 'ustc' |         replace-with = 'ustc' | ||||||
| @ -327,12 +353,64 @@ jobs: | |||||||
|         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|         EOF" |         EOF" | ||||||
| 
 | 
 | ||||||
|     # Just re-use the build from "make-test-on-ubuntu" job |     - name: Build Dependencies | ||||||
|  |       run: docker exec $openvino_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|     - name: Make install |     - name: Make install | ||||||
|       run: docker exec openvino_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" |       run: docker exec $openvino_test bash -c "cd /root/occlum; OCCLUM_RELEASE_BUILD=1 make install" | ||||||
| 
 | 
 | ||||||
|     - name: Run openVINO benchmark |     - name: Run openVINO benchmark | ||||||
|       run: docker exec openvino_test bash -c "cd /root/demos/openvino && ./run_benchmark_on_occlum.sh" |       run: docker exec $openvino_test bash -c "cd /root/demos/openvino && ./run_benchmark_on_occlum.sh" | ||||||
| 
 | 
 | ||||||
|     - name: Clean the environment |     - name: Clean the environment | ||||||
|       run: docker stop openvino_test |       if: ${{ always() }} | ||||||
|  |       run: docker stop $openvino_test | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |   Grpc_test: | ||||||
|  |     runs-on: [self-hosted, SGX1-HW] | ||||||
|  |     steps: | ||||||
|  |     - name: Clean before running | ||||||
|  |       run: | | ||||||
|  |         sudo chown -R ${{ secrets.CI_ADMIN }} "${{ github.workspace }}" | ||||||
|  | 
 | ||||||
|  |     - uses: actions/checkout@v1 | ||||||
|  |       with: | ||||||
|  |         submodules: true | ||||||
|  | 
 | ||||||
|  |     - name: Create container | ||||||
|  |       run: | | ||||||
|  |         docker pull occlumbackup/occlum:latest-ubuntu18.04-grpc | ||||||
|  |         grpc_test=$(docker run -itd --privileged --rm --net host --device /dev/isgx -v $GITHUB_WORKSPACE:/root/occlum occlumbackup/occlum:latest-ubuntu18.04-grpc) | ||||||
|  |         echo "grpc_test=$grpc_test" >> $GITHUB_ENV | ||||||
|  | 
 | ||||||
|  |     - name: Change download source of crates.io | ||||||
|  |       run: | | ||||||
|  |         docker exec $grpc_test bash -c "cat <<- EOF >/root/.cargo/config | ||||||
|  |         [source.crates-io] | ||||||
|  |         registry = \"https://github.com/rust-lang/crates.io-index\" | ||||||
|  |         replace-with = 'ustc' | ||||||
|  |         [source.ustc] | ||||||
|  |         registry = \"git://mirrors.ustc.edu.cn/crates.io-index\" | ||||||
|  |         EOF" | ||||||
|  | 
 | ||||||
|  |     - name: Build dependencies | ||||||
|  |       run: docker exec $grpc_test bash -c "cd /root/occlum; make submodule" | ||||||
|  | 
 | ||||||
|  |     - name: Make install | ||||||
|  |       run: docker exec $grpc_test bash -c "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" | ||||||
|  | 
 | ||||||
|  |     - name: Run grpc server | ||||||
|  |       run: docker exec $grpc_test bash -c "cd /root/demos/grpc && ./run_server_on_occlum.sh" & | ||||||
|  | 
 | ||||||
|  |     - name: Run grpc client | ||||||
|  |       run: | | ||||||
|  |         sleep ${{ env.nap_time }}; | ||||||
|  |         docker exec $grpc_test bash -c "cd /root/demos/grpc && ./run_client_on_occlum.sh" | ||||||
|  | 
 | ||||||
|  |     - name: Clean the environment | ||||||
|  |       if: ${{ always() }} | ||||||
|  |       run: docker stop $grpc_test | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user