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

Commit

Permalink
Renaming labels to consistent format
Browse files Browse the repository at this point in the history
All labels are renamed to use hyphens instead of underscores.
  • Loading branch information
johnugeorge committed Mar 7, 2019
1 parent a936e2c commit 37c8dd3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ kubectl create -f examples/mnist/v1beta1/pytorch_job_mnist_gloo.yaml
You should now be able to see the created pods matching the specified number of replicas.

```
kubectl get pods -l pytorch_job_name=pytorch-dist-mnist
kubectl get pods -l pytorch-job-name=pytorch-dist-mnist
```
Training should run for about 10 epochs and takes 5-10 minutes on a cpu cluster. Logs can be inspected to see its training progress.

```
PODNAME=$(kubectl get pods -l pytorch_job_name=pytorch-dist-mnist,task_index=0 -o name)
PODNAME=$(kubectl get pods -l pytorch-job-name=pytorch-dist-mnist,task_index=0 -o name)
kubectl logs -f ${PODNAME}
```
## Monitoring a PyTorch Job
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/util/v1beta1/testutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
)

const (
LabelGroupName = "group_name"
LabelPyTorchJobName = "pytorch_job_name"
LabelGroupName = "group-name"
LabelPyTorchJobName = "pytorch-job-name"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/util/v1beta2/testutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
)

const (
LabelGroupName = "group_name"
LabelPyTorchJobName = "pytorch_job_name"
LabelGroupName = "group-name"
LabelPyTorchJobName = "pytorch-job-name"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller.v1beta1/pytorch/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const (
// labels for pods and servers.
replicaTypeLabel = "pytorch-replica-type"
replicaIndexLabel = "pytorch-replica-index"
labelGroupName = "group_name"
labelPyTorchJobName = "pytorch_job_name"
labelPyTorchJobRole = "pytorch_job_role"
labelGroupName = "group-name"
labelPyTorchJobName = "pytorch-job-name"
labelPyTorchJobRole = "pytorch-job-role"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v1beta1/pytorch/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func TestSyncPdb(t *testing.T) {
MinAvailable: &minAvailable,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"pytorch_job_name": "test-sync-pdb",
"pytorch-job-name": "test-sync-pdb",
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller.v1beta2/pytorch/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ const (
// labels for pods and servers.
replicaTypeLabel = "pytorch-replica-type"
replicaIndexLabel = "pytorch-replica-index"
labelGroupName = "group_name"
labelPyTorchJobName = "pytorch_job_name"
labelPyTorchJobRole = "pytorch_job_role"
labelGroupName = "group-name"
labelPyTorchJobName = "pytorch-job-name"
labelPyTorchJobRole = "pytorch-job-role"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller.v1beta2/pytorch/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func TestSyncPdb(t *testing.T) {
MinAvailable: &minAvailable,
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"pytorch_job_name": "test-sync-pdb",
"pytorch-job-name": "test-sync-pdb",
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/v1beta1/cleanpolicy_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func run() (string, error) {
}

l := map[string]string{
"group_name": v1beta1.GroupName,
"pytorch_job_name": strings.Replace(*name, "/", "-", -1),
"group-name": v1beta1.GroupName,
"pytorch-job-name": strings.Replace(*name, "/", "-", -1),
}

labels := make([]string, 0, len(l))
Expand Down

0 comments on commit 37c8dd3

Please sign in to comment.