Skip to content

Commit

Permalink
SDK - Components - Temporary removed Kubernetes options from Componen…
Browse files Browse the repository at this point in the history
…tSpec (#4230)

* SDK - Components - Replaced Kubernetes options with generic launcher options

This reduces the schema size and makes the task launcher options more flexible.

* Removed the launcherOptions for now
  • Loading branch information
Ark-kun committed Jul 17, 2020
1 parent 98e828b commit 39975e3
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 547 deletions.
18 changes: 0 additions & 18 deletions sdk/python/kfp/components/_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@

from .modelbase import ModelBase

from .structures.kubernetes import v1


PrimitiveTypes = Union[str, int, float, bool]
PrimitiveTypesIncludingNone = Optional[PrimitiveTypes]
Expand Down Expand Up @@ -548,31 +546,15 @@ def __init__(self,
super().__init__(locals())


class KubernetesExecutionOptionsSpec(ModelBase):
_serialized_names = {
'main_container': 'mainContainer',
'pod_spec': 'podSpec',
}

def __init__(self,
metadata: Optional[v1.ObjectMetaArgoSubset] = None,
main_container: Optional[v1.Container] = None,
pod_spec: Optional[v1.PodSpecArgoSubset] = None,
):
super().__init__(locals())


class ExecutionOptionsSpec(ModelBase):
_serialized_names = {
'retry_strategy': 'retryStrategy',
'caching_strategy': 'cachingStrategy',
'kubernetes_options': 'kubernetesOptions',
}

def __init__(self,
retry_strategy: Optional[RetryStrategySpec] = None,
caching_strategy: Optional[CachingStrategySpec] = None,
kubernetes_options: Optional[KubernetesExecutionOptionsSpec] = None,
):
super().__init__(locals())

Expand Down
14 changes: 1 addition & 13 deletions sdk/python/kfp/components/structures/components.json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,12 @@
"additionalProperties": false
},

"KubernetesExecutionOptionsSpec": {
"description": "When running on Kubernetes, KubernetesExecutionOptionsSpec describes changes to the configuration of a Kubernetes Pod that will execute the task.",
"type": "object",
"properties": {
"metadata": {"$ref": "https://kubernetesjsonschema.dev/v1.14.0/_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},
"mainContainer": {"$ref": "https://kubernetesjsonschema.dev/v1.14.0/_definitions.json#/definitions/io.k8s.api.core.v1.Container"},
"podSpec": {"$ref": "https://kubernetesjsonschema.dev/v1.14.0/_definitions.json#/definitions/io.k8s.api.core.v1.PodSpec"}
},
"additionalProperties": false
},

"ExecutionOptionsSpec": {
"description": "Optional configuration that specifies how the task should be executed. Can be used to set some platform-specific options.",
"type": "object",
"properties": {
"retryStrategy": {"$ref": "#/definitions/RetryStrategySpec"},
"cachingStrategy": {"$ref": "#/definitions/CachingStrategySpec"},
"kubernetesOptions": {"$ref": "#/definitions/KubernetesExecutionOptionsSpec"}
"cachingStrategy": {"$ref": "#/definitions/CachingStrategySpec"}
},
"additionalProperties": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,3 @@
maxRetries: integer
cachingStrategy: #CachingStrategySpec
maxCacheStaleness: string
kubernetesOptions: #KubernetesExecutionOptionsSpec
metadata: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
mainContainer: io.k8s.api.core.v1.Container
podSpec: io.k8s.api.core.v1.PodSpec
12 changes: 1 addition & 11 deletions sdk/python/kfp/components/structures/components.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";

package org.kubeflow.pipelines.components.v1alpha1;
import "google/protobuf/struct.proto";

// Describes the component input specification
message InputSpec {
Expand Down Expand Up @@ -209,18 +210,7 @@ message RetryStrategySpec {
int32 maxRetries = 1;
}

import "k8s.io/api/core/v1/generated.proto"; // https://github.com/kubernetes/api/blob/master/core/v1/generated.proto
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";

// When running on Kubernetes, KubernetesExecutionOptionsSpec describes changes to the configuration of a Kubernetes Pod that will execute the task.
message KubernetesExecutionOptionsSpec {
k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
k8s.io.api.core.v1.Container mainContainer = 2;
k8s.io.api.core.v1.PodSpec podSpec = 3;
}

// Optional configuration that specifies how the task should be executed. Can be used to set some platform-specific options.
message ExecutionOptionsSpec {
RetryStrategySpec retryStrategy = 1;
KubernetesExecutionOptionsSpec kubernetesOptions = 2;
}
Empty file.
Loading

0 comments on commit 39975e3

Please sign in to comment.