Skip to content

Commit

Permalink
Add make rule to prepare branch for release (#1731)
Browse files Browse the repository at this point in the history
Change-Id: Iaad4e043f8c295edbe16fa08f8ad431d8d96d8e5

Co-authored-by: Aldo Culquicondor <acondor@google.com>
  • Loading branch information
1 parent b6077aa commit b4809c0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/NEW_RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ Please do not remove items from the checklist
At least two for minor or major releases. At least one for a patch release.
- [ ] Verify that the changelog in this issue and the CHANGELOG folder is up-to-date
- [ ] Use https://github.com/kubernetes/release/tree/master/cmd/release-notes to gather notes.
Example: `release-notes --org kubernetes-sigs --repo kueue --branch release-0.3 --start-sha 4a0ebe7a3c5f2775cdf5fc7d60c23225660f8702 --end-sha a51cf138afe65677f5f5c97f8f8b1bc4887f73d2`
Example: `release-notes --org kubernetes-sigs --repo kueue --branch release-0.3 --start-sha 4a0ebe7a3c5f2775cdf5fc7d60c23225660f8702 --end-sha a51cf138afe65677f5f5c97f8f8b1bc4887f73d2 --dependencies=false --required-author=""`
- [ ] For major or minor releases (v$MAJ.$MIN.0), create a new release branch.
- [ ] an OWNER creates a vanilla release branch with
- [ ] An OWNER creates a vanilla release branch with
`git branch release-$MAJ.$MIN main`
- [ ] An OWNER pushes the new release branch with
`git push release-$MAJ.$MIN`
- [ ] Update `README.md`, `CHANGELOG`, `charts/kueue/Chart.yaml` (`appVersion`) and `charts/kueue/values.yaml` (`controllerManager.manager.image.tag`) in the release branch: <!-- example #211 #214 -->
- [ ] Update the release branch:
- [ ] Update `RELEASE_BRANCH` and `RELEASE_VERSION` in `Makefile` and run `make prepare-release-branch`
- [ ] Update the `CHANGELOG`
- [ ] Submit a pull request with the changes: <!-- example #211 #214 -->
- [ ] An OWNER [prepares a draft release](https://github.com/kubernetes-sigs/kueue/releases)
- [ ] Write the change log into the draft release.
- [ ] Run
Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ version_pkg = sigs.k8s.io/kueue/pkg/version
LD_FLAGS += -X '$(version_pkg).GitVersion=$(GIT_TAG)'
LD_FLAGS += -X '$(version_pkg).GitCommit=$(shell git rev-parse HEAD)'

# Update these variables when preparing a new release or a release branch.
# Then run `make prepare-release-branch`
RELEASE_VERSION=v0.5.3
RELEASE_BRANCH=main

.PHONY: all
all: generate fmt vet build

Expand Down Expand Up @@ -180,20 +185,22 @@ run-test-e2e-%: K8S_VERSION = $(@:run-test-e2e-%=%)
run-test-e2e-%: FORCE
@echo Running e2e for k8s ${K8S_VERSION}
E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" ./hack/e2e-test.sh
@$(call clean-manifests)

JOBSET_VERSION = $(shell $(GO_CMD) list -m -f "{{.Version}}" sigs.k8s.io/jobset)
run-test-multikueue-e2e-%: K8S_VERSION = $(@:run-test-multikueue-e2e-%=%)
run-test-multikueue-e2e-%: FORCE
@echo Running multikueue e2e for k8s ${K8S_VERSION}
E2E_KIND_VERSION="kindest/node:v$(K8S_VERSION)" KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) CREATE_KIND_CLUSTER=$(CREATE_KIND_CLUSTER) ARTIFACTS="$(ARTIFACTS)/$@" IMAGE_TAG=$(IMAGE_TAG) GINKGO_ARGS="$(GINKGO_ARGS)" JOBSET_VERSION=$(JOBSET_VERSION) ./hack/multikueue-e2e-test.sh
@$(call clean-manifests)

.PHONY: ci-lint
ci-lint: golangci-lint
$(GOLANGCI_LINT) run --timeout 15m0s

.PHONY: verify
verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm generate-apiref
git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go site/content/en/docs/reference
verify: gomod-verify vet ci-lint fmt-verify toc-verify manifests generate update-helm generate-apiref prepare-release-branch
git --no-pager diff --exit-code config/components apis charts/kueue/templates client-go site/

##@ Build

Expand Down Expand Up @@ -243,7 +250,7 @@ ifndef ignore-not-found
ignore-not-found = false
endif

clean-manifests = (cd config/components/manager && $(KUSTOMIZE) edit set image controller=gcr.io/k8s-staging-kueue/kueue:main)
clean-manifests = (cd config/components/manager && $(KUSTOMIZE) edit set image controller=gcr.io/k8s-staging-kueue/kueue:$(RELEASE_BRANCH))

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
Expand Down Expand Up @@ -286,6 +293,12 @@ artifacts: kustomize yq helm
# Revert the image changes
$(YQ) e '.controllerManager.manager.image.repository = "$(STAGING_IMAGE_REGISTRY)/$(IMAGE_NAME)" | .controllerManager.manager.image.tag = "main" | .controllerManager.manager.image.pullPolicy = "Always"' -i charts/kueue/values.yaml

.PHONY: prepare-release-branch
prepare-release-branch: yq kustomize
sed -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/config.toml
$(YQ) e '.appVersion = "$(RELEASE_VERSION)"' -i charts/kueue/Chart.yaml
@$(call clean-manifests)

##@ Tools

# Build an image that can be used with kubectl debug
Expand Down
2 changes: 1 addition & 1 deletion charts/kueue/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.5.3"
appVersion: "v0.5.3"
8 changes: 3 additions & 5 deletions charts/kueue/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ enablePrometheus: false
enableCertManager: false
# Customize controlerManager
controllerManager:
#featureGates:
# - name: PartialAdmission
# enabled: true
#featureGates:
# - name: PartialAdmission
# enabled: true
kubeRbacProxy:
image:
repository: gcr.io/kubebuilder/kube-rbac-proxy
Expand All @@ -22,8 +22,6 @@ controllerManager:
manager:
image:
repository: gcr.io/k8s-staging-kueue/kueue
# tag, if defined will use the given image tag, else Chart.AppVersion will be used
tag: main
# This should be set to 'IfNotPresent' for released version
pullPolicy: Always
resources:
Expand Down
2 changes: 1 addition & 1 deletion hack/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function cleanup {
fi
cluster_cleanup $KIND_CLUSTER_NAME
fi
(cd config/components/manager && $KUSTOMIZE edit set image controller=gcr.io/k8s-staging-kueue/kueue:main)
exit 0
}

function startup {
Expand Down
2 changes: 1 addition & 1 deletion hack/multikueue-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function cleanup {
cluster_cleanup $WORKER1_KIND_CLUSTER_NAME
cluster_cleanup $WORKER2_KIND_CLUSTER_NAME
fi
(cd config/components/manager && $KUSTOMIZE edit set image controller=gcr.io/k8s-staging-kueue/kueue:main)
exit 0
}


Expand Down

0 comments on commit b4809c0

Please sign in to comment.