def _build_workflow(self): """Create the scaffolding for the Argo workflow""" workflow = { "apiVersion": "argoproj.io/v1alpha1", "kind": "Workflow", "metadata": { "name": self.name, "namespace": self.namespace, "labels": argo_build_util.add_dicts([{ "workflow": self.name, "workflow_template": TEMPLATE_LABEL, }, argo_build_util.get_prow_labels()]), }, "spec": { "entrypoint": E2E_DAG_NAME, # Have argo garbage collect old workflows otherwise we overload the API # server. "ttlSecondsAfterFinished": 7 * 24 * 60 * 60, "volumes": [ { "name": "gcp-credentials", "secret": { "secretName": "kubeflow-testing-credentials", }, }, { "name": DATA_VOLUME, "persistentVolumeClaim": { "claimName": NFS_VOLUME_CLAIM, }, }, ], "onExit": EXIT_DAG_NAME, "templates": [{ "dag": { "tasks": [], }, "name": E2E_DAG_NAME, }, { "dag": { "tasks": [], }, "name": TESTS_DAG_NAME, }, { "dag": { "tasks": [], }, "name": EXIT_DAG_NAME, }], }, # spec } # workflow return workflow
def _build_workflow(self): """Create a scaffolding CR for the Argo workflow""" volumes = [{ "name": DATA_VOLUME, "persistentVolumeClaim": { "claimName": NFS_VOLUME_CLAIM }, }] if LOCAL_TESTING == "False": volumes.append(CREDENTIALS_VOLUME) workflow = { "apiVersion": "argoproj.io/v1alpha1", "kind": "Workflow", "metadata": { "name": self.name, "namespace": self.namespace, "labels": argo_build_util.add_dicts([{ "workflow": self.name, "workflow_template": self.template_label, }, argo_build_util.get_prow_labels()]), }, "spec": { "entrypoint": E2E_DAG_NAME, # Have argo garbage collect old workflows otherwise we overload # the API server. "volumes": volumes, "onExit": EXIT_DAG_NAME, "templates": [ { "dag": { "tasks": [] }, "name": E2E_DAG_NAME }, { "dag": { "tasks": [] }, "name": EXIT_DAG_NAME }, ], }, # spec } # workflow return workflow