Skip to content

Commit fbee402

Browse files
committedJun 29, 2020
cli: parametrisable run-example command
Allows to run any example in the `run-example` command. Moves prefetching and loading of example environment images from the cluster creation step to later stages. Allows to speed up local testing using (i) one small fast REANA example in the CI cycle vs (ii) using all examples for a full-scale CI testing. Signed-off-by: Tibor Šimko <tibor.simko@cern.ch>
1 parent ca3da24 commit fbee402

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
 

‎reana/cli.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1879,8 +1879,8 @@ def client_setup_environment(server_hostname, insecure_url): # noqa: D301
18791879
"--component",
18801880
"-c",
18811881
multiple=True,
1882-
default=["reana-demo-root6-roofit"],
1883-
help="Which examples to run? [reana-demo-root6-roofit]",
1882+
default=["DEMO"],
1883+
help="Which examples to run? [default=DEMO]",
18841884
)
18851885
@click.option(
18861886
"--workflow_engine",
@@ -1922,6 +1922,10 @@ def run_example(
19221922
): # noqa: D301
19231923
"""Run given REANA example with given workflow engine.
19241924
1925+
\b
1926+
Example:
1927+
$ reana-dev run-example -c r-d-r-roofit
1928+
19251929
\b
19261930
:param component: The option ``component`` can be repeated. The value is
19271931
the repository name of the example. The special value `DEMO`
@@ -2033,7 +2037,7 @@ def run_example(
20332037
default=False,
20342038
help="Should we mount the REANA source code for live code updates?",
20352039
)
2036-
@click.option("--worker-nodes", default=0, help="How many worker nodes? default 0")
2040+
@click.option("--worker-nodes", default=0, help="How many worker nodes? [default=0]")
20372041
@cli.command(name="cluster-create")
20382042
def cluster_create(mounts, debug, worker_nodes):
20392043
"""Create cluster."""
@@ -2088,8 +2092,8 @@ def add_volume_mounts(node):
20882092
cluster_create = cluster_create.format(cluster_config=yaml.dump(cluster_config))
20892093
for cmd in [
20902094
cluster_create,
2091-
"reana-dev docker-pull -c reana -c DEMO",
2092-
"reana-dev kind-load-docker-image -c reana -c DEMO",
2095+
"reana-dev docker-pull -c reana",
2096+
"reana-dev kind-load-docker-image -c reana",
20932097
]:
20942098
run_command(cmd, "reana")
20952099

0 commit comments

Comments
 (0)