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

Support the {{inputs.artifacts.<art-name>.path}} and {{outputs.artifacts.<art-name>.path}} placeholders #1257

Closed
Ark-kun opened this issue Mar 12, 2019 · 0 comments · Fixed by #1300

Comments

@Ark-kun
Copy link
Member

Ark-kun commented Mar 12, 2019

Is this a BUG REPORT or FEATURE REQUEST?:
FEATURE REQUEST

It's not a good practice to repeat any constant in several places. When there is a single source of truth, everything is consistent by design. When something is specified in multiple places, there is always a risk of things going out or sync and breaking.
Currently it's common to specify each artifact path in two places: One in the inputs.artifacts[*].path property. Another one in the command-line.

I propose adding a placeholder that allows referring to the input/output artifact path instead of copy/pasting the path. Then there's be just a single place where the path is specified. This will also allow in future to automatically generate the paths.

Example:

 - name: producer
    outputs:
      artifacts:
      - name: out-art
        path: /argo/outputs/out-art/data
    container:
      image: docker/whalesay:latest
      command: [sh, -c]

      #Current usage: Path has to be copy-pasted:
      args: ["cowsay hello world | tee /argo/outputs/out-art/data"]

      #Proposed usage: Path is referenced:
      args: ["cowsay hello world | tee {{outputs.artifacts.out-art.path}}"]
Ark-kun added a commit to Ark-kun/argo that referenced this issue Apr 2, 2019
Adds new `{{inputs.artifacts.<NAME>.path}}` and `{{outputs.artifacts.<NAME>.path}}`  placeholders.

Fixes argoproj#1257
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 a pull request may close this issue.

1 participant