Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Added support for kubeflow 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
장승호(Seung Ho Jang) committed Dec 19, 2019
1 parent 7953911 commit b946888
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/nni_manager/config/kubeflow/tfjob-crd-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
* constructor, to initialize tfjob CRD definition
Expand Down Expand Up @@ -142,6 +161,9 @@ class KubeflowOperatorClientFactory {
case 'v1beta2': {
return new TFOperatorClientV1Beta2();
}
case 'v1': {
return new TFOperatorClientV1();
}
default:
throw new Error(`Invalid tf-operator apiVersion ${operatorApiVersion}`);
}
Expand Down

0 comments on commit b946888

Please sign in to comment.