Skip to content

Commit 043cb26

Browse files
committed
nits: fixes for use with tless
1 parent 8812619 commit 043cb26

File tree

7 files changed

+42
-6
lines changed

7 files changed

+42
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ running [Faasm](https://github.com/faasm/faasm) cluster.
88
To install `faasmctl` you need a working `pip` (virtual-)environment. Then:
99

1010
```bash
11-
pip install faasmctl==0.46.2
11+
pip install faasmctl==0.47.0
1212
```
1313

1414
## Usage

faasmctl/tasks/invoke.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def invoke(
2121
mpi_world_size=None,
2222
single_host=False,
2323
host_dist=None,
24+
output_format=None,
2425
):
2526
"""
2627
Invoke the execution of a user/func pair
@@ -87,6 +88,19 @@ def invoke(
8788
get_execution_time_from_message_results(result, unit="s")
8889
)
8990

91+
if output_format is not None:
92+
if output_format == "exec-time":
93+
print(exec_time[:-2])
94+
return 0
95+
96+
if output_format == "wall-time":
97+
print(wall_time[-2])
98+
return 0
99+
100+
if output_format == "start-end-ts":
101+
print(f"{start_ts},{end_ts}")
102+
return 0
103+
90104
print("======================= Faasm Execution =========================")
91105
print("Function: \t\t\t{}/{}".format(user, function))
92106
print("Return value: \t\t\t{}".format(ret_val))

faasmctl/tasks/s3.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from invoke import task
1+
from faasmctl.util.backend import COMPOSE_BACKEND, K8S_BACKEND
2+
from faasmctl.util.config import (
3+
BACKEND_INI_STRING,
4+
get_faasm_ini_file,
5+
get_faasm_ini_value,
6+
)
27
from faasmctl.util.s3 import (
38
list_buckets as do_list_buckets,
49
clear_bucket as do_clear_bucket,
@@ -7,6 +12,7 @@
712
upload_dir as do_upload_dir,
813
dump_object as do_dump_object,
914
)
15+
from invoke import task
1016

1117

1218
@task
@@ -25,6 +31,22 @@ def clear_bucket(ctx, bucket):
2531
do_clear_bucket(bucket)
2632

2733

34+
@task
35+
def get_url(ctx):
36+
"""
37+
Get the URL for the S3 server
38+
"""
39+
ini_file = get_faasm_ini_file()
40+
41+
backend = get_faasm_ini_value(ini_file, "Faasm", BACKEND_INI_STRING)
42+
if backend == COMPOSE_BACKEND:
43+
print("127.0.0.1")
44+
elif backend == K8S_BACKEND:
45+
raise RuntimeError("Unimplemented for backend: {}".format(backend))
46+
else:
47+
raise RuntimeError("Unrecognised backend: {}".format(backend))
48+
49+
2850
@task
2951
def list_objects(ctx, bucket, recursive=False):
3052
"""

faasmctl/tasks/upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def workflow(ctx, wflow, path, ini_file=None):
3434
if wasm_in_ctr:
3535
ctr_image = path[: path.rfind(":")]
3636
in_ctr_path = path[path.rfind(":") + 1 :]
37-
docker_cmd = "docker run --rm -it {} ls --format=commas {}".format(
37+
docker_cmd = "docker run --rm {} ls --format=commas {}".format(
3838
ctr_image, in_ctr_path
3939
)
4040
funcs = (

faasmctl/util/compose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from subprocess import run
1212
from time import sleep
1313

14-
DEFAULT_FAASM_CAPTURE_STDOUT = "on"
14+
DEFAULT_FAASM_CAPTURE_STDOUT = "off"
1515
DEFAULT_FAASM_OVERRIDE_CPU_COUNT = "8"
1616

1717

faasmctl/util/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FAASMCTL_VERSION = "0.46.2"
1+
FAASMCTL_VERSION = "0.47.0"
22

33

44
def get_version():

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "faasmctl"
7-
version = "0.46.2"
7+
version = "0.47.0"
88
authors = [
99
{ name="Faasm Team", email="[email protected]" },
1010
]

0 commit comments

Comments
 (0)