From 6165987c0ba1898917cd5b25930f0df8eb2af7a9 Mon Sep 17 00:00:00 2001 From: rohanrebello <1291433+rohanrebello@users.noreply.github.com> Date: Fri, 17 Nov 2023 01:18:54 -0800 Subject: [PATCH] Add deployed-at timestamp in annotations for argo-workflows (#1633) * Add deployed-at timestamp in annotations for argo-workflows * Use ISO8601 timestamp * Use better annotation name * Rename annotation * Formatting --- metaflow/plugins/argo/argo_workflows.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metaflow/plugins/argo/argo_workflows.py b/metaflow/plugins/argo/argo_workflows.py index 4b64af36cc9..1f1da1b6d09 100644 --- a/metaflow/plugins/argo/argo_workflows.py +++ b/metaflow/plugins/argo/argo_workflows.py @@ -615,11 +615,16 @@ def _compile_workflow_template(self): # generate container templates at the top level (in WorkflowSpec) and maintain # references to them within the DAGTask. + from datetime import datetime, timezone + annotations = { "metaflow/production_token": self.production_token, "metaflow/owner": self.username, "metaflow/user": "argo-workflows", "metaflow/flow_name": self.flow.name, + "metaflow/deployment_timestamp": str( + datetime.now(timezone.utc).isoformat() + ), } if self.parameters: