Skip to content

Commit

Permalink
examples: add data files
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Oct 28, 2024
1 parent 7fe269d commit d7cfe71
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ jobs:
- name: "Print logs if wasm-upload fails"
if: failure() && (steps.wasm-upload.outcome == 'failure')
run: faasmctl logs -s upload
- name: "Upload all data files"
run: ./bin/inv_wrapper.sh data.upload
- name: "Run OpenCV check"
if: "contains(env.FAASM_WASM_VM, 'wamr')"
timeout-minutes: 2
Expand Down
17 changes: 6 additions & 11 deletions tasks/data.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
from faasmctl.util.upload import upload_file
from invoke import task
from os import makedirs
from os.path import dirname, exists
from shutil import copyfile
from tasks.env import EXAMPLES_DATA_FILES


@task(default=True)
def prepare(ctx):
def upload(ctx):
"""
Prepare data files to test WASM examples
Upload shared files needed to run WASM examples
"""
for p in EXAMPLES_DATA_FILES:
path_src = p[0]
path_dst = p[1]
host_path = p[0]
faasm_path = p[1]

if not exists(dirname(path_dst)):
makedirs(dirname(path_dst))

copyfile(path_src, path_dst)
upload_file(host_path, faasm_path)
18 changes: 9 additions & 9 deletions tasks/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,39 @@
EXAMPLES_DATA_FILES = [
[
join(EXAMPLES_DATA_HOST_DIR, "faasm_logo.png"),
join(EXAMPLES_DATA_BASE_DIR, "im", "sample_image.png"),
join("im", "sample_image.png"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "in.controller.wall"),
join(EXAMPLES_DATA_BASE_DIR, "lammps-data", "in.controller.wall"),
join("lammps-data", "in.controller.wall"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "ffmpeg_video.mp4"),
join(EXAMPLES_DATA_BASE_DIR, "ffmpeg", "sample_video.mp4"),
join("ffmpeg", "sample_video.mp4"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "sample_model.tflite"),
join(EXAMPLES_DATA_BASE_DIR, "tflite", "sample_model.tflite"),
join("tflite", "sample_model.tflite"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "grace_hopper.bmp"),
join(EXAMPLES_DATA_BASE_DIR, "tflite", "grace_hopper.bmp"),
join("tflite", "grace_hopper.bmp"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "bus_photo.bmp"),
join(EXAMPLES_DATA_BASE_DIR, "opencv", "bus_photo.bmp"),
join("opencv", "bus_photo.bmp"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "tchaikovsky.bmp"),
join(EXAMPLES_DATA_BASE_DIR, "opencv", "composers", "tchaikovsky.bmp"),
join("opencv", "composers", "tchaikovsky.bmp"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "wagner.bmp"),
join(EXAMPLES_DATA_BASE_DIR, "opencv", "composers", "wagner.bmp"),
join("opencv", "composers", "wagner.bmp"),
],
[
join(EXAMPLES_DATA_HOST_DIR, "beethoven.bmp"),
join(EXAMPLES_DATA_BASE_DIR, "opencv", "composers", "beethoven.bmp"),
join("opencv", "composers", "beethoven.bmp"),
],
]

Expand Down

0 comments on commit d7cfe71

Please sign in to comment.