github.com/zhyoulun/cilium@v1.6.12/Documentation/contributing/release.rst (about) 1 .. only:: not (epub or latex or html) 2 3 WARNING: You are looking at unreleased Cilium documentation. 4 Please use the official rendered version released here: 5 http://docs.cilium.io 6 7 .. _release_management: 8 9 Release Management 10 ------------------ 11 12 This section describes the release cadence and all release related processes. 13 14 Release Cadence 15 ~~~~~~~~~~~~~~~ 16 17 Cilium schedules a minor release every 6 weeks. Each minor release is performed 18 by incrementing the ``Y`` in the version format ``X.Y.Z``. The group of 19 committers can decide to increment ``X`` instead to mark major milestones in 20 which case ``Y`` is reset to 0. 21 22 .. _stable_releases: 23 24 Stable releases 25 ~~~~~~~~~~~~~~~ 26 27 The committers can nominate PRs merged into master as required for backport 28 into the stable release branches. Upon necessity, stable releases are published 29 with the version ``X.Y.Z+1``. Stable releases are regularly released in high 30 frequency or on demand to address major incidents. 31 32 In order to guarantee stable production usage while maintaining a high release 33 cadence, the following stable releases will be maintained: 34 35 * Stable backports into the last two releases 36 * :ref:`lts` release for extended long term backport coverage 37 38 39 Backport criteria for X.Y.Z+n 40 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 41 42 Criteria for the inclusion into latest stable release branch, i.e. what goes 43 into ``v1.1.x`` before ``v1.2.0`` has been released: 44 45 - All bugfixes 46 47 Backport criteria for X.Y-1.Z 48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 49 50 Criteria for the inclusion into the stable release branch of the previous 51 release, i.e. what goes into ``v1.0.x``, before ``v1.2.0`` has been released: 52 53 - Security relevant fixes 54 - Major bugfixes relevant to the correct operation of Cilium 55 56 .. _lts: 57 58 LTS 59 ~~~ 60 61 The group of committers nominates a release to be a long term stable release. 62 Such releases are guaranteed to receive backports for major and security 63 relevant bugfixes. LTS releases will be declared end of life after 6 months. 64 The group of committers will nominate and start supporting a new LTS release 65 before the current LTS expires. If for some reason, no release can be declared 66 LTS before the current LTS release expires, the current LTS lifetime will be 67 extended. 68 69 Given the current 6 weeks release cadence, the development teams will aim at 70 declaring every 3rd release to be an LTS to guarantee enough time overlap 71 between LTS release. 72 73 Current LTS releases 74 ^^^^^^^^^^^^^^^^^^^^ 75 76 +----------------------+---------------------------+-----------------------+ 77 | Release | Original Release Date | Scheduled End of Life | 78 +======================+===========================+=======================+ 79 | 1.0 | 2018-04-24 | 2018-10-24 | 80 +----------------------+---------------------------+-----------------------+ 81 82 .. _generic_release_process: 83 84 Generic Release Process 85 ~~~~~~~~~~~~~~~~~~~~~~~ 86 87 This process applies to all releases other than minor releases, this includes: 88 89 * Stable releases 90 * Release candidates 91 92 If you intent to release a new minor release, see the 93 :ref:`minor_release_process` section instead. 94 95 .. note:: The following commands have been validated when ran in the VM 96 used in the Cilium development process. See :ref:`dev_env` for 97 detailed instructions about setting up said VM. 98 99 GitHub template process 100 ~~~~~~~~~~~~~~~~~~~~~~~ 101 102 #. File a `new release issue <https://github.com/cilium/cilium/issues/new?assignees=&labels=kind%2Frelease&template=release_template.md&title=vX.Y.Z+release>`_ 103 on GitHub, updating the title to reflect the version that will be released. 104 105 #. Follow the steps in the issue template to prepare the release. 106 107 Reference steps for the template 108 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 109 110 #. Ensure that the necessary backports have been completed and merged. See 111 :ref:`backport_process`. 112 113 #. Update GitHub project and create ``vX.Y.Z+1`` project if applicable. 114 #. Update PRs / issues that were added to the ``vX.Y.Z`` project, but didn't 115 make it into this release into the ``vX.Y.Z+1`` project. 116 117 #. Create a new project named "X.Y.Z+1" to automatically track the backports 118 for that particular release. `Direct Link: <https://github.com/cilium/cilium/projects/new>`_ 119 120 #. Checkout the desired stable branch and pull it: 121 122 :: 123 124 git checkout v1.0; git pull 125 126 #. Run the release preparation script: 127 128 :: 129 130 contrib/release/start-release.sh 131 132 .. note:: 133 134 Check to see if the ``AUTHORS`` file has any formatting errors (for 135 instance, indentation mismatches) as well as duplicate contributor 136 names, and correct them accordingly. 137 138 #. Update the ``cilium_version`` and ``cilium_tag`` variables in 139 ``examples/getting-started/Vagrantfile`` 140 141 #. Add all modified files using ``git add`` and create a pull request with the 142 title ``Prepare for release v1.0.3``. 143 144 #. Prepare a pull request for the changes: 145 146 :: 147 148 contrib/release/submit-release.sh 149 150 #. Follow standard procedures to get the aforementioned PR merged into the 151 desired stable branch. See :ref:`submit_pr` for more information about this 152 process. 153 154 #. Checkout out the stable branch and pull your merged changes: 155 156 :: 157 158 git checkout v1.0; git pull 159 160 #. Create and push release tags to GitHub: 161 162 :: 163 164 contrib/release/tag-release.sh 165 166 .. note:: 167 168 There are two tags that correspond to the same release because GitHub 169 recommends using ``vx.y.z`` for release version formatting, and ReadTheDocs, 170 which hosts the Cilium documentation, requires the version to be in format 171 ``x.y.z`` For more information about how ReadTheDocs does versioning, you can 172 read their `Versions Documentation <https://docs.readthedocs.io/en/latest/versions.html>`_. 173 174 #. Wait for DockerHub to prepare all docker images. 175 176 #. `Publish a GitHub release <https://github.com/cilium/cilium/releases/>`_: 177 178 Following the steps above, the release draft will already be prepared. 179 Preview the description and then publish the release. 180 181 #. Prepare Helm changes for the release using the `Cilium Helm Charts Repository <https://github.com/cilium/charts/>`_ 182 and push the changes into that repository (not the main cilium repository): 183 184 :: 185 186 ./prepare_artifacts.sh /path/to/cilium/repository/checked/out/to/release/commit 187 git push 188 189 #. Prepare Helm changes for the dev version of the branch using the `Cilium Helm Charts Repository <https://github.com/cilium/charts/>`_ 190 for the vX.Y helm charts, and push the changes into that repository (not the main cilium repository): 191 192 In the ``cilium/cilium`` repository: 193 194 #. ``git checkout vx.y -b vx.z-dev`` 195 #. Change the ``VERSION`` file to ``x.y-dev`` 196 #. Run ``make -C install/kubernetes`` 197 198 In the ``cilium/charts`` repository: 199 200 :: 201 202 ./prepare_artifacts.sh /path/to/cilium/repository/checked/out/to/release/commit 203 git push 204 205 After pushing you can revert all the changes made in the local branch 206 ``x.y-dev`` from ``cilium/cilium``. 207 208 209 #. Announce the release in the ``#general`` channel on Slack. Sample text: 210 211 :: 212 213 :cilium-new: **Announcement:** Cilium vX.Y.Z has been released :tada: 214 215 <If security release or major bugfix, short summary of fix here> 216 217 For more details, see the release notes: 218 https://github.com/cilium/cilium/releases/tag/vX.Y.Z 219 220 #. Create a new git branch based on the master branch to update ``README.rst``: 221 222 :: 223 224 git checkout -b pr/bump-readme-vX.Y.Z origin/master 225 contrib/release/bump-readme.sh 226 # (Commit changes & submit PR) 227 228 #. Bump the version of Cilium used in the Cilium upgrade tests to use the new release 229 230 Please reach out on the ``#development`` channel on Slack for assistance with 231 this task. 232 233 #. Update the ``stable`` tags for ``cilium``, ``cilium-operator``, 234 ``cilium-operator-aws``, ``cilium-operator-azure``, 235 ``cilium-operator-generic``, ``cilium-docker-plugin`` and ``hubble-relay`` 236 on DockerHub, for the latest version of Cilium. For example, if the latest 237 version is ``1.8``, then for all patch releases on the ``1.8`` line, this 238 step should be performed. Once ``1.9`` is out for example, then this is no 239 longer required for ``1.8``. 240 241 **Note**, the DockerHub UI will not allow you to modify the ``stable`` tag 242 directly. You will need to delete it, and then create a new, updated one. 243 244 #. Update the following external tools and guides to point to the released 245 Cilium version. This step is only required on a new minor release like going 246 from ``1.8`` to ``1.9``. 247 248 * `kubeadm <https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/>`_ 249 * `kops <https://github.com/kubernetes/kops/>`_ 250 * `kubespray <https://github.com/kubernetes-sigs/kubespray/>`_ 251 252 .. _minor_release_process: 253 254 Minor Release Process 255 ~~~~~~~~~~~~~~~~~~~~~ 256 257 On Freeze date 258 ^^^^^^^^^^^^^^ 259 260 #. Fork a new release branch from master: 261 262 :: 263 264 git checkout master; git pull 265 git checkout -b v1.2 266 git push 267 268 #. Protect the branch using the GitHub UI to disallow direct push and require 269 merging via PRs with proper reviews. 270 271 #. Replace the contents of the ``CODEOWNERS`` file with the following to reduce 272 code reviews to essential approvals: 273 274 :: 275 276 * @cilium/janitors 277 api/ @cilium/api 278 pkg/apisocket/ @cilium/api 279 pkg/monitor/payload @cilium/api 280 pkg/policy/api/ @cilium/api 281 pkg/proxy/accesslog @cilium/api 282 283 #. Commit changes, open a pull request against the new ``v1.2`` branch, and get 284 the pull request merged 285 286 :: 287 288 git checkout -b pr/prepare-v1.2 289 git add [...] 290 git commit 291 git push 292 293 #. Follow the :ref:`generic_release_process` to release ``v1.2.0-rc1``. 294 295 #. Create the following GitHub labels: 296 297 #. ``backport-pending/1.2`` 298 #. ``backport-done/1.2`` 299 #. ``backport/1.2`` 300 #. ``needs-backport/1.2`` 301 302 #. Prepare the master branch for the next development cycle: 303 304 :: 305 306 git checkout master; git pull 307 308 #. Update the ``VERSION`` file to contain ``v1.2.90`` 309 #. Add the ``VERSION`` file using ``git add`` and create & merge a PR titled 310 ``Prepare for 1.3.0 development``. 311 #. Update the release branch on 312 `Jenkins <https://jenkins.cilium.io/job/cilium-ginkgo/job/cilium/>`_ to be 313 tested on every change and Nightly. 314 #. (Only 1.0 minor releases) Tag newest 1.0.x Docker image as ``v1.0-stable`` 315 and push it to Docker Hub. This will ensure that Kops uses latest 1.0 release by default. 316 317 318 319 For the final release 320 ^^^^^^^^^^^^^^^^^^^^^ 321 322 #. Follow the :ref:`generic_release_process` to create the final replace and replace 323 ``X.Y.0-rcX`` with ``X.Y.0``. 324 325 .. _backport_process: 326 327 Backporting process 328 ~~~~~~~~~~~~~~~~~~~ 329 330 Cilium PRs that are marked with the label ``needs-backport/X.Y`` need to be 331 backported to the stable branch ``X.Y``. The following steps summarize 332 the process for backporting these PRs. 333 334 1. Make sure the Github labels are up-to-date, as this process will 335 deal with all commits from PRs that have the ``needs-backport/X.Y`` label 336 set (for a stable release version X.Y). If any PRs contain labels such as 337 ``backport-pending/X.Y``, ensure that the backport for that PR have been 338 merged and if so, change the label to ``backport-done/X.Y``. 339 340 2. The scripts referred to below need to be run in Linux, they do not 341 work on OSX. You can use the cilium dev VM for this, but you need 342 to configure git to have your name and email address to be used in 343 the commit messages: 344 345 .. code-block:: bash 346 347 $ git config --global user.name "John Doe" 348 $ git config --global user.email johndoe@example.com 349 350 3. Make sure you have your a GitHub developer access token 351 available. For details, see `contrib/backporting/README.md 352 <https://github.com/cilium/cilium/blob/master/contrib/backporting/README.md>`_ 353 4. Fetch the repo, e.g., ``git fetch`` 354 5. Check a new branch for your backports based on the stable branch for that 355 version, e.g., ``git checkout -b pr/v1.0-backport-YY-MM-DD origin/v1.0`` 356 6. Run the ``check-stable`` script, referring to your Github access 357 token, this will list the commits that need backporting, from the 358 newest to oldest: 359 360 .. code-block:: bash 361 362 $ GITHUB_TOKEN=xxx contrib/backporting/check-stable 1.0 363 364 .. note:: 365 ``contrib/backporting/check-stable`` accepts a second argument to 366 specify a path to write a nicely-formatted pull request message to. 367 This can be used alongside 368 `Github command-line tools <https://github.com/node-gh/gh>`__ to 369 send the pull request from the command line in steps 9-10 via 370 ``gh pull-request -b vX.Y -l backport/vX.Y -F <path>``. 371 372 7. Cherry-pick the commits using the master git SHAs listed, starting 373 from the oldest (bottom), working your way up and fixing any merge 374 conflicts as they appear. Note that for PRs that have multiple 375 commits you will want to check that you are cherry-picking oldest 376 commits first. The ``cherry-pick`` script accepts multiple arguments, 377 in which case it will attempt to apply each commit in the order 378 specified on the command line until one cherry pick fails or every 379 commit is cherry-picked. 380 381 .. code-block:: bash 382 383 $ contrib/backporting/cherry-pick <oldest-commit-sha> 384 ... 385 $ contrib/backporting/cherry-pick <newest-commit-sha> 386 387 8. Push your backports branch to cilium repo, e.g., ``git push -u origin pr/v1.0-backports-YY-MM-DD`` 388 9. In Github, create a new PR from your branch towards the feature 389 branch you are backporting to. Note that by default Github creates 390 PRs against the master branch, so you will need to change it. 391 10. Label the new backport PR with the backport label for the stable branch 392 such as ``backport/X.Y`` so that it is easy to find backport PRs later. 393 11. Mark all PRs you backported with the backport pending label ``backport-pending/X.Y`` 394 and clear the ``needs-backport/vX.Y`` label. This can be via the GitHub 395 interface, or using the backport script ``contrib/backporting/set-labels.py``, e.g.: 396 397 .. code-block:: bash 398 399 # Set PR 1234's v1.0 backporting labels to pending 400 $ contrib/backporting/set-labels.py 1234 pending 1.0 401 402 .. note:: 403 404 ``contrib/backporting/set-labels.py`` requires Python 3 and 405 `PyGithub <https://pypi.org/project/PyGithub/>`_ installed. 406 407 12. After the backport PR is merged, mark all backported PRs with 408 ``backport-done/X.Y`` label and clear the ``backport-pending/X.Y`` label(s). 409 410 .. code-block:: bash 411 412 # Set PR 1234's v1.0 backporting labels to done 413 contrib/backporting/set-labels.py 1234 done 1.0.