|
| 1 | +--- |
| 2 | +authors: Blake Devcich <blake.devcich@hpe.com> |
| 3 | +categories: release, repo |
| 4 | +--- |
| 5 | + |
| 6 | +# Releasing NNF Software |
| 7 | + |
| 8 | +## NNF Software Overview |
| 9 | + |
| 10 | +The following repositories comprise the NNF Software and each have their own versions. There is a |
| 11 | +hierarchy, since `nnf-deploy` packages the individual components together using submodules. |
| 12 | + |
| 13 | +Each component under `nnf-deploy` needs to be released first, then `nnf-deploy` can be updated to |
| 14 | +point to those release versions, then `nnf-deploy` itself can be updated and released. |
| 15 | + |
| 16 | +The documentation repo (NearNodeFlash/NearNodeFlash.github.io) is released separately and is not |
| 17 | +part of `nnf-deploy`, but it should match the version number of `nnf-deploy`. Release this like the |
| 18 | +other components. |
| 19 | + |
| 20 | +- [NearNodeFlash/nnf-deploy](https://github.com/NearNodeFlash/nnf-deploy) |
| 21 | + - [HewlettPackard/dws](https://github.com/HewlettPackard/dws) |
| 22 | + - [NearNodeFlash/lustre-fs-operator](https://github.com/NearNodeFlash/lustre-fs-operator) |
| 23 | + - [HewlettPackard/lustre-csi-driver](https://github.com/HewlettPackard/lustre-csi-driver) |
| 24 | + - [NearNodeFlash/nnf-mfu](https://github.com/NearNodeFlash/nnf-mfu) |
| 25 | + - [NearNodeFlash/nnf-sos](https://github.com/NearNodeFlash/nnf-sos) |
| 26 | + - [NearNodeFlash/nnf-dm](https://github.com/NearNodeFlash/nnf-dm) |
| 27 | +- [NearNodeFlash/NearNodeFlash.github.io](https://github.com/NearNodeFlash/NearNodeFlash.github.io) |
| 28 | + |
| 29 | +[nnf-ec](https://github.com/NearNodeFlash/nnf-ec) is vendored in as part of `nnf-sos` and does not |
| 30 | +need to be released separately. |
| 31 | + |
| 32 | +## Primer |
| 33 | + |
| 34 | +This document is based on the process set forth by the [DataWorkflowServices Release |
| 35 | +Process](https://dataworkflowservices.github.io/v0.0.1/repo-guides/create-a-release/readme/). |
| 36 | +Please read that as a background for this document before going any further. |
| 37 | + |
| 38 | +## Requirements |
| 39 | + |
| 40 | +To create tags and releases, you will need maintainer or admin rights on the repos. |
| 41 | + |
| 42 | +## Release Each Component In `nnf-deploy` |
| 43 | + |
| 44 | +You'll first need to create releases for each component contained in `nnf-deploy`. This section |
| 45 | +describes that process. |
| 46 | + |
| 47 | +Each release branch needs to be updated with what is on master. To do that, we'll need the latest |
| 48 | +copy of master, and it will ultimately be merged to the `releases/v0` branch via a Pull Request. |
| 49 | +Once merged, an annotated tag is created and then a release. |
| 50 | + |
| 51 | +Each component has its own version number that needs to be incremented. **Make sure you change the |
| 52 | +version numbers** in the commands below to match the new version for the component. The `v0.0.3` is |
| 53 | +just an example. |
| 54 | + |
| 55 | +1. Ensure your branches are up to date: |
| 56 | + |
| 57 | + ```shell |
| 58 | + git checkout master |
| 59 | + git pull |
| 60 | + git checkout releases/v0 |
| 61 | + git pull |
| 62 | + ``` |
| 63 | + |
| 64 | +2. Create a branch to merge into the release branch: |
| 65 | + |
| 66 | + ```shell |
| 67 | + git checkout -b release-v0.0.3 |
| 68 | + ``` |
| 69 | + |
| 70 | +3. Merge in the updates from the `master` branch. There **should not** be any conflicts, but it's |
| 71 | + not unheard of. Tread carefully if there are conflicts. |
| 72 | +
|
| 73 | + ```shell |
| 74 | + git merge master |
| 75 | + ``` |
| 76 | +
|
| 77 | +4. Verify that there are no differences between your branch and the master branch: |
| 78 | +
|
| 79 | + ```shell |
| 80 | + git diff master |
| 81 | + ``` |
| 82 | +
|
| 83 | + If there are any differences, they must be trivial. Some READMEs may have extra lines at the |
| 84 | + end. |
| 85 | +
|
| 86 | +5. For `lustre-csi-driver` and `lustre-fs-operator`, there are additional files that need to track |
| 87 | + the version number as well, which allow them to be installed with `kubectl apply -k`. |
| 88 | +
|
| 89 | + a. For `lustre-fs-operator`, update `config/manager/kustomization.yaml` with the correct |
| 90 | + version. |
| 91 | +
|
| 92 | + b. For `lustre-csi-driver`, update `deploy/kubernetes/base/kustomization.yaml` and |
| 93 | + `charts/lustre-csi-driver/values.yaml` with the correct version. |
| 94 | +
|
| 95 | +6. Create a Pull Request from your branch and **target the release branch**. When merging the Pull |
| 96 | +Request, **you must use a Merge Commit.** |
| 97 | +
|
| 98 | + !!! note |
| 99 | +
|
| 100 | + **Do not** Rebase or Squash! Those actions will remove the records that Git uses to determine which |
| 101 | + commits have been merged, and then when the next release is created Git will treat everything |
| 102 | + like a conflict. Additionally, this will cause auto-generated release notes to include the previous release. |
| 103 | +
|
| 104 | +7. Once merged, update the release branch locally and then create an annotated tag: |
| 105 | +
|
| 106 | + ```shell |
| 107 | + git checkout releases/v0 |
| 108 | + git tag -a v0.0.3 -m "Release v0.0.3" |
| 109 | + git push origin --tags |
| 110 | + ``` |
| 111 | +
|
| 112 | +8. Now that there is a tag, a release can be created via the [GitHub CLI](https://cli.github.com/). |
| 113 | + Alternatively, use the [Web UI](https://github.com/NearNodeFlash/nnf-dm/releases/new). |
| 114 | +
|
| 115 | + ```bash |
| 116 | + gh release create --generate-notes --verify-tag -p v0.0.3 -t "Release v0.0.3" |
| 117 | + ``` |
| 118 | +
|
| 119 | +9. Repeat this process for each remaining component. |
| 120 | +
|
| 121 | +## Release `nnf-deploy` |
| 122 | +
|
| 123 | +Once the individual components are released, we need to update the submodules and |
| 124 | +`config/repositories.yaml` in the **master** branch before we start on the release branch. This makes |
| 125 | +sure that everything is now current on master. |
| 126 | +
|
| 127 | +1. Update the submodules on master: |
| 128 | +
|
| 129 | + ```shell |
| 130 | + git checkout master |
| 131 | + git pull |
| 132 | + ./update.sh |
| 133 | + ``` |
| 134 | +
|
| 135 | +2. Update `config/repositories.yaml` and update the referenced versions for: |
| 136 | +
|
| 137 | + a. `lustre-csi-driver` |
| 138 | +
|
| 139 | + b. `lustre-fs-operator` |
| 140 | +
|
| 141 | + c. `nnf-mfu` |
| 142 | +
|
| 143 | +3. Commit the changes and open a Pull Request against the `master` branch. |
| 144 | +
|
| 145 | +4. Once merged, follow steps 1-3 from the previous section to update the release branch with master. |
| 146 | +
|
| 147 | +5. There will be conflicts on the submodules after step 3. This is expected. We will update the |
| 148 | + submodules to the new tags and then commit the changes. If each tag was committed properly, the |
| 149 | + following command can do this for you: |
| 150 | +
|
| 151 | + ```shell |
| 152 | + git submodule foreach 'git checkout `git describe --match="v*" HEAD`' |
| 153 | + ``` |
| 154 | +
|
| 155 | + Verify that each submodule is now at the proper tagged version. |
| 156 | +
|
| 157 | + ```shell |
| 158 | + git submodule status |
| 159 | + ``` |
| 160 | +
|
| 161 | +6. Do a `git add` for each of the submodules. |
| 162 | +
|
| 163 | +7. Run `go mod tidy` and then `make`. Do another `git add` for any changes, particularly`go.mod` and/or `go.sum`. |
| 164 | +
|
| 165 | +8. Verify that `git status` is happy with `nnf-deploy` and then finalize the merge from master by |
| 166 | + doing a `git commit`. |
| 167 | +
|
| 168 | +9. Follow steps 6-8 from the previous section to finalize the release of `nnf-deploy`. |
| 169 | +
|
| 170 | +The software is now released! |
0 commit comments