Skip to content

Commit 2b65dae

Browse files
chaenchrisburrfstagnialdbr
authored
docs: document the release process (#728)
* docs: document the release process --------- Co-authored-by: Chris Burr <christopher.burr@cern.ch> Co-authored-by: Federico Stagni <federico.stagni@cern.ch> Co-authored-by: aldbr <aldbr@outlook.com>
1 parent ed3d934 commit 2b65dae

8 files changed

Lines changed: 242 additions & 5 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
- 'v*'
77
pull_request:
88
paths-ignore:
9-
- 'CHANGELOG.md'
9+
- '**.md'
10+
- 'docs/**'
11+
- 'mkdocs.yml'
1012
schedule:
1113
- cron: '0 10 * * *'
1214

.github/workflows/integration.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'docs/**'
10+
- 'mkdocs.yml'
711
pull_request:
812
branches:
913
- main
1014
paths-ignore:
11-
- 'CHANGELOG.md'
15+
- '**.md'
16+
- 'docs/**'
17+
- 'mkdocs.yml'
1218

1319
defaults:
1420
run:

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ on:
44
push:
55
branches:
66
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'docs/**'
10+
- 'mkdocs.yml'
711
pull_request:
812
branches:
913
- main
1014
paths-ignore:
11-
- 'CHANGELOG.md'
15+
- '**.md'
16+
- 'docs/**'
17+
- 'mkdocs.yml'
1218

1319
concurrency:
1420
group: ${{ github.workflow }}-${{ github.ref }}

docs/admin/how-to/install/register-a-vo.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Registering a VO means allowing users of a specific Virtual Organization to use DiracX services. In practice, this can be done once an external IdP is used for managing such VO.
44
By default all VOs managed by a DIRAC/DiracX instance are already "registered" (or "enabled", in other words). There is anyway the possibility to "Disable" VOs by filling the option `DiracX > DisabledVOs` with the list of VOs that can not use DiracX:
55

6-
````
76
??? example "Configuration example"
87

98
```yaml
@@ -12,7 +11,6 @@ By default all VOs managed by a DIRAC/DiracX instance are already "registered" (
1211
DisabledVOs = vo_x, vo_y
1312
}
1413
```
15-
````
1614

1715
## Prerequisites
1816

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
This page describes how to mechanically make releases of DiracX and extensions. See the [reference](../reference/making-releases.md) documentation for more details about how releases are made.
2+
3+
# How to make a new DiracX release
4+
5+
Execute the following points in the presented order.
6+
7+
1. Find the `release-please` [pull request](https://github.com/DIRACGrid/diracx/pulls?q=is%3Apr+is%3Aopen+%22chore%28main%29%3A+release%22) for your release. If you can't find it, it means that the currently existing latest release includes already all code changes.
8+
9+
2. Review the release number **and** the content of the changelog
10+
11+
- If you need to change the release number, follow the [ `release-please` doc](https://github.com/googleapis/release-please?tab=readme-ov-file#how-do-i-change-the-version-number)
12+
13+
```bash
14+
git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: v0.0.3"
15+
git push upstream HEAD:main
16+
```
17+
18+
- If you want to update the release notes manually, follow the [`release-please` doc](https://github.com/googleapis/release-please?tab=readme-ov-file#how-can-i-fix-release-notes)
19+
20+
3. Merge the `release-please` PR
21+
22+
4. Check the [deployment action](https://github.com/DIRACGrid/diracx/actions/workflows/deployment.yml?query=event%3Apush+actor%3ADIRACGridBot)
23+
24+
5. When the above will be finished, check that the [CI](https://github.com/DIRACGrid/diracx-charts/actions/workflows/chart-ci.yml?query=actor%3ADIRACGridBot) in `diracx-charts` is successful
25+
26+
At this stage, there is a new `diracx` and `diracx-chart` release.
27+
28+
# How to make a new DiracX-Web release
29+
30+
Execute the following points in the presented order.
31+
32+
1. Find the `release-please` [pull request](https://github.com/DIRACGrid/diracx-web/pulls?q=is%3Apr+is%3Aopen+%22chore%28main%29%3A+release%22) for your release. If you can't find it, it means that the currently existing latest release includes already all code changes.
33+
34+
2. Review the release number **and** the content of the changelog
35+
36+
- If you need to change the release number, follow the [`release-please` doc](https://github.com/googleapis/release-please?tab=readme-ov-file#how-do-i-change-the-version-number)
37+
38+
```bash
39+
git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: v0.0.3"
40+
git push upstream HEAD:main
41+
```
42+
43+
- If you want to update the release notes manually, follow the [`release-please` doc](https://github.com/googleapis/release-please?tab=readme-ov-file#how-can-i-fix-release-notes)
44+
45+
3. Merge the `release-please` PR
46+
47+
4. Check the [deployment action](https://github.com/DIRACGrid/diracx-web/actions/workflows/deployment.yml?query=event%3Apush)
48+
49+
5. When the above is finished, check that the [CI](https://github.com/DIRACGrid/diracx-charts/actions/workflows/chart-ci.yml) in `diracx-charts` is successful
50+
51+
At this stage, there is a new `diracx-web` release and `diracx-chart` release.
52+
53+
## Making the extension release
54+
55+
Making a release of an extension depends on how the extension has been set up. Below are recommended workflows:
56+
57+
=== "Generic GitLab"
58+
59+
1. Ensure any desired merge requests have been merged.
60+
2. Ensure the `pyproject.toml` contains the desired DiracX dependency
61+
- If it does not, run the pipeline schedule to run renovate, which should trigger a merge request to update the version.
62+
- Merge the renovate-generated MR.
63+
3. Create tag (and optionally [release](<>)) for your extension
64+
4. Updates to extension's "charts" repo will be pushed automatically or via merge requests depending on your setup.
65+
66+
=== "LHCb"
67+
68+
- The LHCb installation follows the "Generic GitLab" workflow.
69+
- The renovate job runs every Monday at 22:10 UTC. It can be manually triggered [here](https://gitlab.cern.ch/lhcb-dirac/lhcbdiracx/-/pipeline_schedules).
70+
- The LHCb certification set up is updated automatically, see [here](https://gitlab.cern.ch/lhcb-dirac/lhcbdiracx-charts/-/pipelines?page=1&scope=all&ref=lhcbdiracx-cert) for the pipelines.
71+
- The LHCb production setup is deployed automatically when the associated merge request is merged. See [here](https://gitlab.cern.ch/lhcb-dirac/lhcbdiracx-charts/-/merge_requests/?sort=created_date&state=opened&author_username=project_217407_bot_a1f6511ecbeab04354572cf37500b0a3&first_page_size=20) for the pending updates.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Making and deploying releases
2+
3+
!!! warning "Version compatibility"
4+
5+
DiracX should be upgraded before upgrading legacy DIRAC installations.
6+
7+
The versioning of `DIRAC`, `DIRACCommon`, `diracx`, `diracx-charts` and all the extensions are linked to one another.
8+
9+
## Dependencies between diracx, DIRAC and DIRACCommon
10+
11+
Both `DIRAC` and `diracx` depend on `DIRACCommon`. However, `DIRACCommon` is in the same repository as `DIRAC`, and versioned together. This means that if we need to move code from `DIRAC` to `DIRACCommon` such that it is usable by `diracx`, we need first a new release of `DIRAC` and `DIRACCommon` just moving the code, before being able to use it in `diracx`.
12+
13+
The releases of `DIRAC` and `DIRACCommon` are managed as they have always been, and are described in the `DIRAC` documentation
14+
15+
## Dependencies between diracx and diracx-charts
16+
17+
`diracx-charts` has a version number, as well as an `appversion`, which corresponds to the `diracx` version. This means that a new release of `diracx` requires a new `diracx-charts` release, which will update:
18+
19+
- the diracx-charts version
20+
- the AppVersion
21+
- the container versions
22+
23+
The `update-charts` [CI job](https://github.com/DIRACGrid/diracx/blob/e552651ac682e7461bc338856d295b0651ec2a26/.github/workflows/deployment.yml#L168) in `diracx` pushes a new commit in `diracx-charts`, which results in a new `diracx-charts` release.
24+
25+
## Dependencies between diracx, diracx-web and diracx-charts
26+
27+
The `diracx-web` version is only very loosely coupled with the `diracx` version.
28+
A new `diracx-web` release will trigger a new `diracx-charts` updating:
29+
30+
- the chart version
31+
- the container versions
32+
- NOT the AppVersion
33+
34+
It does not bump the AppVersion because it refers to the `diracx` version, which is more relevant.
35+
36+
```mermaid
37+
flowchart LR
38+
subgraph diracx-block["diracx"]
39+
diracx-charts("diracx-charts")
40+
diracx("diracx")
41+
diracx-web("diracx-web")
42+
end
43+
44+
45+
diracx -->|commit| diracx-charts
46+
diracx-web -->|commit| diracx-charts
47+
48+
linkStyle 0 stroke: blue
49+
linkStyle 1 stroke: blue
50+
51+
```
52+
53+
## diracx release
54+
55+
Releases are managed by `ReleasePlease`. The token used to perform it belongs to `DIRACGridBot` github user.
56+
57+
!!! info "Why a bot token?"
58+
59+
`GITHUB_TOKEN` cannot trigger downstream workflows (GitHub's anti-loop protection). Using a bot PAT ensures that the tag created by `release-please` triggers the deployment and chart update jobs.
60+
61+
A new release creates:
62+
63+
- a [github release](https://github.com/DIRACGrid/diracx/releases)
64+
- a [pypi release](https://pypi.org/project/diracx/)
65+
- new [docker images](https://github.com/DIRACGrid/diracx/)
66+
67+
### Force version number
68+
69+
You can force a specific version number following the [doc](https://github.com/googleapis/release-please?tab=readme-ov-file#how-do-i-change-the-version-number)
70+
71+
```bash
72+
git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: v0.0.3"
73+
git push upstream HEAD:main
74+
```
75+
76+
## diracx-web release
77+
78+
Releases are managed by `ReleasePlease`. The token used to perform it belongs to `DIRACGridBot` github user, same as `diracx`.
79+
80+
!!! info "Why a bot token?"
81+
82+
`GITHUB_TOKEN` cannot trigger downstream workflows (GitHub's anti-loop protection). Using a bot PAT ensures that the tag created by `release-please` triggers the deployment and chart update jobs.
83+
84+
A new release creates:
85+
86+
- a [github release](https://github.com/DIRACGrid/diracx-web/releases)
87+
- an [npm release](https://www.npmjs.com/package/@dirac-grid/diracx-web-components) for `diracx-web-components`
88+
- new [docker images](https://github.com/DIRACGrid/diracx-web/)
89+
- updated [Storybook documentation](https://diracgrid.github.io/diracx-web/) on GitHub Pages
90+
91+
## diracx-charts releases
92+
93+
Every commit in master triggers a new release. The releases are published on a [helm repo](https://charts.diracgrid.org/index.yaml)

docs/dev/explanations/extensions.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ For most components you can extend them in isolation without needing to have an
3535

3636
The exception to this is when extending `diracx-routers` you MUST also extend `diracx-client` and your client extension MUST be regenerated for every DiracX release.
3737
More details about this can be found in the [dedicated how to](../how-to/client-extension.md).
38+
3839
Additionally, you will need an umbrella helm chart for your extension.
3940

4041
## Gubbins
@@ -225,3 +226,61 @@ Note that even if you have your own `testing` package depending on `diracx-testi
225226
## `Dockerfile`
226227

227228
`extensions/gubbins/containers/Dockerfile` contains an example of `Dockerfile` for extensions.
229+
230+
## Extension chart
231+
232+
Although you could simply replace the docker images used in the `diracx-charts` by your own, having the umbrella extension is strongly recommended. The reason is that you will be able to properly manage your release cycle and manage proper dependencies, `AppVersion` corresponding to your app, etc.
233+
234+
Note that your `value.yaml` needs an extra `diracx` layer:
235+
236+
```yaml
237+
diracx:
238+
diracx:
239+
settings:
240+
DIRACX_CONFIG_BACKEND_URL: "some github url"
241+
```
242+
243+
## Repository setup
244+
245+
How the repositories are setup is very extension specific and flexible. Here we describe one possible set up.
246+
247+
This setup works by having one GitLab repository for you extension's code and a separate GitLab repository for an extension to `diracx-charts`. One or more installations are then managed via the GitLab CI of `<extension>-charts`. Updating the DiracX dependency of `<extension>` is handled via [`renovate`](https://github.com/renovatebot/renovate). `Renovate` should be configured to update the `pyproject.toml` and the `dockerfile` (see [lhcb configuration](https://gitlab.cern.ch/lhcb-dirac/lhcbdiracx/-/blob/master/renovate.json)) Updating the `<extension>-charts` repository is handled by the GitLab CI job of `<extension>` whenever a Git tag is created.
248+
249+
A new extension release should trigger a release of your extension chart. (See `deploy-chart` job in [lhcb ci config](https://gitlab.cern.ch/lhcb-dirac/lhcbdiracx/-/blob/master/.gitlab-ci.yml))
250+
In this case, a new extension-chart release means updating:
251+
252+
- the chart version
253+
- the AppVersion
254+
- the containers versions
255+
- the diracx-charts version to the latest compatible with the diracx version required by lhcbdiracx
256+
257+
```mermaid
258+
flowchart LR
259+
subgraph diracx-block["diracx"]
260+
diracx-charts("diracx-charts")
261+
diracx("diracx")
262+
diracx-web("diracx-web")
263+
end
264+
265+
subgraph extension-block["extension"]
266+
extension("extension")
267+
extension-web("extension-web")
268+
extension-charts("extension-charts")
269+
end
270+
271+
272+
diracx -->|commit| diracx-charts
273+
diracx-web -->|commit| diracx-charts
274+
275+
diracx -->|renovate| extension
276+
diracx-web -->|renovate| extension-web
277+
extension -->|commit and bump diracx-charts| extension-charts
278+
extension-web -->|commit| extension-charts
279+
280+
linkStyle 0 stroke: blue
281+
linkStyle 1 stroke: blue
282+
linkStyle 2 stroke: red
283+
linkStyle 3 stroke: red
284+
linkStyle 4 stroke: blue
285+
linkStyle 5 stroke: blue
286+
```

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ nav:
9292
- Debugging: admin/how-to/debugging.md
9393
- Upgrading: admin/how-to/upgrading.md
9494
- Rotate a secret: admin/how-to/rotate-a-secret.md
95+
- Make a release: admin/how-to/make-a-release.md
9596
- Explanations:
9697
- admin/explanations/index.md
9798
- Auth in DiracX: admin/explanations/auth-with-diracx.md
@@ -111,6 +112,7 @@ nav:
111112
- Security Model: admin/reference/security_model.md
112113
- Settings and Preferences: admin/reference/settings-and-preferences.md
113114
- Environment variables: admin/reference/env-variables.md
115+
- Making and deploying releases: admin/reference/making-releases.md
114116
- Charts values: admin/reference/values.md
115117
- RUN_PROD.md
116118
- SSO.md

0 commit comments

Comments
 (0)