-
Notifications
You must be signed in to change notification settings - Fork 73
Add skeleton code for reconcile service #25
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
I signed it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
job_controller/job_controller.go
Outdated
@@ -87,7 +87,10 @@ type ControllerInterface interface { | |||
// DeletePod deletes the pod | |||
DeletePod(job interface{}, pod *v1.Pod) error | |||
|
|||
// SetClusterSpec sets the cluster spec for the pod | |||
// Get the deafult container port number | |||
GetDefaultContainerPortName() string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we place the function after GetDefaultContainerName() string
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, let me update it.
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
job_controller/service.go
Outdated
return nil | ||
} | ||
|
||
// GetPortFromJob gets the port of tensorflow container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "tensorflow"
job_controller/service.go
Outdated
// createNewService creates a new service for the given index and type. | ||
func (jc *JobController) createNewService(job metav1.Object, rtype commonv1.ReplicaType, | ||
spec *commonv1.ReplicaSpec, index string) error { | ||
tfjobKey, err := KeyFunc(job) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "tf"
job_controller/job_controller.go
Outdated
@@ -93,6 +93,9 @@ type ControllerInterface interface { | |||
// Returns the default container name in pod | |||
GetDefaultContainerName() string | |||
|
|||
// Get the deafult container port number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
port number -> port name to be consistent with the function name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - default
@merlintang Travis CI build failed on |
job_controller/service.go
Outdated
for index, serviceSlice := range serviceSlices { | ||
if len(serviceSlice) > 1 { | ||
util.LoggerForReplica(job, rt).Warningf("We have too many services for %s %d", rt, index) | ||
// TODO(gaocegege): Kill some services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this unless Gao Ce is still planning to fix this :)
job_controller/job_controller.go
Outdated
@@ -93,6 +93,9 @@ type ControllerInterface interface { | |||
// Returns the default container name in pod | |||
GetDefaultContainerName() string | |||
|
|||
// Get the deafult container port number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - default
job_controller/service.go
Outdated
} | ||
} | ||
} | ||
return -1, fmt.Errorf("failed to found the port") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed to find
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! Liu, I have updated them.
} | ||
|
||
// GetPortFromJob gets the port of job container. | ||
func (jc *JobController) GetPortFromJob(spec *commonv1.ReplicaSpec) (int32, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetPortFromReplicaSpec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the input is the replicaSpec, then the underline logic is the replicaSpec related container. thus, I prefer the container name for further understand. if you think replicaSpec is better for understanding, I can change it.
/lgtm |
job_controller/job_controller.go
Outdated
@@ -48,6 +48,12 @@ type ControllerInterface interface { | |||
// Returns the Group Name(value) in the labels of the job | |||
GetGroupNameLabelValue() string | |||
|
|||
// Returns the Replica Type(key) in the labels of the job | |||
GetReplicaTypeLabelKey() string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this because of merge conflict? #29 removes these labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. @merlintang Could you rebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is fixed. thanks for your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These interfaces are supposed to be removed and use this instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@jian-he can you review this as well? |
/cc @jian-he |
job_controller/job_controller.go
Outdated
@@ -48,6 +48,12 @@ type ControllerInterface interface { | |||
// Returns the Group Name(value) in the labels of the job | |||
GetGroupNameLabelValue() string | |||
|
|||
// Returns the Replica Type(key) in the labels of the job | |||
GetReplicaTypeLabelKey() string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These interfaces are supposed to be removed and use this instead
job_controller/job_controller.go
Outdated
|
||
// Returns the Replica Index(value) in the labels of the job | ||
GetReplicaIndexLabelKey() string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func (TestJobController) GetReplicaIndexLabelKey() string { | ||
return util.ReplicaIndexLabel | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same remove these two
job_controller/job.go
Outdated
@@ -204,12 +203,12 @@ func (jc *JobController) ReconcileJobs( | |||
} | |||
|
|||
// TODO(terrytangyuan): Uncomment this once service reconciliation logic is in place |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you remove this TODO ?
/lgtm |
@richardsliu could you take a look ? |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR adds skeleton code for reconcile service.
This change is