cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

Add make target to generate release manifests

Open killianmuldoon opened this issue 2 years ago • 3 comments

Currently the only way to generate our release manifests with the CAPI Makefile is to run make release. Currently this runs the following targets:

	GIT_VERSION=$(RELEASE_TAG) $(MAKE) release-binaries
	# Set the manifest image to the production bucket.
	$(MAKE) manifest-modification REGISTRY=$(PROD_REGISTRY)
	## Build the manifests
	$(MAKE) release-manifests
	# Set the development manifest image to the staging bucket.
	$(MAKE) manifest-modification-dev REGISTRY=$(STAGING_REGISTRY)
	## Build the development manifests
	$(MAKE) release-manifests-dev
	## Clean the git artifacts modified in the release process
	$(MAKE) clean-release-git

With the first target - make release-binaries - taking by far the longest. We should introduce a way to simply generate the manifests without needing to create the binaries - i.e. introduce a target make release-manifests-all with the following targets:

release-manifests:
	# Set the manifest image to the production bucket.
	$(MAKE) manifest-modification REGISTRY=$(PROD_REGISTRY)
	## Build the manifests
	$(MAKE) release-manifests
	# Set the development manifest image to the staging bucket.
	$(MAKE) manifest-modification-dev REGISTRY=$(STAGING_REGISTRY)
	## Build the development manifests
	$(MAKE) release-manifests-dev
	## Clean the git artifacts modified in the release process
	$(MAKE) clean-release-git

Some additional restructuring could be done to combine the release-manifests-* and manifest-modification-* targets

And reduce the release target to:

	GIT_VERSION=$(RELEASE_TAG) $(MAKE) release-binaries
        $(MAKE) release-manifests-all

/kind cleanup

killianmuldoon avatar Jul 25 '22 10:07 killianmuldoon

/assign

killianmuldoon avatar Jul 25 '22 10:07 killianmuldoon

/triage accepted

fabriziopandini avatar Jul 29 '22 18:07 fabriziopandini

Fine for me. Let's just be careful that we don't change the outputs (e.g. before/after refactoring diff)

sbueringer avatar Aug 16 '22 11:08 sbueringer

Hello Team, As per my understanding we need to create a target release-manifests-all in Makefile so that the user can generate all the manifests independent of release-binaries

The expected content of release-manifest-all

https://github.com/kubernetes-sigs/cluster-api/blob/844eff2f29d1119ec171efb8111e305e03c5bfca/Makefile#L832-L841

If no one is actively working on this issue, may I take it forward?

chiukapoor avatar Nov 22 '22 13:11 chiukapoor

Thanks for taking this up @chiukapoor !

/unassign /assign @chiukapoor

killianmuldoon avatar Nov 22 '22 13:11 killianmuldoon

I have made changes as per the issue description but having some doubts as if it is safe to run make release for testing purposes on the local environment. As per my understanding of the code there is no code/release push that is happening but just wanted to be sure before I proceed.

chiukapoor avatar Nov 22 '22 14:11 chiukapoor

Hello @sbueringer, @fabriziopandini and @killianmuldoon, May you please help with the https://github.com/kubernetes-sigs/cluster-api/issues/6975#issuecomment-1323725276 query

chiukapoor avatar Nov 25 '22 11:11 chiukapoor

It should be fine to run make release locally to test your changes :slightly_smiling_face:

killianmuldoon avatar Nov 25 '22 11:11 killianmuldoon

Thank you, I will test things out and will create a PR.

chiukapoor avatar Nov 25 '22 12:11 chiukapoor

@killianmuldoon, I have created the PR which adds make target release-manifests-all to generate all the release manifests independently of make release

While looking at release-manifests and release-manifests-dev targets, I couldn't find a way to combine them considering that both of them are using pretty different variables of folder paths. The same applies to manifest-modification-*. Please do let me know your views on this, probably there is something I may be missing.

chiukapoor avatar Nov 25 '22 13:11 chiukapoor