/release

Knative release docs & scripts

Apache License 2.0Apache-2.0

Knative Release

Below you'll find the instructions to release a knative.dev repository.

Schedule has the roster for each Knative release.

Timetable

We release the components of Knative every 6 weeks. All of these components must be moved to the latest "release" of all shared dependencies prior to each release.

First week of the rotation

Make sure you have the right permission

Check to make sure you already are in the "Knative Release Leads" team in https://github.com/knative/community/blob/main/peribolos/knative.yaml and https://github.com/knative/community/blob/main/peribolos/knative-sandbox.yaml . If not, send a PR like this one to grant yourself some super power. Ensure to run /hack/update-codegen.sh to add yourself to the owner files as well, as part of the PR.

Create a release Slack channel

Ask someone from the TOC to create a release-# Slack channel that will be used to help manage this release.

14 days prior to the release

1. Update the Knative releasability defaults

Update the defaults in knative-releasability.yaml to this release by creating a PR. Example PR.

These changes will be propagated to the rest of Knative in the next round of workflow syncs. Check to ensure that it has indeed propagated and if not the sync will have to manually triggered.

2. Announce the imminent pkg cut

Announce on #general that pkg will be cut in a week.

7 days prior to the release

1. Cut release branches of supporting repos

The supporting repos are the base repos where we have common code and common scripts. For these repos (except hack), we follow the same release process as explained in release a repository, but no prow job is executed, hence no git tag and Github release are produced.

NOTE: The supporting repos must be released in the correct order, so you need to check if the dependencies should be updated after each repo release.

First repo that needs to be released is hack. As mentioned, hack is special because it has no dependencies and hence there's no releasability checks, just ensure there are no outstanding PRs and create a release branch.

After hack release branch has been cut, follow the release a repository guide for the following repos skipping the prow job part:

Repo Releasability
knative.dev/pkg Releasability

After pkg repo has their release branch cut, follow the release a repository guide for the following repos skipping the prow job part:

Repo Releasability
knative.dev/networking Releasability
knative.dev/caching Releasability
knative.dev/reconciler-test Releasability

After reconciler-test repo has been cut, follow the release a repository guide for the following repos skipping the prow job part:

Repo Releasability
knative.dev/control-protocol Releasability

Automation will propagate these updates to all the downstream repos in the next few cycles. The goal is to have the first wave of repo releases (serving, eventing, etc) to become "releasable" by the end of the week. This is signaled via the Slack report of releasability posted to the release-# channel every morning (5am PST, M-F).

2. Announce the imminent release cut

Announce on #general that the release will be cut in a week and that additional caution should be used when merging big changes.

3. Check nightly builds

Check the status of the nightly builds for each repo. If they are failing, reach out the respective WG leads to investigate.

4. Collect release-notes

Make a new HackMD release notes document. last release notes document, empty it out and send it to the WG leads of the respective project (serving or eventing) to fill in. Coordinate with both serving and eventing leads.

Each repo has a Release Notes GitHub Action workflow. This can be used to generate the starting point for the release notes. See an example in Eventing. The default starting and ending SHAs will work if running out of the main branch, or you can determine the correct starting and ending SHAs for the script to run.

1 day prior to the release

1. Confirm readiness

Confirm with the respective WG leads that the release is imminent and obtain green light.

2. Check nightly builds

Check the status of the nightly builds for each repo. If they are failing, reach out the respective WG leads to investigate.

Day of the release

Follow the release a repository instructions for each repo. Wait for release automation to kick in (runs on a 2 hour interval). Once the release automation passed, it will create a release tag in the repository. Enhance the respective tags with the collected release-notes using the GitHub UI.

NOTE: The release day does not mean one has to release everything. The pipeline outlined below will take time to complete and it is ok for the release to take days. The day of the release marks the beginning of this process.

In general the release dependency order is something like the following (as of v0.20). Note: buoy check will fail if the dependencies are not yet ready.

First:

Repo Release Releasability Nightly
knative.dev/serving Releases Releasability Nightly
knative.dev/net-certmanager Releases Releasability Nightly
knative.dev/net-contour Releases Releasability Nightly
knative.dev/net-http01 Releases Releasability Nightly
knative.dev/net-istio Releases Releasability Nightly
knative.dev/net-kourier Releases Releasability Nightly
knative.dev/net-gateway-api Releases Releasability Nightly
knative.dev/eventing Releases Releasability Nightly
knative.dev/sample-controller Releases Releasability Nightly

After eventing:

Repo Release Releasability Nightly
knative.dev/eventing-ceph Releases Releasability Nightly
knative.dev/eventing-kogito Releases Releasability Nightly
knative.dev/eventing-natss Releases Releasability Nightly
knative.dev/eventing-rabbitmq Releases Releasability Nightly
knative.dev/sample-source Releases Releasability Nightly

After both eventing and serving:

Repo Release Releasability Nightly
knative.dev/client Releases Releasability Nightly
knative.dev/eventing-kafka Releases Releasability Nightly
knative.dev/eventing-redis Releases Releasability Nightly
knative.dev/eventing-github Releases Releasability Nightly
knative.dev/eventing-gitlab Releases Releasability Nightly

Lastly:

Repo Release Releasability Nightly
knative.dev/eventing-kafka-broker Releases Releasability Nightly
knative.dev/eventing-autoscaler-keda Releases Releasability Nightly
knative.dev/kn-plugin-admin Releases Releasability Nightly
knative.dev/kn-plugin-event Releases Releasability Nightly
knative.dev/kn-plugin-source-kafka Releases Releasability Nightly
knative.dev/kn-plugin-source-kamelet Releases Releasability Nightly
knative.dev/kn-plugin-quickstart Releases Releasability Nightly

We have a few repos inside of Knative that are not handled in the standard process at the moment. They might have additional dependencies or depend on the releases existing. Skip these. Special cases are:

Repo Release Releasability Nightly
knative.dev/operator Releases Releasability Nightly
knative.dev/docs N/A N/A N/A

Post-release work

Homebrew updates

homebrew-client

After the client release, the Homebrew tap needs to be updated with the new release:

  • Copy kn.rb to the kn@${PREV_RELEASE}.rb with $PREV_RELEASE to be replace with the latest release (e.g. 0.19).
  • In kn@${PREV_RELEASE}.rb replace class Kn with class KnAT${PREV_RELEASE_DIGITS}, e.g class KnAT019 for an previous release 0.19.
  • In kn.rb
    • Replace the old version number in v with the released version (e.g. v = "v0.20.0")
    • Replace the sha256 checksums with the values from the client release page. The checksums have been released, too (e.g. checksums.txt)

Create a PR and merge the changes. Prow is not enabled for the homebrew repo, so the merge needs to be performed manually.

homebrew-kn-plugins

Similar to the client repo, the client plugin's Homebrew repo needs to be updated for the the plugins supported after their repos have successfully created a release.

Currently the following plugins are available with their own formulas:


Release a repository

Releasing a repository includes:

  • Aligning the knative.dev dependencies to the other release versions on main (except hack, which has no dependencies)
  • For some repositories some additional validation need to be performed before a release can be cut. Check special repository checks for which repository extra steps needs to be performed.
  • Creating a new branch starting from main for the release (e.g. release-0.20)
  • Execute the job on Prow that builds the code from the release branch, tags the revision, publishes the images, publishes the yaml artifacts and generates the Github release.

Most of the above steps are automated, although in some situations it might be necessary to perform some of them manually.

Check the build on main passes

Before beginning, check if the repository is in a good shape and the builds pass consistently. This is required because the Prow job that builds the release artifacts will execute all the various tests (build, unit, e2e) and, if something goes wrong, you will probably need to restart this process from the beginning.

For any problems in a specific repo, get in touch with the relevant WG leads to fix them.

Aligning the dependencies

In order to align the knative.dev dependencies, knobots will perform PRs like this for each repo, executing the command ./hack/update-deps.sh --upgrade --release 0.20 and committing all the content.

  • If no dependency bump PR is available, manually trigger the generation of these PRs starting the Knobots Auto Update Deps and wait for the PR to pop in the repo you need. Note you have to change the field If true, send update PRs even for deps changes that don't change vendor. Use this only for releases. to true, because in some cases there no code changes in the vendor.
  • Check the go.mod to ensure hashes point to commit hash at the head of the release branch of the dependency repo
    • For the support repos (hack, pkg, etc) you should see the dependency version pointing at a revision which should match the HEAD of the release branch. E.g. knative.dev/pkg v0.0.0-20210112143930-acbf2af596cf points at the revision acbf2af596cf, which is the HEAD of the release-0.20 branch in pkg repo.
    • For the release repos, you should see the dependency version pointing at the version tag. E.g. knative.dev/eventing v0.20.0 points at the tag v0.20.0 in the eventing repo.

Special repository actions

For some repositories some extra manual validation and updates need to be performed before the release branch is cut:

knative/client

  • Update the version numbers of Serving and Eventing in test/presubmit-integration-tests-latest-release.sh so that the integration test is already running against the just released serving and eventing versions.
  • (optional) Check that CHANGELOG.adoc contains a section about the release, i.e. the top-level "(Unreleased)" section should be changed to point to the upcoming release version and number. It's not critical if the changelog is aligned after the release in retrospective.

If the validation fails, the fix should be trivial and could be either performed by the release leads or the client team.

knative-sandbox/kn-plugin-quickstart

  • Update the version numbers of Serving / Kourier / Eventing in pkg/install/install.go so that the plugin will use the just-released versions.

Releasability

At this point, you can proceed with the releasability check. A releasability check is executed periodically and posts the result on the Slack release channel and it fails if the dependencies are not properly aligned. If you don't want to wait, you can manually execute the Releasability workflow.

If the releasability reports NO-GO, probably there is some deps misalignment, hence you need to go back to the previous step and check the dependencies, otherwise, you're ready to proceed.

If there are changes, then it's NO-GO, otherwise it's GO.

NOTE: The releasability check will not work on dot releases and there is a potential for false positives.

Cut the branch

Now you're ready to create the release-x.y branch. This can be done by using the GitHub UI:

  1. Click on the branch selection box at the top level page of the repository.

    Click the branch selection box

  2. Search for the correct release-x.y branch name for the release.

    Search for the expected release branch name

  3. Click "Create branch: release-x.y".

    Click create branch: release-x.y

Otherwise, you can do it by hand on your local machine.

The Prow job

After a release-x.y branch exists, a 4 hourly prow job will build the code from the release branch, tag the revision, publish the images, publish the yaml artifacts and generate the Github release. Update the description of the release with the release notes collected.

You can manually trigger the release:

  1. Navigate to https://prow.knative.dev/

    Prow homepage

  2. Search for the *-auto-release job for the repository.

    Search Prow for the repo and select the auto-release

  3. Rerun the auto-release job.

    Rerun Prow Auto Release

Verify nightly release automation is intact

The automation used to cut the actual releases is the very same as the automation used to cut nightly releases. Verify via testgrid that all relevant nightly releases are passing. If they are not coordinate with the relevant WG leads to fix them.

What could go wrong?

In case you cut a branch before it was ready (e.g. some deps misalignment, a failing test, etc), then follow the steps below:

  1. Mark the broken release as a pre-release
  2. Create a dot release
  3. Repeat the steps for a release for the new dot release