-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathfreworkflow.py
More file actions
41 lines (38 loc) · 1.5 KB
/
freworkflow.py
File metadata and controls
41 lines (38 loc) · 1.5 KB
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
40
41
''' fre workflow click interface for fre workflow subcommands'''
import os
import click
import logging
fre_logger = logging.getLogger(__name__)
#fre tools
from . import checkout_script
#from . import install_script
#from . import run_script
@click.group(help=click.style(" - workflow subcommands", fg=(57,139,210)))
def workflow_cli():
''' entry point to fre workflow click commands '''
@workflow_cli.command()
@click.option("-y", "--yamlfile", type=str,
help="Model yaml file",
required=True)
@click.option("-e", "--experiment", type=str,
help="Experiment name",
required=True)
@click.option("-a", "--application",
type=click.Choice(['run', 'pp']),
help="Type of workflow to check out/clone",
required=True)
@click.option("--target-dir",
type=str,
default=os.path.expanduser("~/.fre-workflows"),
help=f"""Target directory for the workflow to be cloned into.
If not defined, a default location of ~/.fre-workflows
will be used""")
@click.option("--force-checkout",
is_flag=True,
default=False,
help="If the checkout already, exists, remove and clone the desired repo again.")
def checkout(target_dir, yamlfile, experiment, application, force_checkout):
"""
Checkout/extract fre workflow
"""
checkout_script.workflow_checkout(target_dir, yamlfile, experiment, application, force_checkout)