ajay | b3f4098 | 2021-12-08 14:26:11 -0800 | [diff] [blame] | 1 | .. |
| 2 | SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 3 | SPDX-License-Identifier: Apache-2.0 |
| 4 | |
Zack Williams | ccaa38a | 2021-11-16 15:36:05 -0700 | [diff] [blame] | 5 | Release Process |
| 6 | =============== |
| 7 | |
| 8 | Prerequisites |
| 9 | ------------- |
| 10 | |
| 11 | SD-Core makes the following assumptions about the components are included in a |
| 12 | release: |
| 13 | |
| 14 | Git tags |
| 15 | """""""" |
| 16 | |
| 17 | Code receives Git tags as a part of the CI process |
| 18 | |
| 19 | * Tag content comes from a **VERSION** file within the repo, and tags are |
| 20 | created only the version is a SemVer released version (example: ``1.2.3``, no |
| 21 | ``-dev`` or ``-rc`` extensions) |
| 22 | |
| 23 | * Tagging is *only done by the CI system* (Jenkins), which pushes tags to git |
| 24 | repos after a submit/merge of code which changes the **VERSION** file. |
| 25 | |
| 26 | * CI system enforces tag uniqueness - no two commits have the same released |
| 27 | version tags. |
| 28 | |
| 29 | * You can't re-release or "fix" a version that has problem - make a new |
| 30 | version with fixes in it. |
| 31 | |
| 32 | Docker container images |
| 33 | """"""""""""""""""""""" |
| 34 | |
| 35 | All docker images are tagged based on their git tags. |
| 36 | |
| 37 | * For released versions, the CI system should prevent a Dockerfile from |
| 38 | referencing a parent containers that are a moving target, such as ``latest`` |
| 39 | or ``master``. |
| 40 | |
| 41 | * This allows a container to be rebuilt given an arbitrary git commit with |
| 42 | fair confidence that it will result in the same code in the container. |
| 43 | |
| 44 | * Official images are only pushed to registries by the CI system |
| 45 | |
| 46 | * Increases repeatability of the process, and prevents human accidents. |
| 47 | |
| 48 | Helm charts |
| 49 | """"""""""" |
| 50 | |
| 51 | * Each chart may only contain references to released, SemVer tagged container images |
| 52 | |
| 53 | * Chart CI process must check that a chart version is unique - a chart can't |
| 54 | be created with the same version twice. This should be done against the |
| 55 | chart repo. |
| 56 | |
| 57 | Release Steps |
| 58 | ------------- |
| 59 | |
| 60 | All Helm charts are checked that the containers they use have a SemVer version |
| 61 | tag |
| 62 | |
| 63 | A branch is created on the Helm charts repo, with the abbreviated name of the |
| 64 | release - for example **sdcore-1.0**. |
| 65 | |
| 66 | To allow for future patches to go into the repo in a way that does not conflict |
| 67 | with the version branch, each component repo's **VERSION** file should have it's |
| 68 | minor version increased. (ex: 1.2.n to 1.3.0-dev, so future 1.3.n+1 component |
| 69 | release can easily be created). |
| 70 | |
| 71 | The same should be done on Helm charts in the chart repos post release, but the |
ajay | 2c0f6f4 | 2021-12-02 22:45:19 -0800 | [diff] [blame] | 72 | versions there should not include a ``-dev`` suffix because chart publishing |
Zack Williams | ccaa38a | 2021-11-16 15:36:05 -0700 | [diff] [blame] | 73 | requires that every new chart version be unique and unsuffixed SemVer is a |
| 74 | more consistent release numbering pattern. |
| 75 | |
| 76 | Finally, the ``sdcore-helm-charts`` repo overall **VERSION** should also be incremented |
| 77 | to the next minor version (1.6.0-dev) on the **master** branch, so all 1.0.x |
| 78 | releases of the overall charts repo will happen on the **sdcore-1.0** branch. |
| 79 | |
| 80 | Creating releases on the 1.0.x branch |
| 81 | """"""""""""""""""""""""""""""""""""" |
| 82 | |
| 83 | If a fix is needed only to the helm charts: |
| 84 | |
| 85 | 1. Make the fix on the master branch of sdcore-helm-charts (assuming that it is |
| 86 | required in both places). |
| 87 | |
| 88 | 2. After the master tests pass, manually cherry-pick the fix to the **sdcore-1.0** |
| 89 | branch (the Chart version would be different, requiring the manual step). |
| 90 | |
| 91 | 3. Cherry-picked patchsets on that branch will be checked by the **sdcore-1.0** |
| 92 | branch of tests. |
| 93 | |
| 94 | 4. When it passes, submitting the change will make a new 1.0.x release |
| 95 | |
| 96 | 5. Update the documentation to reflect the chart changes, a description of the |
| 97 | changes m, and increment the tag on the docs from 1.0.n to 1.0.n+1, to |
| 98 | reflect the patch change. |
| 99 | |
| 100 | 6. If all the charts are updated and working correctly, create a new charts |
| 101 | point release by increasing the 1.0.n **VERSION** file in the |
| 102 | sdcore-helm-charts repo. This should be the same as the version in the |
| 103 | documentation. Immediately make another patch that returns the |
| 104 | ``sdcore-helm-charts`` **VERSION** to 1.0.n+1-dev, so that development |
| 105 | patches can continue on that branch. |
| 106 | |
| 107 | If a fix is needed to the components/containers that are included by the helm charts: |
| 108 | |
| 109 | 1. Develop a fix to the issue on the master branch, get it approved after |
| 110 | passing master tests. |
| 111 | |
ajay | 2c0f6f4 | 2021-12-02 22:45:19 -0800 | [diff] [blame] | 112 | 2. If it does not exist, create an **sdcore-1.0** branch on the component repo, |
Zack Williams | ccaa38a | 2021-11-16 15:36:05 -0700 | [diff] [blame] | 113 | starting at the commit where the **VERSION** of the component used in 1.0 was |
| 114 | created - this is known as "lazy branching". |
| 115 | |
| 116 | |
ajay | 60fd69f | 2021-11-23 22:38:10 -0800 | [diff] [blame] | 117 | 3. Manually cherry-pick to the **sdcore-1.0** branch of the component, increment |
Zack Williams | ccaa38a | 2021-11-16 15:36:05 -0700 | [diff] [blame] | 118 | the patch version, and test with the **sdcore-1.0** version of |
| 119 | sdcore-system-tests and helm charts. |
| 120 | |
| 121 | 4. Update helm charts and go through the helm chart update process above |
| 122 | |