-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Make aggregated output parameters available by name #2393
Comments
It seems like this is already supported? From Argo Variables:
An example: https://github.com/argoproj/argo/blob/master/examples/nested-workflow.yaml Am I missing something here? |
That's true for retrieving output parameters for steps without parallelism. For a looped step, it seems like Example from the StackOverflow post: apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: loops-param-result-
spec:
entrypoint: loop-param-result-example
templates:
- name: loop-param-result-example
steps:
- - name: generate
template: gen-number-list
- - name: write
template: output-number
arguments:
parameters:
- name: number
value: "{{item}}"
withParam: "{{steps.generate.outputs.result}}"
- - name: fan-in
template: fan-in
arguments:
parameters:
- name: numbers
value: "{{steps.write.outputs.parameters.number}}"
- name: gen-number-list
script:
image: python:alpine3.6
command: [python]
source: |
import json
import sys
json.dump([i for i in range(20, 31)], sys.stdout)
- name: output-number
inputs:
parameters:
- name: number
container:
image: alpine:latest
command: [sh, -c]
args: ["echo {{inputs.parameters.number}} > /tmp/number.txt"]
outputs:
parameters:
- name: number
valueFrom:
path: /tmp/number.txt
- name: fan-in
inputs:
parameters:
- name: numbers
container:
image: alpine:latest
command: [sh, -c]
args: ["echo received {{inputs.parameters.numbers}}"] |
Hmm... that seems like a bug then. Will investigate later today |
So in this example, your desired output for |
Yep, I think that would do nicely! As long as you can't think of a reason this would be misleading or otherwise problematic for users. |
It is a slight deviation from typical JSON referencing, but hopefully the user will understand they're not working directly with a JSON object here. |
This is my main concern. I think the syntax |
(chatted a bit offline) JavaScript: Or maybe invent some function like Simon plans to bring it up with Jesse. |
My feelings about this are:
|
Sounds like a major refactor to use expr. Maybe the solution is to throw a lint error if someone tries to directly access a param for a parallelized step? |
This would be helpful as well - I am having to sprinkle in jq wish Bash to be a workaround, which isn't ideal. |
What do you think about something like |
Would JSONPath-like |
I would like to point out that the syntax should work for a task/step with or without loop: |
Summary
I'd like to be able to access aggregated output parameters filtered by name. Right now you can get all the output parameters as JSON using
{{steps.STEP-NAME.outputs.parameters}}
. I'd like to add.PARAM-NAME
to get JSON for just output params by that name.Motivation
Someone asked on StackOverflow how to access aggregated output parameters. They were attempting to access by name like
{{steps.STEP-NAME.outputs.parameters.PARAM-NAME}}
.That seems intuitive/nice. It would be easy enough to filter using
jq
, but getting the results straight from Argo would be a better UX.Message from the maintainers:
If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.
The text was updated successfully, but these errors were encountered: