hera icon indicating copy to clipboard operation
hera copied to clipboard

Hera CLI design

Open elliotgunton opened this issue 2 years ago • 0 comments

Following a catchup with @flaviuvadan and @samj1912, this issue is to expand/formalise the idea of a Hera CLI, features it should support and a small roadmap/priority list for the CLI.

Feature (priority order) Depends on Impact T shirt size Proof of concept / PR / links
CLI framework - Required to enable features S  
WT stub gen CLI Medium/high - would make TemplateRef usage much better, key part of WorkflowTemplate use/distribution M  
Detect Workflows / WorkflowTemplates To be part of CLI but can figure out functionality in parallel Low/Medium (might be required to enable features. Ease of use feature) S/M  
Submit from WT CLI, Detect Workflows / WorkflowTemplates Medium - would improve dev ex a lot S As a function on WorkflowTemplates, issue/suggestion here https://github.com/argoproj-labs/hera/issues/521 -> Done in - https://github.com/argoproj-labs/hera/pull/669
Python to YAML converter CLI Low/Medium - to_yaml() already exists on Workflows, this puts convenience in the CLI. Could be used to generate many at once. Useful for CI/CD and DevOps use cases S  
YAML to Python converter CLI Medium - existing users of Argo can instantly convert to using Hera, opens the door for better integrations M https://github.com/argoproj-labs/hera/issues/609 and https://github.com/argoproj-labs/hera/pull/673
User Workflow automatic documentation generator CLI Medium - we love docs! S  

Example CLI Usage

WorkflowTemplate Stub gen

hera generate stubs <template-name> [--namespace <namespace>] [--cluster-template]

Comments:

  • Stubs wouldn’t be useful for Workflows, so just WTs and CWTs are accepted

Submit from WorkflowTemplate

hera submit --from <python-file-with-def>/<template-name> --e <entrypoint> --namespace <namespace>

Comments:

  • Unsure of the --from syntax - pass a file + template name? Separate args for each?

Python to YAML converter

hera generate yaml --from <python-file-with-def>[/<template-name>] [--to <filepath>]

Comments:

  • Allows you to generate from many WTs from one file, optional /template-name

YAML to Python converter

hera generate python --from <yaml-file> [--to <filepath>]

Comments:

  • Implicitly allows you to generate whatever’s in the yaml file (i.e. one or many of Workflows, WTs, CWTs etc)

Doc Gen

hera generate docs --from <python-file-with-def> [--to <filepath>]

Comments:

  • Should the output be basic? JSON instead of to file? Should we assume anything?

elliotgunton avatar Jun 05 '23 16:06 elliotgunton