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

Local CLI templating for faster dev/test iteration cycles #10017

Open
agilgur5 opened this issue Nov 11, 2022 · 4 comments
Open

Local CLI templating for faster dev/test iteration cycles #10017

agilgur5 opened this issue Nov 11, 2022 · 4 comments
Labels
area/cli The `argo` CLI area/templating Templating with `{{...}}` type/feature Feature request

Comments

@agilgur5
Copy link
Member

agilgur5 commented Nov 11, 2022

Summary

Allow for local templating similar to helm template, so that users can iterate on a Workflow or WorkflowTemplate definition locally and with a faster iteration than having to submit to an Argo Server.

Such a feature would definitely help me and my teams iterate and test faster. I'd be willing to contribute this as well!

Use Cases

For quickly testing and debugging Workflow definitions locally and in CI, e.g.:

  1. If I have a bug or typo in my Workflow parameters, currently I won't know until I submit it to a server
    1. For example, when dealing with expressions, particularly more complicated ones (or chained ones), it's relatively easy for the output to be different from expected. As a really quick example, I tried using sprig.toYaml (which doesn't exist?), but wasn't able to tell I couldn't use that or that it didn't format my parameter properly until I submit to a server. This makes for a slow feedback loop, on top of requiring a server and making it harder to test locally or in CI.
    2. If I had a typo, for instance input instead of inputs or parameter instead of parameters or a parameter that I forgot to define and so it doesn't exist, etc. Those are all actual mistakes I've made. This feature would make it easier to detect such a simple mistake
    3. Other kinds of templating issues that can commonly occur when working with multiple different templating systems, both internal to Argo Workflows, as well as external (e.g. users more familiar with Helm/Go templates may not be as familiar with all the nuances of Argo's templating systems)
  2. argo lint does not (and likely cannot) catch all types of issues, particularly not the formatting of a string manifest, for instance, but if I saw some wonky formatting in output similar to helm template, I could quickly figure out the issue.
  3. Snapshot testing of templates with --parameter-file, for instance
    • helm template <template> --values values-test.yml --> ex. argo submit --template <workflow> --parameter-file parameters-test.yml
  4. Quicker way for users to understand the limitations of Argo's templating
  5. Possibility of a simple online, fully client-side (no server needed) test playground for the templating

Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

@agilgur5 agilgur5 added the type/feature Feature request label Nov 11, 2022
@gitsan13
Copy link

Hi
Are you accepting a PR request for this?
I would very much like to work on this enhancement:)

@agilgur5
Copy link
Member Author

Jotting another note here: I did try argo submit's --dry-run flag, but that doesn't template out the parameters, it just outputs the Workflow that will be passed to the Argo Server.
Adding --parameter-file just inserts top-level defaults to the template, but doesn't fully template it out.

@agilgur5 agilgur5 added the area/cli The `argo` CLI label Aug 8, 2023
@agilgur5 agilgur5 added the area/templating Templating with `{{...}}` label Aug 18, 2023
@caelan-io
Copy link
Member

Discussed yesterday with @agilgur5 - I think this feature makes a lot of sense and is gaining a lot of support just in the last 6 months.

@agilgur5 - would you be open to adapting this issue into a short enhancement proposal PR? We can then ensure other maintainers give feedback on this.

@agilgur5
Copy link
Member Author

agilgur5 commented Sep 12, 2023

@agilgur5 - would you be open to adapting this issue into a short enhancement proposal PR? We can then ensure other maintainers give feedback on this.

I think you meant a more formal, in-repo documented proposal like #10191? Those haven't seem to have gotten a lot of attention unfortunately 😕 (as you likely know well too)
EDIT: It looks like there was an attempt to make a Proposal Template in #9857, but ironically that itself got closed as stale 😕

I was planning to just go straight to PR if I can find an optimal solution that does not really have any trade-offs. i.e. no real decision to be made, just an approval. Haven't had time to dive into this yet though (so haven't assigned myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI area/templating Templating with `{{...}}` type/feature Feature request
Projects
None yet
Development

No branches or pull requests

3 participants