docsy(v2): CLI parameter customization example#1206
Open
ppiegaze wants to merge 1 commit into
Open
Conversation
New page user-guide/task-deployment/custom-cli.md showing how to wrap a Flyte task in your own CLI (tyro/argparse/click/hydra) via flyte.init_from_config() + flyte.run(). Grounded in flyte-sdk PR #175 (examples/customize/custom_cli.py). Distinct from the built-in flyte run CLI covered by #1180. DOC-1066 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com>
GHA build & deploy previewBuilt by
Updated automatically on every push. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new task-deployment how-to page documenting how to build a bespoke command-line interface (CLI) around flyte.run() using common Python argument-parsing libraries, complementing the existing docs for the built-in flyte run CLI.
Changes:
- Introduces a new “Build a custom CLI” page that explains the general wrapper pattern (parse args →
flyte.init_from_config()→flyte.run()). - Provides a concrete typed example using
tyroplus a parallelargparseexample, and links to related run docs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+86
to
+88
| input. The `config` object is passed **positionally** to `main`, mapping to its | ||
| `config` parameter — the same positional form documented in | ||
| [Run command options](./run-command-options). |
Comment on lines
+71
to
+73
| flyte.init_from_config() | ||
| r = flyte.run(main, config) | ||
| print(r.url) |
Comment on lines
+114
to
+116
| flyte.init_from_config() | ||
| r = flyte.run(main, foo=args.foo, bar=args.bar) | ||
| print(r.url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new how-to page
user-guide/task-deployment/custom-cli.md("Build a custom CLI") showing how to wrap a Flyte 2.0.x task in your own command-line interface — parse args withtyro/argparse/click/hydra, thenflyte.init_from_config()+flyte.run().Resolves DOC-1066 — "Example for customizing CLI with different parameters" (Ketan's ask to show how you can customize the CLI for different parameters using click/argparse/tyro/hydra).
Grounding (verify-live)
examples/customize/custom_cli.py(tyro →flyte.init_from_config()→flyte.run(main, config)). The tyro example is reproduced verbatim from that file.flyte.init_from_config()signature and the positionalflyte.run(main, config)form against the live flyte-sdkmain(src/flyte/_initialize.py).Relationship to #1180 (coordinated, not overlapping)
PR #1180 (DOC-436/663,
docsy/v2-cli-input-passing) documents the built-inflyte runCLI — typed input passing via--<input_name>, positional args, per-type syntax — by editingrun-command-options.mdand_index.md.This PR is the distinct topic the DOC-1066 triage flagged: building your own CLI wrapper around
flyte.run(). To avoid colliding with #1180's heavy edits, this PR:weight);run-command-options(the built-in CLI) andrun-context, using page-level links (no dependency on anchors docsy(v2): document passing typed and positional inputs via the CLI #1180 introduces), so it merges cleanly in either order.Status
Held draft — DOC-1066's feature (flyte-sdk #175) has already shipped, so this is publish-ready on review; kept draft pending human disposition per docsy posture.
Linear: DOC-1066