diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fdbf7f8..5999803 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -80,12 +80,12 @@ jobs: REDIS_QUEUE_HOST: redis REDIS_STATE_HOST: redis container: - image: faasm/examples-run:0.9.2 + image: faasm/examples-run:0.9.4 services: redis: - image: faasm/redis:0.9.2 + image: faasm/redis:0.9.4 minio: - image: faasm/minio:0.9.2 + image: faasm/minio:0.9.4 env: MINIO_ROOT_USER: minio MINIO_ROOT_PASSWORD: minio123 @@ -151,3 +151,43 @@ jobs: run: ./bin/inv_wrapper.sh run tf check - name: "Run FFmpeg check" run: ./bin/inv_wrapper.sh run ffmpeg check + + run-sgx-examples: + if: github.event.pull_request.draft == false + needs: [build-examples] + runs-on: ubuntu-latest + env: + WASM_VM: sgx + container: + image: faasm/examples-run-sgx-sim:0.9.4 + services: + redis: + image: faasm/redis:0.9.4 + minio: + image: faasm/minio:0.9.4 + env: + MINIO_ROOT_USER: minio + MINIO_ROOT_PASSWORD: minio123 + steps: + - name: "Download examples wasm" + uses: actions/download-artifact@v3.0.1 + with: + name: examples-wasm + path: /usr/local/faasm/wasm + - name: "Checkout latest Faasm code" + uses: actions/checkout@v3 + with: + repository: faasm/faasm + # TODO: remove after merge + ref: wamr-fs + submodules: true + - name: "Re-build targets" + run: ./bin/inv_wrapper.sh dev.tools --sgx Simulation + - name: "Run codegen" + run: | + ./bin/inv_wrapper.sh codegen imagemagick main + ./bin/inv_wrapper.sh codegen tf check + - name: "Run ImageMagick" + run: ./bin/inv_wrapper.sh run imagemagick main --cmdline 'faasm://im/sample_image.png -flip faasm://im/image_out.png' + - name: "Run TFlite check" + run: ./bin/inv_wrapper.sh run tf check diff --git a/FAASM_VERSION b/FAASM_VERSION index 2003b63..a602fc9 100644 --- a/FAASM_VERSION +++ b/FAASM_VERSION @@ -1 +1 @@ -0.9.2 +0.9.4 diff --git a/cpp b/cpp index 90cf7f6..12b6487 160000 --- a/cpp +++ b/cpp @@ -1 +1 @@ -Subproject commit 90cf7f6feeed3657494b2ad6627701f2254d05e6 +Subproject commit 12b64878397ae63c677668b22218d9a4eb0e56ee diff --git a/docker-compose.yml b/docker-compose.yml index 1e19725..fd5acf9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ services: depends_on: - redis - minio - image: faasm/examples-run:${EXAMPLES_RUN_VERSION} + image: faasm/examples-run${SGX_CLI_SUFFIX}:${EXAMPLES_RUN_VERSION} working_dir: /usr/local/code/faasm stdin_open: true tty: true diff --git a/docker/run.dockerfile b/docker/run.dockerfile index 5b3378c..02002a4 100644 --- a/docker/run.dockerfile +++ b/docker/run.dockerfile @@ -1,5 +1,6 @@ ARG EXAMPLES_VERSION ARG FAASM_VERSION +ARG SGX_IMAGE_SUFFIX FROM faasm/examples-build:${EXAMPLES_VERSION} as build # Prepare shared data for the tests @@ -7,7 +8,7 @@ RUN cd /code/examples \ && source venv/bin/activate \ && inv data -FROM faasm/cli:${FAASM_VERSION} +FROM faasm/cli${SGX_IMAGE_SUFFIX}:${FAASM_VERSION} COPY --from=build /code/examples /code/examples COPY --from=build /usr/local/faasm/wasm /usr/local/faasm/wasm diff --git a/python b/python index 08eeb04..28f4e35 160000 --- a/python +++ b/python @@ -1 +1 @@ -Subproject commit 08eeb04cfcaf5887c06661a1c6493e64768a32e1 +Subproject commit 28f4e352d25c7b7744df2b084786f3855e8d9078 diff --git a/tasks/cli.py b/tasks/cli.py index e3359bc..933c0b3 100644 --- a/tasks/cli.py +++ b/tasks/cli.py @@ -14,7 +14,7 @@ @task(default=True) -def cli(ctx, service, clean=False): +def cli(ctx, service, clean=False, sgx=False): """ Get a shell into one of the containers: `build` or `run` """ @@ -44,6 +44,7 @@ def cli(ctx, service, clean=False): { "EXAMPLES_RUN_VERSION": get_faasm_version(), "EXAMPLES_BUILD_VERSION": get_version(), + "SGX_CLI_SUFFIX": "-sgx-sim" if sgx else "", } ) docker_cmd = "docker compose up -d --no-recreate" diff --git a/tasks/docker.py b/tasks/docker.py index 8b2f9be..e3d4ab1 100644 --- a/tasks/docker.py +++ b/tasks/docker.py @@ -22,13 +22,16 @@ def get_tag(name): image_name = EXAMPLES_BUILD_IMAGE_NAME elif name == "run": image_name = EXAMPLES_RUN_IMAGE_NAME + elif name == "run-sgx-sim": + image_name = EXAMPLES_RUN_IMAGE_NAME + "-sgx-sim" return "{}:{}".format(image_name, version) @task(iterable=["c"]) def build(ctx, c, nocache=False, push=False): """ - Build container image, possible containers are `build` and `run` + Build container image, possible containers are `build`, `run`, + `run-sgx-sim`, and `run-sgx`. """ build_args = {} for ctr in c: @@ -45,6 +48,13 @@ def build(ctx, c, nocache=False, push=False): "FAASM_VERSION": get_faasm_version(), } dockerfile = EXAMPLES_RUN_DOCKERFILE + elif ctr == "run-sgx-sim": + build_args = { + "EXAMPLES_VERSION": get_version(), + "FAASM_VERSION": get_faasm_version(), + "SGX_IMAGE_SUFFIX": "-sgx-sim", + } + dockerfile = EXAMPLES_RUN_DOCKERFILE else: raise RuntimeError("Unrecognised container name: {}".format(ctr)) diff --git a/tasks/env.py b/tasks/env.py index 7131057..4827b4f 100644 --- a/tasks/env.py +++ b/tasks/env.py @@ -56,5 +56,5 @@ def get_version(name="build"): """ if name == "build": return "{}_{}".format(get_cpp_version(), get_python_version()) - if name == "run": + if name == "run" or name == "run-sgx-sim": return "{}".format(get_faasm_version()) diff --git a/tasks/func.py b/tasks/func.py index e4cf1f9..f880a9a 100644 --- a/tasks/func.py +++ b/tasks/func.py @@ -25,3 +25,15 @@ def compile(ctx, user, func, clean=False, debug=False): # Copy into place _copy_built_function(user, func) + + +@task +def tests(ctx, clean=False): + """ + Build the functions used in the tests + """ + funcs = [ + ["ffmpeg", "check"], + # What about LAMMPS + ["tf", "check"], + ]