Skip to content

Commit

Permalink
Fix run CLI (#507)
Browse files Browse the repository at this point in the history
The `run` command was broken in #488. This fixes it by adding the `ref`
argument to the subparsers separately.
  • Loading branch information
RobbeSneyders authored Oct 10, 2023
1 parent 4691718 commit 8faccb4
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions src/fondant/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,20 @@ def register_compile(parent_parser):

compiler_subparser = parser.add_subparsers()

parser.add_argument(
"ref",
help="""Reference to the pipeline to run, can be a path to a spec file or
a module containing the pipeline instance that will be compiled first (e.g. pipeline.py)
""",
action="store",
)

local_parser = compiler_subparser.add_parser(name="local", help="Local compiler")
kubeflow_parser = compiler_subparser.add_parser(
name="kubeflow",
help="Kubeflow compiler",
)

# Local runner parser
local_parser.add_argument(
"ref",
help="""Reference to the pipeline to run, can be a path to a spec file or
a module containing the pipeline instance that will be compiled first (e.g. pipeline.py)
""",
action="store",
)
local_parser.add_argument(
"--output-path",
"-o",
Expand All @@ -223,6 +222,13 @@ def register_compile(parent_parser):
)

# Kubeflow parser
kubeflow_parser.add_argument(
"ref",
help="""Reference to the pipeline to run, can be a path to a spec file or
a module containing the pipeline instance that will be compiled first (e.g. pipeline.py)
""",
action="store",
)
kubeflow_parser.add_argument(
"--output-path",
"-o",
Expand Down Expand Up @@ -272,14 +278,6 @@ def register_run(parent_parser):
)

runner_subparser = parser.add_subparsers()
# Define the "ref" argument once
parser.add_argument(
"ref",
help="""Reference to the pipeline to run, can be a path to a spec file or
a module containing the pipeline instance that will be compiled first (e.g. pipeline.py)
""",
action="store",
)

local_parser = runner_subparser.add_parser(name="local", help="Local runner")
kubeflow_parser = runner_subparser.add_parser(
Expand All @@ -288,6 +286,13 @@ def register_run(parent_parser):
)

# Local runner parser
local_parser.add_argument(
"ref",
help="""Reference to the pipeline to run, can be a path to a spec file or
a module containing the pipeline instance that will be compiled first (e.g. pipeline.py)
""",
action="store",
)
local_parser.add_argument(
"--output-path",
"-o",
Expand All @@ -309,6 +314,13 @@ def register_run(parent_parser):
local_parser.set_defaults(func=run_local)

# kubeflow runner parser
kubeflow_parser.add_argument(
"ref",
help="""Reference to the pipeline to run, can be a path to a spec file or
a module containing the pipeline instance that will be compiled first (e.g. pipeline.py)
""",
action="store",
)
kubeflow_parser.add_argument(
"--output-path",
"-o",
Expand Down

0 comments on commit 8faccb4

Please sign in to comment.