generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 180
feat: adds initial release automation #291
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,42 +4,147 @@ about: Propose a new release | |
title: Release v0.x.0 | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Release Checklist | ||
- [ ] For major or minor releases (v$MAJ.$MIN.0), create a new release branch. | ||
- [ ] A maintainer creates a vanilla release branch with | ||
`git branch release-$MAJ.$MIN main` | ||
- [ ] A maintainer pushes the new release branch with | ||
`git push release-$MAJ.$MIN` (e.g., release-0.1) | ||
- [ ] Update content and artifacts such as README, deployment templates, docs, configuration, test/e2e flags. | ||
Submit a PR against the release branch. | ||
- [ ] A maintainer [prepares a draft release](https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases) | ||
- [ ] Write the change log into the draft release. | ||
- [ ] Run | ||
`make artifacts` | ||
to generate the artifacts and upload the files in the `artifacts` folder to the draft release. | ||
- [ ] A maintainer creates a signed tag running (e.g., VERSION=v0.1.0) | ||
`git tag -s $VERSION` | ||
and inserts the changelog into the tag description. | ||
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). | ||
- [ ] A maintainer pushes the tag with | ||
`git push $VERSION` | ||
- Triggers prow to build and publish a staging container image | ||
[`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) | ||
- [ ] Submit a PR against [k8s.io](https://github.com/kubernetes/k8s.io), | ||
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 | ||
promote the container images from staging to production. <!-- link to example PR once we have one --> | ||
- [ ] Wait for the PR to be merged and verify that the image `registry.k8s.io/gateway-api-inference-extension/epp:$VERSION` is available. | ||
- [ ] Publish the draft release prepared at the [Github releases page](https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases). | ||
- [ ] 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 --> | ||
- [ ] Send an announcement email to `[email protected]` and `[email protected]` with the subject `[ANNOUNCE] Gateway API Inference Extension $VERSION is released` | ||
- [ ] Add a link to the release announcement in this issue: <!-- link to an example email once we have one --> | ||
- [ ] Update docs in `main` branch: <!-- link to example PR once we have one --> | ||
- [ ] Close this issue | ||
|
||
## Changelog | ||
<!-- | ||
Describe changes since the last release here. | ||
--> | ||
- [Introduction](#introduction) | ||
- [Prerequisites](#prerequisites) | ||
- [Release Process](#release-process) | ||
- [Announce the Release](#announce-the-release) | ||
- [Final Steps](#final-steps) | ||
|
||
## Introduction | ||
|
||
This document defines the process for releasing Gateway API Inference Extension. | ||
|
||
## Prerequisites | ||
|
||
1. Permissions to push to the Gateway API Inference Extension repository. | ||
|
||
2. Set the required environment variables based on the expected release number: | ||
|
||
```shell | ||
export MAJOR=0 | ||
export MINOR=1 | ||
export REMOTE=origin | ||
``` | ||
|
||
3. If creating a release candidate, set the release candidate number. | ||
|
||
```shell | ||
export RC=1 | ||
``` | ||
|
||
4. The vLLM image tag defaults to `v0.7.1` for a release. Optionally, change the vLLM image tag. For example: | ||
|
||
```shell | ||
export VLLM=0.7.2 | ||
``` | ||
|
||
## Release Process | ||
|
||
1. If needed, clone the Gateway API Inference Extension [repo][repo]. | ||
|
||
```shell | ||
git clone https://github.com/kubernetes-sigs/gateway-api-inference-extension.git -b main | ||
``` | ||
|
||
2. If you already have the repo cloned, ensure it’s up-to-date and your local branch is clean. | ||
|
||
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`. | ||
|
||
```shell | ||
git checkout -b release-v${MAJOR}.${MINOR} | ||
``` | ||
|
||
4. Update release-specific content, generate release artifacts, and stage the changes. | ||
|
||
```shell | ||
make release | ||
``` | ||
|
||
5. Sign, commit, and push the changes to the Gateway API Inference Extension repo. | ||
|
||
For a release candidate: | ||
|
||
```shell | ||
git commit -s -m "Updates artifacts for v${MAJOR}.${MINOR}.0-rc.${RC} release" | ||
``` | ||
|
||
For a major or minor release: | ||
|
||
```shell | ||
git commit -s -m "Updates artifacts for v${MAJOR}.${MINOR}.0 release" | ||
``` | ||
|
||
6. Push your release branch to the Gateway API Inference Extension remote. | ||
|
||
```shell | ||
git push ${REMOTE} release-v${MAJOR}.${MINOR} | ||
``` | ||
|
||
7. Tag the head of your release branch with the number. | ||
|
||
For a release candidate: | ||
|
||
```shell | ||
git tag -a v${MAJOR}.${MINOR}.0-rc.${RC} -m 'Gateway API Inference Extension v${MAJOR}.${MINOR}.0-rc.${RC} Release Candidate' | ||
``` | ||
|
||
For a major or minor release: | ||
|
||
```shell | ||
git tag -a v${MAJOR}.${MINOR}.0 -m 'Gateway API Inference Extension v${MAJOR}.${MINOR}.0 Release' | ||
``` | ||
|
||
**Note:** A PGP key must be [registered] to your GitHub account. | ||
|
||
8. Push the tag to the Gateway API Inference Extension repo. | ||
|
||
For a release candidate: | ||
|
||
```shell | ||
git push ${REMOTE} v${MAJOR}.${MINOR}.0-rc.${RC} | ||
``` | ||
|
||
For a major or minor release: | ||
|
||
```shell | ||
git push ${REMOTE} v${MAJOR}.${MINOR}.0 | ||
``` | ||
|
||
9. Pushing the tag triggers Prow to build and publish the container image to the [staging registry][]. | ||
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 | ||
promote the image to the production registry. **Note:** Add a link to this issue when the PR is merged. | ||
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`. | ||
12. Create a [new release][]: | ||
1. Choose the tag that you created for the release. | ||
2. Use the tag as the release title, i.e. `v0.1.0` refer to previous release for the content of the release body. | ||
3. Click "Generate release notes" and preview the release body. | ||
4. Click "Attach binaries by dropping them here or selecting them." and add the contents of the `artifacts` directory generated from `make release`. | ||
5. If this is a release candidate, select the "This is a pre-release" checkbox. | ||
13. If you find any bugs in this process, create an [issue][]. | ||
|
||
## Announce the Release | ||
|
||
Use the following steps to announce the release. | ||
|
||
1. Send an announcement email to `[email protected]` and `[email protected]` with the subject: | ||
|
||
```shell | ||
[ANNOUNCE] Gateway API Inference Extension v${MAJOR}.${MINOR}.0 is released | ||
``` | ||
|
||
2. Add a link to the release announcement in this issue. <!-- link to an example email once we have one --> | ||
|
||
## Final Steps | ||
|
||
1. Update docs in the `main` branch. <!-- link to example PR once we have one --> | ||
2. Close this issue. | ||
|
||
[repo]: https://github.com/kubernetes-sigs/gateway-api-inference-extension | ||
[staging registry]: https://console.cloud.google.com/artifacts/docker/k8s-staging-images/us-central1/gateway-api-inference-extension/epp | ||
[new release]: https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/new | ||
[registered]: https://docs.github.com/en/authentication/managing-commit-signature-verification/checking-for-existing-gpg-keys | ||
[k8s.io]: https://github.com/kubernetes/k8s.io | ||
[yaml]: https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-gateway-api-inference-extension/images.yaml | ||
[issue]: https://github.com/kubernetes-sigs/gateway-api-inference-extension/issues/new/choose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Environment variables (defaults) | ||
# ----------------------------------------------------------------------------- | ||
# MAJOR and MINOR are required (defaults provided here if not already set) | ||
MAJOR="${MAJOR:-0}" | ||
MINOR="${MINOR:-1}" | ||
|
||
# If RC is defined (non-empty) then include the rc suffix; otherwise omit it. | ||
if [[ -z "${RC-}" ]]; then | ||
RELEASE_TAG="v${MAJOR}.${MINOR}.0" | ||
else | ||
RELEASE_TAG="v${MAJOR}.${MINOR}.0-rc.${RC}" | ||
fi | ||
|
||
# vLLM image version (default to 0.7.1 if not defined) | ||
VLLM="${VLLM:-0.7.1}" | ||
|
||
echo "Using release tag: ${RELEASE_TAG}" | ||
echo "Using vLLM image version: ${VLLM}" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Update pkg/README.md | ||
# ----------------------------------------------------------------------------- | ||
README="pkg/README.md" | ||
echo "Updating ${README} ..." | ||
|
||
# Replace URLs that refer to a tag (whether via refs/tags or releases/download) | ||
# This regex matches any version in the form v<MAJOR>.<MINOR>.0-rc[.]?<number> | ||
sed -i.bak -E "s|(refs/tags/)v[0-9]+\.[0-9]+\.0-rc\.?[0-9]+|\1${RELEASE_TAG}|g" "$README" | ||
sed -i.bak -E "s|(releases/download/)v[0-9]+\.[0-9]+\.0-rc\.?[0-9]+|\1${RELEASE_TAG}|g" "$README" | ||
|
||
# Replace the CRD installation line: change "kubectl apply -k" to "kubectl apply -f" with the proper URL | ||
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" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Update pkg/manifests/ext_proc.yaml | ||
# ----------------------------------------------------------------------------- | ||
EXT_PROC="pkg/manifests/ext_proc.yaml" | ||
echo "Updating ${EXT_PROC} ..." | ||
|
||
# Update any image reference for the EPP container. | ||
# For images from registry.k8s.io: | ||
sed -i.bak -E "s|(registry\.k8s\.io/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EXT_PROC" | ||
# In case there is still any reference from us-central1-docker.pkg.dev: | ||
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" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Update pkg/manifests/vllm/deployment.yaml | ||
# ----------------------------------------------------------------------------- | ||
VLLM_DEPLOY="pkg/manifests/vllm/deployment.yaml" | ||
echo "Updating ${VLLM_DEPLOY} ..." | ||
|
||
# Update the vLLM image version | ||
sed -i.bak -E "s|(vllm/vllm-openai:)[^\"[:space:]]+|\1${VLLM}|g" "$VLLM_DEPLOY" | ||
|
||
# Also change the imagePullPolicy from Always to IfNotPresent on lines containing the vLLM image. | ||
sed -i.bak "/vllm\/vllm-openai/ s/Always/IfNotPresent/g" "$VLLM_DEPLOY" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Stage the changes | ||
# ----------------------------------------------------------------------------- | ||
echo "Staging $README $EXT_PROC $VLLM_DEPLOY files..." | ||
git add $README $EXT_PROC $VLLM_DEPLOY | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Cleanup backup files and finish | ||
# ----------------------------------------------------------------------------- | ||
echo "Cleaning up temporary backup files..." | ||
find . -name "*.bak" -delete | ||
|
||
echo "Release quickstart update complete." |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.