Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure-cli #488

Merged
merged 5 commits into from
Oct 6, 2023
Merged

Restructure-cli #488

merged 5 commits into from
Oct 6, 2023

Conversation

PhilippeMoussalli
Copy link
Contributor

With the introduction of a new compiler and runner for vertex, I feel the need to restructure the CLI a bit. This is a draft PR (docs and tests still need to be updated).

Running

  • Before
fondant run pipeline.py --local
  • After

Mode is not longer a positional argument, Pipeline/reference is moved to the end (similar to docker).

 fondant run local pipeline.py 

Help

  • Before

Arguments are not isolated per mode which makes it which argument belongs to which mode (e.g. extra volumes not needed for KFP)

❯ fondant run -h                 
usage: fondant run [-h] (--local | --kubeflow) [--output-path OUTPUT_PATH] [--extra-volumes EXTRA_VOLUMES [EXTRA_VOLUMES ...]] [--build-arg BUILD_ARG] [--host HOST] ref

positional arguments:
  ref                   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)

options:
  -h, --help            show this help message and exit
  --local
  --kubeflow
  --output-path OUTPUT_PATH, -o OUTPUT_PATH
                        Output directory
  --extra-volumes EXTRA_VOLUMES [EXTRA_VOLUMES ...]
                        Extra volumes to mount in containers
  --build-arg BUILD_ARG
                        Build arguments to pass to `docker build`. Format {key}={value}.
  --host HOST           KubeFlow pipeline host url
  • After
❯fondant run -h  

positional arguments:
  {local,kubeflow}
    local           Local runner
    kubeflow        Kubeflow runner
  ref               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)

options:
  -h, --help        show this help message and exit

To further deep dive

❯ fondant run local -h                  
usage: fondant run local [-h] [--output-path OUTPUT_PATH] [--extra-volumes EXTRA_VOLUMES [EXTRA_VOLUMES ...]] [--build-arg BUILD_ARG]

options:
  -h, --help            show this help message and exit
  --output-path OUTPUT_PATH, -o OUTPUT_PATH
                        Output path of compiled pipeline
  --extra-volumes EXTRA_VOLUMES [EXTRA_VOLUMES ...]
                        Extra volumes to mount in containers
  --build-arg BUILD_ARG
                        Build arguments for `docker build`

@PhilippeMoussalli PhilippeMoussalli marked this pull request as draft October 5, 2023 07:28
@RobbeSneyders
Copy link
Member

Ok, this looks good to me @PhilippeMoussalli.

@PhilippeMoussalli PhilippeMoussalli marked this pull request as ready for review October 5, 2023 14:36
Copy link
Contributor

@mrchtr mrchtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, just have one smaller suggestion.

help="Output directory",
default=None,
help="Output path of compiled pipeline",
default="docker_compose.yml",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for going away from the default docker-compose naming?

Suggested change
default="docker_compose.yml",
default="docker-compose.yml",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, forgot that it was referenced like this

help="Output directory",
default=None,
help="Output path of compiled pipeline",
default="docker_compose.yml",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above.

Suggested change
default="docker_compose.yml",
default="docker-compose.yml",

@RobbeSneyders RobbeSneyders merged commit 47dcda8 into main Oct 6, 2023
5 checks passed
@RobbeSneyders RobbeSneyders deleted the restructure-cli branch October 6, 2023 19:30
@RobbeSneyders RobbeSneyders mentioned this pull request Oct 10, 2023
RobbeSneyders added a commit that referenced this pull request Oct 10, 2023
The `run` command was broken in #488. This fixes it by adding the `ref`
argument to the subparsers separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants