Commit 6c21e3a8 authored by Seung Ho Jang's avatar Seung Ho Jang Committed by chicm-ms
Browse files

Added support for kubeflow 0.7 (#1814)

parent 7cbde508
{
"kind": "CustomResourceDefinition",
"spec": {
"scope": "Namespaced",
"version": "v1",
"group": "kubeflow.org",
"names": {
"kind": "TFJob",
"plural": "tfjobs",
"singular": "tfjob"
}
},
"apiVersion": "apiextensions.k8s.io/v1beta1",
"metadata": {
"name": "tfjobs.kubeflow.org"
}
}
...@@ -65,6 +65,25 @@ class TFOperatorClientV1Beta2 extends KubernetesCRDClient { ...@@ -65,6 +65,25 @@ class TFOperatorClientV1Beta2 extends KubernetesCRDClient {
} }
} }
class TFOperatorClientV1 extends KubernetesCRDClient {
/**
* constructor, to initialize tfjob CRD definition
*/
public constructor() {
super();
this.crdSchema = JSON.parse(fs.readFileSync('./config/kubeflow/tfjob-crd-v1.json', 'utf8'));
this.client.addCustomResourceDefinition(this.crdSchema);
}
protected get operator(): any {
return this.client.apis['kubeflow.org'].v1.namespaces('default').tfjobs;
}
public get containerName(): string {
return 'tensorflow';
}
}
class PyTorchOperatorClientV1Alpha2 extends KubernetesCRDClient { class PyTorchOperatorClientV1Alpha2 extends KubernetesCRDClient {
/** /**
* constructor, to initialize tfjob CRD definition * constructor, to initialize tfjob CRD definition
...@@ -142,6 +161,9 @@ class KubeflowOperatorClientFactory { ...@@ -142,6 +161,9 @@ class KubeflowOperatorClientFactory {
case 'v1beta2': { case 'v1beta2': {
return new TFOperatorClientV1Beta2(); return new TFOperatorClientV1Beta2();
} }
case 'v1': {
return new TFOperatorClientV1();
}
default: default:
throw new Error(`Invalid tf-operator apiVersion ${operatorApiVersion}`); throw new Error(`Invalid tf-operator apiVersion ${operatorApiVersion}`);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment