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

docs: Add example for handling large output resutls #3276

Merged
merged 5 commits into from Jun 24, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 47 additions & 0 deletions examples/loops-big-array.yaml
@@ -0,0 +1,47 @@
# Output parameters can't be larger than 256kb. To loop over larger arrays, use an artifact.
crenshaw-dev marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: loops-sequence-
spec:
entrypoint: loops-sequence
templates:
- name: loops-sequence
steps:
- - name: get-items
template: get-items
- - name: sequence-param
template: echo
arguments:
parameters:
- name: index
value: "{{item}}"
artifacts:
- name: items
from: "{{steps.get-items.outputs.artifacts.items}}"
withSequence:
count: "{{steps.get-items.outputs.parameters.count}}"
- name: get-items
container:
image: alpine:latest
command: ["/bin/sh", "-c"]
args: ["echo '[\"a\", \"b\", \"c\"]' > /tmp/items && echo '3' > /tmp/count"]
outputs:
artifacts:
- name: items
path: /tmp/items
parameters:
- name: count
valueFrom:
path: /tmp/count
- name: echo
inputs:
parameters:
- name: index
artifacts:
- name: items
path: /tmp/items
container:
image: stedolan/jq:latest
command: [sh, -c]
args: ["cat /tmp/items | jq '.[{{inputs.parameters.index}}]'"]