-
I have a step (gsutil rsync) which sometimes hangs forever. I know the amount of files to be synced before, so I'd like to set up a timeout for rsync step based on it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Templating isn't done via Jinja and doesn't follow the syntax you used here. Please see the "Expression" docs. I'm not sure if |
Beta Was this translation helpful? Give feedback.
-
I found the solution via metadata:
name: test-deadline
namespace: argo-events
labels:
example: 'true'
spec:
entrypoint: example
templates:
- name: example
dag:
tasks:
- name: generate-value
template: generate-value
- name: obtain
template: obtain
arguments:
parameters:
- name: timeout
value: "{{tasks.generate-value.outputs.parameters.value}}"
- name: generate-value
script:
image: alpine:3.7
command: [sh]
source: |
echo 10 > /tmp/output.txt
outputs:
parameters:
- name: value
valueFrom:
path: /tmp/output.txt
- name: obtain
inputs:
parameters:
- name: timeout
podSpecPatch: '{"activeDeadlineSeconds":{{inputs.parameters.timeout}}}'
script:
image: alpine:3.7
command: [sh]
source: |
echo "Simulating task for {{inputs.parameters.timeout}} seconds."
sleep 20 |
Beta Was this translation helpful? Give feedback.
I found the solution via
podSpecPatch
. It's the only optionactiveDeadlineSeconds
can get the dynamic value.the full example is here: