Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
6c21e3a8
Commit
6c21e3a8
authored
Dec 20, 2019
by
Seung Ho Jang
Committed by
chicm-ms
Dec 20, 2019
Browse files
Added support for kubeflow 0.7 (#1814)
parent
7cbde508
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
src/nni_manager/config/kubeflow/tfjob-crd-v1.json
src/nni_manager/config/kubeflow/tfjob-crd-v1.json
+17
-0
src/nni_manager/training_service/kubernetes/kubeflow/kubeflowApiClient.ts
...training_service/kubernetes/kubeflow/kubeflowApiClient.ts
+22
-0
No files found.
src/nni_manager/config/kubeflow/tfjob-crd-v1.json
0 → 100644
View file @
6c21e3a8
{
"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"
}
}
src/nni_manager/training_service/kubernetes/kubeflow/kubeflowApiClient.ts
View file @
6c21e3a8
...
...
@@ -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
...
...
@@ -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
}
`
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment