Skip to content

Commit 056adfd

Browse files
authored
feat: adds initial release automation (#291)
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent d5f5507 commit 056adfd

File tree

3 files changed

+224
-39
lines changed

3 files changed

+224
-39
lines changed

.github/ISSUE_TEMPLATE/new-release.md

+142-37
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,147 @@ about: Propose a new release
44
title: Release v0.x.0
55
labels: ''
66
assignees: ''
7-
87
---
98

10-
## Release Checklist
11-
- [ ] For major or minor releases (v$MAJ.$MIN.0), create a new release branch.
12-
- [ ] A maintainer creates a vanilla release branch with
13-
`git branch release-$MAJ.$MIN main`
14-
- [ ] A maintainer pushes the new release branch with
15-
`git push release-$MAJ.$MIN` (e.g., release-0.1)
16-
- [ ] Update content and artifacts such as README, deployment templates, docs, configuration, test/e2e flags.
17-
Submit a PR against the release branch.
18-
- [ ] A maintainer [prepares a draft release](https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases)
19-
- [ ] Write the change log into the draft release.
20-
- [ ] Run
21-
`make artifacts`
22-
to generate the artifacts and upload the files in the `artifacts` folder to the draft release.
23-
- [ ] A maintainer creates a signed tag running (e.g., VERSION=v0.1.0)
24-
`git tag -s $VERSION`
25-
and inserts the changelog into the tag description.
26-
To perform this step, you need [a PGP key registered on github](https://docs.github.com/en/authentication/managing-commit-signature-verification/checking-for-existing-gpg-keys).
27-
- [ ] A maintainer pushes the tag with
28-
`git push $VERSION`
29-
- Triggers prow to build and publish a staging container image
30-
[`us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp:$VERSION`](https://us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/epp)
31-
- [ ] Submit a PR against [k8s.io](https://github.com/kubernetes/k8s.io),
32-
updating [`k8s-staging-gateway-api-inference-extension/images.yaml`](https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-gateway-api-inference-extension/images.yaml) to
33-
promote the container images from staging to production. <!-- link to example PR once we have one -->
34-
- [ ] Wait for the PR to be merged and verify that the image `registry.k8s.io/gateway-api-inference-extension/epp:$VERSION` is available.
35-
- [ ] Publish the draft release prepared at the [Github releases page](https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases).
36-
- [ ] Add a link to the tagged release in this issue: <!-- example https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/tag/v0.1.0 -->
37-
- [ ] Send an announcement email to `[email protected]` and `[email protected]` with the subject `[ANNOUNCE] Gateway API Inference Extension $VERSION is released`
38-
- [ ] Add a link to the release announcement in this issue: <!-- link to an example email once we have one -->
39-
- [ ] Update docs in `main` branch: <!-- link to example PR once we have one -->
40-
- [ ] Close this issue
41-
42-
## Changelog
43-
<!--
44-
Describe changes since the last release here.
45-
-->
9+
- [Introduction](#introduction)
10+
- [Prerequisites](#prerequisites)
11+
- [Release Process](#release-process)
12+
- [Announce the Release](#announce-the-release)
13+
- [Final Steps](#final-steps)
14+
15+
## Introduction
16+
17+
This document defines the process for releasing Gateway API Inference Extension.
18+
19+
## Prerequisites
20+
21+
1. Permissions to push to the Gateway API Inference Extension repository.
22+
23+
2. Set the required environment variables based on the expected release number:
24+
25+
```shell
26+
export MAJOR=0
27+
export MINOR=1
28+
export REMOTE=origin
29+
```
30+
31+
3. If creating a release candidate, set the release candidate number.
32+
33+
```shell
34+
export RC=1
35+
```
36+
37+
4. The vLLM image tag defaults to `v0.7.1` for a release. Optionally, change the vLLM image tag. For example:
38+
39+
```shell
40+
export VLLM=0.7.2
41+
```
42+
43+
## Release Process
44+
45+
1. If needed, clone the Gateway API Inference Extension [repo][repo].
46+
47+
```shell
48+
git clone https://github.com/kubernetes-sigs/gateway-api-inference-extension.git -b main
49+
```
50+
51+
2. If you already have the repo cloned, ensure it’s up-to-date and your local branch is clean.
52+
53+
3. Create a new release branch from the `main` branch. The release branch should be named `release-v${MAJOR}.${MINOR}`, e.g. `release-v0.1`.
54+
55+
```shell
56+
git checkout -b release-v${MAJOR}.${MINOR}
57+
```
58+
59+
4. Update release-specific content, generate release artifacts, and stage the changes.
60+
61+
```shell
62+
make release
63+
```
64+
65+
5. Sign, commit, and push the changes to the Gateway API Inference Extension repo.
66+
67+
For a release candidate:
68+
69+
```shell
70+
git commit -s -m "Updates artifacts for v${MAJOR}.${MINOR}.0-rc.${RC} release"
71+
```
72+
73+
For a major or minor release:
74+
75+
```shell
76+
git commit -s -m "Updates artifacts for v${MAJOR}.${MINOR}.0 release"
77+
```
78+
79+
6. Push your release branch to the Gateway API Inference Extension remote.
80+
81+
```shell
82+
git push ${REMOTE} release-v${MAJOR}.${MINOR}
83+
```
84+
85+
7. Tag the head of your release branch with the number.
86+
87+
For a release candidate:
88+
89+
```shell
90+
git tag -a v${MAJOR}.${MINOR}.0-rc.${RC} -m 'Gateway API Inference Extension v${MAJOR}.${MINOR}.0-rc.${RC} Release Candidate'
91+
```
92+
93+
For a major or minor release:
94+
95+
```shell
96+
git tag -a v${MAJOR}.${MINOR}.0 -m 'Gateway API Inference Extension v${MAJOR}.${MINOR}.0 Release'
97+
```
98+
99+
**Note:** A PGP key must be [registered] to your GitHub account.
100+
101+
8. Push the tag to the Gateway API Inference Extension repo.
102+
103+
For a release candidate:
104+
105+
```shell
106+
git push ${REMOTE} v${MAJOR}.${MINOR}.0-rc.${RC}
107+
```
108+
109+
For a major or minor release:
110+
111+
```shell
112+
git push ${REMOTE} v${MAJOR}.${MINOR}.0
113+
```
114+
115+
9. Pushing the tag triggers Prow to build and publish the container image to the [staging registry][].
116+
10. Submit a PR against [k8s.io][] to add the staging image tag and SHA to [`k8s-staging-gateway-api-inference-extension/images.yaml`][yaml]. This will
117+
promote the image to the production registry. **Note:** Add a link to this issue when the PR is merged.
118+
11. Test the steps in the tagged quickstart guide after the PR merges, for example: `https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/v0.1.0-rc.1/pkg/README.md`.
119+
12. Create a [new release][]:
120+
1. Choose the tag that you created for the release.
121+
2. Use the tag as the release title, i.e. `v0.1.0` refer to previous release for the content of the release body.
122+
3. Click "Generate release notes" and preview the release body.
123+
4. Click "Attach binaries by dropping them here or selecting them." and add the contents of the `artifacts` directory generated from `make release`.
124+
5. If this is a release candidate, select the "This is a pre-release" checkbox.
125+
13. If you find any bugs in this process, create an [issue][].
126+
127+
## Announce the Release
128+
129+
Use the following steps to announce the release.
130+
131+
1. Send an announcement email to `[email protected]` and `[email protected]` with the subject:
132+
133+
```shell
134+
[ANNOUNCE] Gateway API Inference Extension v${MAJOR}.${MINOR}.0 is released
135+
```
136+
137+
2. Add a link to the release announcement in this issue. <!-- link to an example email once we have one -->
138+
139+
## Final Steps
140+
141+
1. Update docs in the `main` branch. <!-- link to example PR once we have one -->
142+
2. Close this issue.
143+
144+
[repo]: https://github.com/kubernetes-sigs/gateway-api-inference-extension
145+
[staging registry]: https://console.cloud.google.com/artifacts/docker/k8s-staging-images/us-central1/gateway-api-inference-extension/epp
146+
[new release]: https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/new
147+
[registered]: https://docs.github.com/en/authentication/managing-commit-signature-verification/checking-for-existing-gpg-keys
148+
[k8s.io]: https://github.com/kubernetes/k8s.io
149+
[yaml]: https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-gateway-api-inference-extension/images.yaml
150+
[issue]: https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/new/choose

Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ code-generator:
8484
cp -f $(CODEGEN_ROOT)/generate-internal-groups.sh $(PROJECT_DIR)/bin/
8585
cp -f $(CODEGEN_ROOT)/kube_codegen.sh $(PROJECT_DIR)/bin/
8686

87-
8887
.PHONY: fmt
8988
fmt: ## Run go fmt against code.
9089
go fmt ./...
@@ -155,7 +154,6 @@ image-build:
155154
image-push: PUSH=--push
156155
image-push: image-build
157156

158-
159157
##@ Docs
160158

161159
.PHONY: build-docs
@@ -196,13 +194,21 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
196194
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
197195

198196
##@ Release
197+
198+
.PHONY: release-quickstart
199+
release-quickstart: ## Update the quickstart guide for a release.
200+
./hack/release-quickstart.sh
201+
199202
.PHONY: artifacts
200203
artifacts: kustomize
201204
if [ -d artifacts ]; then rm -rf artifacts; fi
202205
mkdir -p artifacts
203206
$(KUSTOMIZE) build config/crd -o artifacts/manifests.yaml
204207
@$(call clean-manifests)
205208

209+
.PHONY: release
210+
release: artifacts release-quickstart verify test # Create a release.
211+
206212
##@ Dependencies
207213

208214
## Location to install dependencies to

hack/release-quickstart.sh

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# -----------------------------------------------------------------------------
5+
# Environment variables (defaults)
6+
# -----------------------------------------------------------------------------
7+
# MAJOR and MINOR are required (defaults provided here if not already set)
8+
MAJOR="${MAJOR:-0}"
9+
MINOR="${MINOR:-1}"
10+
11+
# If RC is defined (non-empty) then include the rc suffix; otherwise omit it.
12+
if [[ -z "${RC-}" ]]; then
13+
RELEASE_TAG="v${MAJOR}.${MINOR}.0"
14+
else
15+
RELEASE_TAG="v${MAJOR}.${MINOR}.0-rc.${RC}"
16+
fi
17+
18+
# vLLM image version (default to 0.7.1 if not defined)
19+
VLLM="${VLLM:-0.7.1}"
20+
21+
echo "Using release tag: ${RELEASE_TAG}"
22+
echo "Using vLLM image version: ${VLLM}"
23+
24+
# -----------------------------------------------------------------------------
25+
# Update pkg/README.md
26+
# -----------------------------------------------------------------------------
27+
README="pkg/README.md"
28+
echo "Updating ${README} ..."
29+
30+
# Replace URLs that refer to a tag (whether via refs/tags or releases/download)
31+
# This regex matches any version in the form v<MAJOR>.<MINOR>.0-rc[.]?<number>
32+
sed -i.bak -E "s|(refs/tags/)v[0-9]+\.[0-9]+\.0-rc\.?[0-9]+|\1${RELEASE_TAG}|g" "$README"
33+
sed -i.bak -E "s|(releases/download/)v[0-9]+\.[0-9]+\.0-rc\.?[0-9]+|\1${RELEASE_TAG}|g" "$README"
34+
35+
# Replace the CRD installation line: change "kubectl apply -k" to "kubectl apply -f" with the proper URL
36+
sed -i.bak "s|kubectl apply -k https://github.com/kubernetes-sigs/gateway-api-inference-extension/config/crd|kubectl apply -f https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/download/${RELEASE_TAG}/manifests.yaml|g" "$README"
37+
38+
# -----------------------------------------------------------------------------
39+
# Update pkg/manifests/ext_proc.yaml
40+
# -----------------------------------------------------------------------------
41+
EXT_PROC="pkg/manifests/ext_proc.yaml"
42+
echo "Updating ${EXT_PROC} ..."
43+
44+
# Update any image reference for the EPP container.
45+
# For images from registry.k8s.io:
46+
sed -i.bak -E "s|(registry\.k8s\.io/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EXT_PROC"
47+
# In case there is still any reference from us-central1-docker.pkg.dev:
48+
sed -i.bak -E "s|(us-central1-docker\.pkg\.dev/k8s-staging-images/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EXT_PROC"
49+
50+
# -----------------------------------------------------------------------------
51+
# Update pkg/manifests/vllm/deployment.yaml
52+
# -----------------------------------------------------------------------------
53+
VLLM_DEPLOY="pkg/manifests/vllm/deployment.yaml"
54+
echo "Updating ${VLLM_DEPLOY} ..."
55+
56+
# Update the vLLM image version
57+
sed -i.bak -E "s|(vllm/vllm-openai:)[^\"[:space:]]+|\1${VLLM}|g" "$VLLM_DEPLOY"
58+
59+
# Also change the imagePullPolicy from Always to IfNotPresent on lines containing the vLLM image.
60+
sed -i.bak "/vllm\/vllm-openai/ s/Always/IfNotPresent/g" "$VLLM_DEPLOY"
61+
62+
# -----------------------------------------------------------------------------
63+
# Stage the changes
64+
# -----------------------------------------------------------------------------
65+
echo "Staging $README $EXT_PROC $VLLM_DEPLOY files..."
66+
git add $README $EXT_PROC $VLLM_DEPLOY
67+
68+
# -----------------------------------------------------------------------------
69+
# Cleanup backup files and finish
70+
# -----------------------------------------------------------------------------
71+
echo "Cleaning up temporary backup files..."
72+
find . -name "*.bak" -delete
73+
74+
echo "Release quickstart update complete."

0 commit comments

Comments
 (0)