-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunc.py
39 lines (31 loc) · 973 Bytes
/
func.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from faasmtools.compile_util import wasm_cmake, wasm_copy_upload
from invoke import task
from os.path import join
from tasks.env import PROJ_ROOT
FUNC_DIR = join(PROJ_ROOT, "func")
FUNC_BUILD_DIR = join(PROJ_ROOT, "build", "func")
def _copy_built_function(user, func):
exe_name = "{}_{}.{}".format(user, func, "wasm")
src_file = join(FUNC_BUILD_DIR, user, exe_name)
wasm_copy_upload(user, func, src_file)
@task(default=True)
def compile(ctx, user, func, clean=False, debug=False):
"""
Compile a function to test a sample library
"""
# Build the function (gets written to the build dir)
wasm_cmake(
FUNC_DIR, FUNC_BUILD_DIR, "{}_{}".format(user, func), clean, debug
)
# 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"],
]