Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): add default schema_version to pipeline #6366

Merged
merged 13 commits into from
Aug 24, 2021
2,639 changes: 1,503 additions & 1,136 deletions api/v2alpha1/go/pipelinespec/pipeline_spec.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sdk/python/kfp/compiler/v2_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def update_op(op: dsl.ContainerOp,
"metadataPath": op.input_artifact_paths[artifact_name],
"schemaTitle": spec.artifact_type.schema_title,
"instanceSchema": spec.artifact_type.instance_schema,
"schemaVersion": spec.artifact_type.schema_version,
}
runtime_info["inputArtifacts"][artifact_name] = artifact_info

Expand All @@ -173,6 +174,7 @@ def update_op(op: dsl.ContainerOp,
# Type used to register output artifacts.
"schemaTitle": spec.artifact_type.schema_title,
"instanceSchema": spec.artifact_type.instance_schema,
"schemaVersion": spec.artifact_type.schema_version,
# File used to write out the registered artifact ID.
"metadataPath": op.file_outputs[artifact_name],
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/dsl/type_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_artifact_type_schema(
artifact_class = artifact_class_or_type_name

return pipeline_spec_pb2.ArtifactTypeSchema(
schema_title=artifact_class.TYPE_NAME)
schema_title=artifact_class.TYPE_NAME, schema_version="0.0.1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add VERSION field to artifacts, and let each artifact separately manage their schema versions. Then this line can be

return pipeline_spec_pb2.ArtifactTypeSchema(
      schema_title=artifact_class.TYPE_NAME, schema_version=artifact_class.VERSION)

WDYT?



def get_parameter_type(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
"artifacts": {
"output_dataset_one": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
},
"output_dataset_two": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
},
Expand All @@ -45,12 +47,14 @@
"artifacts": {
"dataset_one": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
},
"dataset_two": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
},
Expand All @@ -76,7 +80,8 @@
"artifacts": {
"model": {
"artifactType": {
"schemaTitle": "system.Model"
"schemaTitle": "system.Model",
"schemaVersion": "0.0.1"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"artifacts": {
"Output": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -69,7 +70,8 @@
"artifacts": {
"artifact": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -78,12 +80,14 @@
"artifacts": {
"metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
},
"model": {
"artifactType": {
"schemaTitle": "system.Model"
"schemaTitle": "system.Model",
"schemaVersion": "0.0.1"
}
}
},
Expand Down Expand Up @@ -316,7 +320,8 @@
"artifacts": {
"output-named-tuple-metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"artifacts": {
"artifact": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -91,7 +92,8 @@
"artifacts": {
"artifact": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -103,7 +105,8 @@
"artifacts": {
"dataset": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -112,7 +115,8 @@
"artifacts": {
"model": {
"artifactType": {
"schemaTitle": "system.Model"
"schemaTitle": "system.Model",
"schemaVersion": "0.0.1"
}
}
},
Expand All @@ -129,7 +133,8 @@
"artifacts": {
"dataset": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -138,7 +143,8 @@
"artifacts": {
"model": {
"artifactType": {
"schemaTitle": "system.Model"
"schemaTitle": "system.Model",
"schemaVersion": "0.0.1"
}
}
},
Expand All @@ -160,7 +166,8 @@
}
},
"typeSchema": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
},
Expand All @@ -170,7 +177,8 @@
"runtimeParameter": "uri"
},
"typeSchema": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"artifacts": {
"output-metrics-2-metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -52,7 +53,8 @@
"artifacts": {
"metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -64,7 +66,8 @@
"artifacts": {
"metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
}
}
Expand Down Expand Up @@ -172,12 +175,14 @@
"artifacts": {
"output-metrics-2-metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
},
"output-metrics-metrics": {
"artifactType": {
"schemaTitle": "system.Metrics"
"schemaTitle": "system.Metrics",
"schemaVersion": "0.0.1"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"artifacts": {
"examples": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
}
Expand All @@ -26,7 +27,8 @@
"artifacts": {
"examples": {
"artifactType": {
"schemaTitle": "system.Dataset"
"schemaTitle": "system.Dataset",
"schemaVersion": "0.0.1"
}
}
},
Expand All @@ -43,7 +45,8 @@
"artifacts": {
"model": {
"artifactType": {
"schemaTitle": "system.Model"
"schemaTitle": "system.Model",
"schemaVersion": "0.0.1"
}
}
}
Expand Down Expand Up @@ -153,7 +156,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
}
},
"schemaVersion": "2.0.0",
"sdkVersion": "kfp-1.6.6"
"sdkVersion": "kfp-1.7.0"
},
"runtimeConfig": {
"gcsOutputDirectory": "dummy_root",
Expand Down
Loading