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
89de4061
Unverified
Commit
89de4061
authored
Feb 21, 2020
by
leo
Committed by
GitHub
Feb 21, 2020
Browse files
add support for pytorchjob crd version 'v1' (#2061)
parent
24fa4619
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
src/nni_manager/config/kubeflow/pytorchjob-crd-v1.json
src/nni_manager/config/kubeflow/pytorchjob-crd-v1.json
+17
-0
src/nni_manager/training_service/kubernetes/kubeflow/kubeflowApiClient.ts
...training_service/kubernetes/kubeflow/kubeflowApiClient.ts
+20
-0
src/nni_manager/training_service/kubernetes/kubeflow/kubeflowConfig.ts
...er/training_service/kubernetes/kubeflow/kubeflowConfig.ts
+1
-1
No files found.
src/nni_manager/config/kubeflow/pytorchjob-crd-v1.json
0 → 100644
View file @
89de4061
{
"kind"
:
"CustomResourceDefinition"
,
"spec"
:
{
"scope"
:
"Namespaced"
,
"version"
:
"v1"
,
"group"
:
"kubeflow.org"
,
"names"
:
{
"kind"
:
"PyTorchJob"
,
"plural"
:
"pytorchjobs"
,
"singular"
:
"pytorchjob"
}
},
"apiVersion"
:
"kubeflow.org/v1"
,
"metadata"
:
{
"name"
:
"pytorchjobs.kubeflow.org"
}
}
\ No newline at end of file
src/nni_manager/training_service/kubernetes/kubeflow/kubeflowApiClient.ts
View file @
89de4061
...
...
@@ -83,7 +83,24 @@ class TFOperatorClientV1 extends KubernetesCRDClient {
return
'
tensorflow
'
;
}
}
class
PyTorchOperatorClientV1
extends
KubernetesCRDClient
{
/**
* constructor, to initialize tfjob CRD definition
*/
public
constructor
()
{
super
();
this
.
crdSchema
=
JSON
.
parse
(
fs
.
readFileSync
(
'
./config/kubeflow/pytorchjob-crd-v1.json
'
,
'
utf8
'
));
this
.
client
.
addCustomResourceDefinition
(
this
.
crdSchema
);
}
protected
get
operator
():
any
{
return
this
.
client
.
apis
[
'
kubeflow.org
'
].
v1
.
namespaces
(
'
default
'
).
pytorchjobs
;
}
public
get
containerName
():
string
{
return
'
pytorch
'
;
}
}
class
PyTorchOperatorClientV1Alpha2
extends
KubernetesCRDClient
{
/**
* constructor, to initialize tfjob CRD definition
...
...
@@ -179,6 +196,9 @@ class KubeflowOperatorClientFactory {
case
'
v1beta2
'
:
{
return
new
PyTorchOperatorClientV1Beta2
();
}
case
'
v1
'
:
{
return
new
PyTorchOperatorClientV1
();
}
default
:
throw
new
Error
(
`Invalid pytorch-operator apiVersion
${
operatorApiVersion
}
`
);
}
...
...
src/nni_manager/training_service/kubernetes/kubeflow/kubeflowConfig.ts
View file @
89de4061
...
...
@@ -13,7 +13,7 @@ import { AzureStorage, KeyVaultConfig, KubernetesClusterConfig, KubernetesCluste
export
type
KubeflowOperator
=
'
tf-operator
'
|
'
pytorch-operator
'
;
export
type
DistTrainRole
=
'
worker
'
|
'
ps
'
|
'
master
'
;
export
type
KubeflowJobStatus
=
'
Created
'
|
'
Running
'
|
'
Failed
'
|
'
Succeeded
'
;
export
type
OperatorApiVersion
=
'
v1alpha2
'
|
'
v1beta1
'
|
'
v1beta2
'
;
export
type
OperatorApiVersion
=
'
v1alpha2
'
|
'
v1beta1
'
|
'
v1beta2
'
|
'
v1
'
;
/**
* Kubeflow Cluster Configuration
...
...
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