Revision 24f5148a7ae3e175a873f0210e56e2b70861a155 authored by dependabot[bot] on 23 March 2020, 16:12:45 UTC, committed by GitHub on 23 March 2020, 16:12:45 UTC
Bumps [tensorflow](https://github.com/tensorflow/tensorflow) from 1.15.0 to 1.15.2. - [Release notes](https://github.com/tensorflow/tensorflow/releases) - [Changelog](https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md) - [Commits](https://github.com/tensorflow/tensorflow/compare/v1.15.0...v1.15.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 932648f
new-trial-kind.md
# Document about how to support a new Kubernetes resource in Katib trial
## Update the supported list
First, `GetSupportedJobList` in [common.go](../pkg/common/v1alpha3/common.go) needs to be updated.
```go
func GetSupportedJobList() []schema.GroupVersionKind {
supportedJobList := []schema.GroupVersionKind{
{
Group: "batch",
Version: "v1",
Kind: "Job",
},
{
Group: "kubeflow.org",
Version: "v1",
Kind: "TFJob",
},
{
Group: "kubeflow.org",
Version: "v1",
Kind: "PyTorchJob",
},
}
return supportedJobList
}
```
In this function, we define the Kubernetes `GroupVersionKind` that are supported in Katib. If you want to add a new kind, please append the `supportedJobList`.
## Update logic about status update
`GetDeployedJobStatus` in [trial_controller_util.go](../pkg/controller.v1alpha3/trial/trial_controller_util.go) needs to be updated.
It is used to determine if the trial is completed (Succeeded or Failed).
## Update logic about pod injection webhook
### Add logic to support mutating container
`isWorkerContainer` in [inject_webhook.go](../pkg/webhook/v1alpha3/pod/inject_webhook.go) needs to be updated.
```go
func isWorkerContainer(jobKind string, index int, c v1.Container) bool {
switch jobKind {
case BatchJob:
if index == 0 {
// for Job worker, the first container will be taken as worker container,
// katib document should note it
return true
}
case TFJob:
if c.Name == TFJobWorkerContainerName {
return true
}
case PyTorchJob:
if c.Name == PyTorchJobWorkerContainerName {
return true
}
default:
log.Info("Invalid Katib worker kind", "JobKind", jobKind)
return false
}
return false
}
```
The function is used to determine which container in the job is the actual main container.
### Add logic about how to determine the master pod
In Katib, we only inject metrics collector sidecar into the master pod (See [metrics-collector.md](./proposals/metrics-collector.md) for more details). Thus we need to update the `JobRoleMap` in [const.go](../pkg/webhook/v1alpha3/pod/const.go).
```go
var JobRoleMap = map[string][]string{
"TFJob": {JobRoleLabel, TFJobRoleLabel},
"PyTorchJob": {JobRoleLabel, PyTorchJobRoleLabel},
"Job": {},
}
```
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...