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

Add skeleton code for reconcile service #25

Merged
merged 10 commits into from
May 9, 2019

Conversation

merlintang
Copy link
Contributor

@merlintang merlintang commented Apr 24, 2019

This PR adds skeleton code for reconcile service.


This change is Reviewable

@googlebot
Copy link

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.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@merlintang
Copy link
Contributor Author

I signed it!

Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot removed the lgtm label Apr 24, 2019
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: gaocegege

If they are not already assigned, you can assign the PR to them by writing /assign @gaocegege in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -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
Copy link
Member

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?

Copy link
Contributor Author

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.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

return nil
}

// GetPortFromJob gets the port of tensorflow container.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "tensorflow"

// 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "tf"

@@ -93,6 +93,9 @@ type ControllerInterface interface {
// Returns the default container name in pod
GetDefaultContainerName() string

// Get the deafult container port number
Copy link
Member

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo - default

@terrytangyuan
Copy link
Member

@merlintang Travis CI build failed on golangci-lint run. I believe you can fix it by changing reconcileServices to ReconcileServices for now.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Apr 25, 2019
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.
Copy link
Contributor

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 :)

@@ -93,6 +93,9 @@ type ControllerInterface interface {
// Returns the default container name in pod
GetDefaultContainerName() string

// Get the deafult container port number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo - default

}
}
}
return -1, fmt.Errorf("failed to found the port")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failed to find

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetPortFromReplicaSpec?

Copy link
Contributor Author

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.

@richardsliu
Copy link
Contributor

/lgtm

@@ -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
Copy link
Member

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

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 5, 2019
Copy link
Member

@gaocegege gaocegege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@merlintang
Copy link
Contributor Author

@jian-he can you review this as well?

@gaocegege
Copy link
Member

/cc @jian-he

@k8s-ci-robot k8s-ci-robot requested a review from jian-he May 5, 2019 05:30
@@ -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
Copy link
Contributor

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


// Returns the Replica Index(value) in the labels of the job
GetReplicaIndexLabelKey() string

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two also need to be fixed.

// TODO(terrytangyuan): Uncomment this once service reconciliation logic is in place

// TODO(terrytangyuan): Uncomment this once service reconciliation logic is in place

func (TestJobController) GetReplicaIndexLabelKey() string {
return util.ReplicaIndexLabel
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remove these two

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 6, 2019
@@ -204,12 +203,12 @@ func (jc *JobController) ReconcileJobs(
}

// TODO(terrytangyuan): Uncomment this once service reconciliation logic is in place
Copy link
Contributor

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 ?

@jian-he
Copy link
Contributor

jian-he commented May 6, 2019

/lgtm

@jian-he
Copy link
Contributor

jian-he commented May 6, 2019

@richardsliu could you take a look ?

@richardsliu richardsliu merged commit 38d6b71 into kubeflow:master May 9, 2019
georgkaleido pushed a commit to georgkaleido/common that referenced this pull request Jun 9, 2022
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants