Is there a way to get tasks(steps) start_timestamp and end_timestamp in lifecycle hook ? #14573
Unanswered
sonamdolphin9192
asked this question in
Q&A
Replies: 1 comment
-
As far as I know, workflow level exit handler can only access Global and Exit-Handler variables. You can try to set apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: lifecycle-hook-workflow-level-
spec:
entrypoint: main
hooks:
exit:
template: hello
templates:
- name: main
steps:
- - name: step
template: echo
- name: echo
container:
image: alpine
command: [sh, -c]
args: ["date +\"%Y-%m-%d %H:%M:%S\" > /tmp/startedAt.txt"]
outputs:
parameters:
- name: startedAt
valueFrom:
path: "/tmp/startedAt.txt"
globalName: stepStartedAt
- name: hello
container:
image: alpine
command: [ sh, -c ]
args: [ "echo {{workflow.outputs.parameters.stepStartedAt}}" ] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
/Hi,
I want get task(step) start_timestamp and end_timestamp in lifecycle hook in argo workflow.
Here we indicate hook as exit handler-
apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: generateName: exit-handler-with-param- labels: workflows.argoproj.io/test: "true" annotations: workflows.argoproj.io/description: | onExitTemplate enables workflow to pass the arguments (parameters/Artifacts) to exit handler template. workflows.argoproj.io/version: ">= 3.1.0" spec: entrypoint: main onExit: workflow-level-exit-hanlder templates: - name: main dag: tasks: - name: task-1 template: output hooks: exit: template: exit arguments: parameters: - name: message value: "{{tasks.task-1.message}}"
How can i get task-1 start_timestamp and end_timestamp in exit handler
Please help.
Beta Was this translation helpful? Give feedback.
All reactions