Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up manifests #510

Merged
merged 1 commit into from
Feb 8, 2023
Merged

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Jan 27, 2023

Signed-off-by: Yuki Iwai yuki.iwai.tz@gmail.com

I cleaned up manifests in the following:

  1. Replace the image tag with 'master' to avoid this confusing.
  2. Update the make crd target so that we can add the latest CRD to the manifests directory.
  3. Regenerate deploy/v2beta1/mpi-operator.yaml.
  4. Update the Readme.md.
  5. Add CI to verify generated codes.

Our operator images at dockerhub:

Fixes: #508

@tenzen-y
Copy link
Member Author

/assign @terrytangyuan

@tenzen-y
Copy link
Member Author

tenzen-y commented Jan 27, 2023

@terrytangyuan Or we push the latest image with latest tag by changing Ci?

tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

cc: @alculquicondor


Updated

I modified the CI to push the latest image with the latest image tag.

@tenzen-y tenzen-y changed the title Change the image tag to master Push the latest image with image tag Jan 27, 2023
@@ -31,6 +31,7 @@ jobs:
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

but wouldn't this affect every tag?

Copy link
Member Author

Choose a reason for hiding this comment

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

Does that mean the existing latest tag image is overwritten?

Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, by doing this the latest tag would always be overriden with every push. I think we should do this manually for new releases only.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. What do you think about replacing the image tag with master in the following to avoid this confusing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

that sounds better to me.

The manifests that are part of a release should have the specific release tag.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I would update this PR.

@tenzen-y tenzen-y changed the title Push the latest image with image tag Use 'master' tag for the operator image instead of 'latest' Jan 27, 2023
@tenzen-y
Copy link
Member Author

@alculquicondor Updated.

@alculquicondor
Copy link
Collaborator

Can we update https://github.com/kubeflow/mpi-operator#installation to indicate that this will install the latest development version?

:latest is still the latest release, 0.3.0. I wonder if we should have stored those manifests somewhere for users reference. Can we still add them as a release asset? @terrytangyuan

@tenzen-y
Copy link
Member Author

Can we update https://github.com/kubeflow/mpi-operator#installation to indicate that this will install the latest development version?

Makes sense. It is helpful.

@tenzen-y
Copy link
Member Author

@alculquicondor I updated the docs.

git clone https://github.com/kubeflow/mpi-operator
cd mpi-operator
kubectl apply -f deploy/v2beta1/mpi-operator.yaml
kubectl apply -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v2beta1/mpi-operator.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

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

this file still says latest actually

image: mpioperator/mpi-operator:latest

regenerate the file

Copy link
Member Author

Choose a reason for hiding this comment

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

I plan to generate that manifest in #509.
Do you prefer to regenerate the manifests in this PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes please

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. I close #508 and regenerate manifests in this PR.

@tenzen-y tenzen-y changed the title Use 'master' tag for the operator image instead of 'latest' [WIP] Use 'master' tag for the operator image instead of 'latest' Jan 30, 2023
@google-oss-prow google-oss-prow bot added size/XXL and removed size/S labels Jan 30, 2023
Comment on lines +22 to +30
- name: generate codes
run: make verify-generate
Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed in #509 (review), we verify generated codes.

@tenzen-y tenzen-y changed the title [WIP] Use 'master' tag for the operator image instead of 'latest' Cleanup manifests Jan 30, 2023
Makefile Outdated
@@ -106,9 +110,13 @@ tidy:
lint: bin/golangci-lint ## Run golangci-lint linter
$(GOLANGCI_LINT) run --new-from-rev=origin/master --go 1.19

# Generate deploy/v2beta1/mpi-operator.yaml
all-in-one: kustomize crd
Copy link
Collaborator

Choose a reason for hiding this comment

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

all-in-one sounds very cryptic. What about manifest

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good.

plural: mpijobs
shortNames:
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we add the shortname via kubebuilder markers? https://book.kubebuilder.io/reference/markers/crd.html
I say no, given that these names are too short to be meaningful

Copy link
Member Author

@tenzen-y tenzen-y Jan 30, 2023

Choose a reason for hiding this comment

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

I agree with you. I also think we don't need these shortNames.
Let me know what other members think.

cc: @terrytangyuan

type: object
required:
- Launcher
additionalProperties:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are losing the knowledge about Launcher and Worker here.
But this is a problem with the API structs themselves.

We shouldn't be using a map https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#lists-of-named-subobjects-preferred-over-maps

Maybe we can fix it in a v2(beta2) API, but it would be nice to fix other training job objects, like so:

type MPIReplicaSpecs struct {
  Launcher common.ReplicaSpec `json:"launcher"`
  Worker common.ReplicaSpec `json:"worker"`
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks good.
IIRC, we plan to remove dependencies with kubeflow/common in the future altogether.
So we will be able to fix this after that.

Either way, I create an issue to keep tracking this.

@tenzen-y tenzen-y force-pushed the change-image-tag branch 4 times, most recently from f9589f8 to a1d0bf9 Compare February 4, 2023 18:36
@tenzen-y tenzen-y changed the title [WIP] Cleanup manifests Cleanup manifests Feb 4, 2023
@tenzen-y
Copy link
Member Author

tenzen-y commented Feb 4, 2023

@alculquicondor This PR is ready for review. PTAL.

Copy link
Collaborator

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -40,7 +40,7 @@ const (

// initializeMPIJobStatuses initializes the ReplicaStatuses for MPIJob.
func initializeMPIJobStatuses(mpiJob *kubeflow.MPIJob, mtype kubeflow.MPIReplicaType) {
replicaType := kubeflow.MPIReplicaType(mtype)
replicaType := mtype
Copy link
Collaborator

Choose a reason for hiding this comment

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

just remove this line?

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
@google-oss-prow google-oss-prow bot removed the lgtm label Feb 6, 2023
@tenzen-y tenzen-y changed the title Cleanup manifests Clean up manifests Feb 6, 2023
@tenzen-y
Copy link
Member Author

tenzen-y commented Feb 6, 2023

Addressed comments and squashed commits into one.

@tenzen-y tenzen-y requested review from alculquicondor and removed request for carmark and gaocegege February 6, 2023 18:07
@alculquicondor
Copy link
Collaborator

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Feb 6, 2023
@alculquicondor
Copy link
Collaborator

/assign @terrytangyuan

@tenzen-y
Copy link
Member Author

tenzen-y commented Feb 8, 2023

@terrytangyuan Can you add a approve label to this PR? We need this improvement for the v0.4.0 release.

@alculquicondor
Copy link
Collaborator

Let me try my new powers 😂

/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor

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

@google-oss-prow google-oss-prow bot merged commit efbba01 into kubeflow:master Feb 8, 2023
@tenzen-y tenzen-y deleted the change-image-tag branch February 8, 2023 17:58
@tenzen-y
Copy link
Member Author

tenzen-y commented Feb 8, 2023

Let me try my new powers 😂

/approve

Great power 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need to add "coordination.k8s.io" and "-leases" to clusterrole
3 participants