Skip to content

Commit e8a6fae

Browse files
authored
Merge pull request #2531 from rackerlabs/keystone-from-rackerlabs-fork
feat(keystone): build from rackerlabs/keystone understack branch
2 parents a54b962 + ed690d3 commit e8a6fae

3 files changed

Lines changed: 148 additions & 2 deletions

File tree

‎containers/keystone/Dockerfile‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
# syntax=docker/dockerfile:1
22

33
ARG OPENSTACK_VERSION="required_argument"
4-
FROM quay.io/airshipit/keystone:${OPENSTACK_VERSION}-ubuntu_noble
4+
FROM quay.io/airshipit/keystone:${OPENSTACK_VERSION}-ubuntu_noble AS build
5+
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
7+
8+
# renovate: name=openstack/keystone repo=https://github.com/rackerlabs/keystone.git branch=understack/2026.1
9+
ARG KEYSTONE_GIT_REF=f01950b7caf547970e961c076b74f6157b7bad84
10+
ADD --keep-git-dir=true https://github.com/rackerlabs/keystone.git#${KEYSTONE_GIT_REF} /src/keystone
11+
RUN git -C /src/keystone fetch --unshallow --tags
12+
13+
ARG OPENSTACK_VERSION="required_argument"
14+
ADD https://releases.openstack.org/constraints/upper/${OPENSTACK_VERSION} /upper-constraints.txt
15+
16+
RUN --mount=type=cache,target=/root/.cache/uv \
17+
uv pip install \
18+
--upgrade \
19+
--constraint /upper-constraints.txt \
20+
/src/keystone
21+
22+
ARG OPENSTACK_VERSION="required_argument"
23+
FROM quay.io/airshipit/keystone:${OPENSTACK_VERSION}-ubuntu_noble AS final
524

625
# renovate: datasource=github-releases depName=OpenIDC/mod_auth_openidc
726
ARG MOD_AUTH_OPENIDC_VERSION=2.4.16.11
@@ -12,3 +31,6 @@ RUN apt-get update && \
1231
apt-get install -y --no-install-recommends \
1332
/tmp/libapache2-mod-auth-openidc_${MOD_AUTH_OPENIDC_VERSION}-1.noble_amd64.deb \
1433
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*.deb
34+
35+
RUN rm -rf /var/lib/openstack
36+
COPY --from=build --link /var/lib/openstack /var/lib/openstack

‎containers/keystone/README.md‎

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Keystone Patches
2+
3+
Patches are derived from cherry-picking patches to the stable series we follow.
4+
5+
[https://github.com/rackerlabs/keystone]
6+
7+
The branch for these are `understack/$OPENSTACK_VERSION`
8+
9+
## To clone everything down do the following
10+
11+
```bash
12+
git clone https://github.com/openstack/keystone
13+
git checkout --track origin/stable/2026.1
14+
git remote add rackerlabs https://github.com/rackerlabs/keystone
15+
git fetch rackerlabs
16+
git checkout --track rackerlabs/understack/2026.1
17+
```
18+
19+
## Adding patches is done via `git cherry-pick`
20+
21+
```bash
22+
git checkout understack/2026.1
23+
git cherry-pick GITISH_TO_PORT
24+
git push rackerlabs understack/2026.1
25+
```
26+
27+
## Creating the next stable series
28+
29+
```bash
30+
git checkout --track origin/stable/2026.2
31+
git checkout -b understack/2026.2
32+
```
33+
34+
## Rebasing to keep things clean
35+
36+
The `scripts/git-understack-rebase` script in the understack repo automates this: it checks your
37+
remotes and branches, shows you the commits involved, performs the rebase, and force-pushes both
38+
branches to `rackerlabs` after you confirm each step. It expects a remote named `upstream`
39+
(pointing at `openstack/keystone`, not `origin`) and a remote named `rackerlabs`.
40+
41+
```bash
42+
scripts/git-understack-rebase ~/work/keystone 2026.1
43+
```
44+
45+
### Patches that landed upstream (possibly tweaked)
46+
47+
Before rebasing, the script checks whether any patch we carry has since landed
48+
in `upstream/stable/$VERSION`. It matches on the Gerrit `Change-Id:` trailer,
49+
which survives cherry-picking, so it recognizes our copy of a change even if the
50+
content drifted. It then splits the matches into two groups:
51+
52+
- **identical** — same content as upstream. `git rebase` drops these on its own;
53+
the script just tells you it happened.
54+
- **MODIFIED** — same `Change-Id` but the content differs. A patch that was
55+
cherry-picked and then tweaked (e.g. a reworded release note) before it merged
56+
upstream cannot be dropped by git via patch-id, so it conflicts on rebase.
57+
58+
For the MODIFIED group the script prompts you. The default is to **drop them and
59+
keep upstream's version** (done by scripting an interactive rebase to mark those
60+
commits `drop`). If you decline, they are replayed as-is and you resolve the
61+
conflicts by hand, preferring upstream. Either way you are told exactly which
62+
commits are involved before anything is rewritten.
63+
64+
To do it manually instead:
65+
66+
```bash
67+
git checkout stable/2026.1
68+
git pull -p
69+
git checkout understack/2026.1
70+
git rebase stable/2026.1
71+
git push rackerlabs understack/2026.1
72+
```
73+
74+
## Updating the container
75+
76+
```bash
77+
git checkout understack/2026.1
78+
git show
79+
# ensure KEYSTONE_GIT_REF in the Dockerfile matches
80+
```
81+
82+
## Backporting patches from upstream master
83+
84+
To backport a patch from upstream master (or another branch) to understack/2026.1:
85+
86+
```bash
87+
# Fetch all branches from upstream (openstack/keystone)
88+
# This fetches master, stable branches, and all other refs
89+
git fetch origin
90+
91+
# Fetch all branches from rackerlabs fork
92+
git fetch rackerlabs
93+
94+
# Checkout the understack branch
95+
git checkout understack/2026.1
96+
97+
# Cherry-pick the commit from master
98+
# You can get the commit hash from the PR or upstream repository
99+
git cherry-pick <UPSTREAM_COMMIT_HASH>
100+
101+
# If there are conflicts, resolve them:
102+
git add <conflicted-files>
103+
git cherry-pick --continue
104+
105+
# Push to rackerlabs fork
106+
git push rackerlabs understack/2026.1
107+
```
108+
109+
### Example workflow for a specific PR
110+
111+
Following the backporting workflow above results in a PR like https://github.com/rackerlabs/keystone/pull/XXX:
112+
113+
1. Find the commit hash from upstream master
114+
2. Cherry-pick it to the branch: `git cherry-pick <COMMIT_HASH>`
115+
3. Resolve any conflicts if needed
116+
4. Test the changes locally
117+
5. Push to the rackerlabs understack branch
118+
119+
### Note on patch sources
120+
121+
Patches can come from:
122+
- OpenStack upstream master branch (`openstack/keystone` - origin/master)
123+
- Other branches or forks that have fixes needed

‎docs/contributing/index.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ links open the current version on GitHub:
3333
| Go operators and CLIs | [understackctl][go-understackctl], [dexop][go-dexop], [nautobotop][go-nautobotop], [Ironic hardware exporter][go-ihe] |
3434
| Helm charts | [ArgoCD UnderStack chart][chart-argocd], [site workflows][chart-workflows] |
3535
| Ansible | [Playbooks and roles][ansible] |
36-
| Containers | [Ironic][container-ironic], [Nautobot][container-nautobot], [Neutron][container-neutron], [Nova][container-nova] |
36+
| Containers | [Ironic][container-ironic], [Keystone][container-keystone], [Nautobot][container-nautobot], [Neutron][container-neutron], [Nova][container-nova] |
3737
| End-to-end tests | [understack-tests][tests] |
3838

3939
Python packages use [uv](https://docs.astral.sh/uv/) with `pytest` and `ruff`;
@@ -75,6 +75,7 @@ Two things to know before you add a page:
7575
[chart-workflows]: https://github.com/rackerlabs/understack/blob/main/charts/site-workflows/README.md
7676
[ansible]: https://github.com/rackerlabs/understack/blob/main/ansible/README.md
7777
[container-ironic]: https://github.com/rackerlabs/understack/blob/main/containers/ironic/README.md
78+
[container-keystone]: https://github.com/rackerlabs/understack/blob/main/containers/keystone/README.md
7879
[container-nautobot]: https://github.com/rackerlabs/understack/blob/main/containers/nautobot/README.md
7980
[container-neutron]: https://github.com/rackerlabs/understack/blob/main/containers/neutron/README.md
8081
[container-nova]: https://github.com/rackerlabs/understack/blob/main/containers/nova/README.md

0 commit comments

Comments
 (0)