SDK - Preserving the pipeline input information in the compiled Workflow (#1381)

* SDK - Preserving the pipeline metadata in the compiled Workflow

* Stabilizing the DSL compiler tests
This commit is contained in:
Alexey Volkov 2019-08-15 17:25:59 -07:00 committed by GitHub
parent afe8a694f6
commit d8eaeaad95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 85 additions and 0 deletions

View File

@ -655,6 +655,10 @@ class Compiler(object):
op_transformers = [add_pod_env]
op_transformers.extend(p.conf.op_transformers)
workflow = self._create_pipeline_workflow(args_list_with_defaults, p, op_transformers)
import json
workflow.setdefault('metadata', {}).setdefault('annotations', {})['pipelines.kubeflow.org/pipeline_spec'] = json.dumps(pipeline_meta.to_dict(), sort_keys=True)
return workflow
def compile(self, pipeline_func, package_path, type_check=True):

View File

@ -1,6 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "Test adding pod env",
"inputs": [], "name": "Test adding pod env"}'
generateName: test-adding-pod-env-
spec:
arguments:

View File

@ -14,6 +14,11 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "hello world", "inputs":
[{"default": null, "description": "", "name": "tag", "type": ""}, {"default":
"kubeflow", "description": "", "name": "namespace", "type": ""}, {"default":
"foobar", "description": "", "name": "bucket", "type": ""}], "name": "foo"}'
generateName: foo-
spec:
arguments:

View File

@ -14,6 +14,8 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "Get Most Frequent Word and Save to GCS", "inputs": [{"default": null, "description": "", "name": "message", "type": ""}, {"default": null, "description": "", "name": "outputpath", "type": ""}], "name": "Save Most Frequent"}'
generateName: save-most-frequent-
spec:
arguments:

View File

@ -14,6 +14,8 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "shows how to use dsl.Condition.", "inputs": [], "name": "pipeline flip coin"}'
generateName: pipeline-flip-coin-
spec:
arguments:

View File

@ -14,6 +14,8 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "Download and Get Most Frequent Word and Save to GCS", "inputs": [{"default": null, "description": "", "name": "url", "type": ""}, {"default": null, "description": "", "name": "outputpath", "type": ""}], "name": "Download and Save Most Frequent"}'
generateName: download-and-save-most-frequent-
spec:
arguments:

View File

@ -14,6 +14,8 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "A pipeline with parameter and default value.", "inputs": [{"default": "gs://ml-pipeline/shakespeare1.txt", "description": "", "name": "url", "type": ""}], "name": "Default Value"}'
generateName: default-value-
spec:
arguments:

View File

@ -1,6 +1,8 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "Get Most Frequent Word and Save to GCS", "inputs": [{"default": null, "description": "", "name": "message", "type": ""}], "name": "Save Most Frequent"}'
generateName: save-most-frequent-
spec:
arguments:

View File

@ -1,6 +1,12 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "Test that parameters used
in Op transformation functions as pod labels would be correcly identified and
set as arguments in he generated yaml", "inputs": [{"default": null, "description":
"", "name": "param", "type": ""}], "name": "Parameters in Op transformation
functions"}'
generateName: parameters-in-op-transformation-functions-
spec:
arguments:

View File

@ -1,6 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "Test the same PipelineParam
getting substituted in multiple places", "inputs": [], "name": "Param Substitutions"}'
generateName: param-substitutions-
spec:
arguments:

View File

@ -14,6 +14,11 @@
---
apiVersion: argoproj.io/v1alpha1
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "A pipeline with multiple
pipeline params.", "inputs": [{"default": "latest", "description": "", "name":
"tag", "type": ""}, {"default": 10, "description": "", "name": "sleep_ms", "type":
""}], "name": "PipelineParams"}'
generateName: pipelineparams-
spec:
entrypoint: pipelineparams

View File

@ -1,6 +1,8 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "shows how to use dsl.Condition.", "inputs": [], "name": "pipeline flip coin"}'
generateName: pipeline-flip-coin-
spec:
arguments:

View File

@ -1,6 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "shows how to use graph_component.",
"inputs": [], "name": "pipeline flip coin"}'
generateName: pipeline-flip-coin-
spec:
arguments:

View File

@ -1,6 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "shows how to use dsl.Condition.",
"inputs": [{"default": 12, "description": "", "name": "maxVal", "type": ""}],
"name": "pipeline flip coin"}'
generateName: pipeline-flip-coin-
spec:
arguments:

View File

@ -1,6 +1,11 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "A Basic Example on ResourceOp
Usage.", "inputs": [{"default": null, "description": "", "name": "username",
"type": ""}, {"default": null, "description": "", "name": "password", "type":
""}], "name": "ResourceOp Basic"}'
generateName: resourceop-basic-
spec:
arguments:

View File

@ -1,6 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "shows how to use ContainerOp
set_retry().", "inputs": [], "name": "pipeline includes two steps which fail
randomly."}'
generateName: pipeline-includes-two-steps-which-fail-randomly-
spec:
arguments:

View File

@ -13,6 +13,9 @@
# limitations under the License.
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "A pipeline with sidecars.",
"inputs": [], "name": "Sidecar"}'
generateName: sidecar-
apiVersion: argoproj.io/v1alpha1
spec:

View File

@ -1,6 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "shows how to use ContainerOp
set_retry().", "inputs": [], "name": "pipeline includes two steps which fail
randomly."}'
generateName: pipeline-includes-two-steps-which-fail-randomly-
spec:
activeDeadlineSeconds: 50

View File

@ -14,6 +14,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "A pipeline with volume.",
"inputs": [], "name": "Volume"}'
generateName: volume-
spec:
arguments:

View File

@ -1,6 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "The fifth example of the
design doc.", "inputs": [{"default": null, "description": "", "name": "rok_url",
"type": ""}], "name": "VolumeSnapshotOp RokURL"}'
generateName: volumesnapshotop-rokurl-
spec:
arguments:

View File

@ -1,6 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "The fourth example of
the design doc.", "inputs": [{"default": null, "description": "", "name": "url",
"type": ""}], "name": "VolumeSnapshotOp Sequential"}'
generateName: volumesnapshotop-sequential-
spec:
arguments:

View File

@ -1,6 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "A Basic Example on VolumeOp
Usage.", "inputs": [{"default": null, "description": "", "name": "size", "type":
""}], "name": "VolumeOp Basic"}'
generateName: volumeop-basic-
spec:
arguments:

View File

@ -1,6 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "The second example of
the design doc.", "inputs": [], "name": "Volume Op DAG"}'
generateName: volume-op-dag-
spec:
arguments:

View File

@ -1,6 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "The first example of the
design doc.", "inputs": [], "name": "VolumeOp Parallel"}'
generateName: volumeop-parallel-
spec:
arguments:

View File

@ -1,6 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
annotations:
pipelines.kubeflow.org/pipeline_spec: '{"description": "The third example of the
design doc.", "inputs": [], "name": "VolumeOp Sequential"}'
generateName: volumeop-sequential-
spec:
arguments: