You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: replace container base images with pixi-managed environments
Move container builds from the multi-repo base image approach (micromamba
+ conda environment.yml + pip install --no-deps) to self-contained
multi-stage Dockerfiles using pixi environments from the committed lock
file. This ensures reproducible builds with exact version parity between
development and production.
Copy file name to clipboardExpand all lines: docs/dev/explanations/components/index.md
+26-35Lines changed: 26 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,57 +81,48 @@ flowchart BT
81
81
82
82
## Container Images
83
83
84
-
DiracX utilizes a structured approach to containerization:
84
+
DiracX container images are built using [pixi](https://pixi.sh/) environments defined in `pixi.toml`. All dependencies — both conda and PyPI packages — are resolved via the committed `pixi.lock` file, ensuring reproducible builds with exact version parity between development and production.
85
85
86
-
1.**Base Image**:
86
+
### Architecture
87
87
88
-
- All container images start from `diracx/base`.
88
+
Each container image is built using a multi-stage Dockerfile:
89
89
90
-
2.**Specialized Base Images**:
90
+
1.**Build stage**: Uses `ghcr.io/prefix-dev/pixi` to install a pixi environment from the lock file with `pixi install --locked`.
91
+
2.**Runtime stage**: Uses a minimal `ubuntu:24.04` base image. The installed pixi environment is copied from the build stage. [Tini](https://github.com/krallin/tini) is used as the init process for proper signal handling.
91
92
92
-
-`diracx/services-base`
93
-
-`diracx/tasks-base`
94
-
-`diracx/client-base`
93
+
The container environments are defined in `pixi.toml` alongside the development environments, sharing the same solve group to guarantee identical dependency versions:
95
94
96
-
3.**Image Versioning and Building**:
95
+
-**`container-services`**: Includes `diracx-routers`, `diracx-logic`, `diracx-db`, and `diracx-core` plus runtime dependencies (tini, CA certificates, git).
96
+
-**`container-client`**: Includes `diracx-cli`, `diracx-api`, `diracx-client`, and `diracx-core` plus runtime dependencies.
97
97
98
-
- Images are built periodically (e.g., every Monday) and tagged as `YYYY.MM.DD.P`.
99
-
- A DiracX release triggers the creation of new `DiracXService`, `diracx/tasks`, and `diracx/client` images, based on specific `diracx/base` tags.
100
-
- This approach ensures stability in production environments.
101
-
- For testing purposes, the `latest` base images are used, with dependencies installed via `pip install`.
98
+
### Building
102
99
103
-
See this diagram for an example of how this looks in practice:
100
+
Container images are self-contained — the Dockerfile copies source code and uses `pixi install --locked` to resolve everything from the lock file. No separate base images or wheel-building steps are needed:
- There is a noted duplication between `setup.cfg` and `environment.yaml`.
123
-
- The `diracx/base` image is built from a Dockerfile with `environment.yml`, primarily defining the Python version and `dirac_environment.yaml` containing the DIRAC specific dependencies. The latter is there as a "temporary" thing.
124
-
- The `diracx/services-base` and `diracx/tasks-base` images extend `diracx/base` with additional Dockerfiles and `environment.yml`, tailored to their specific needs.
125
-
- The `diracx/services` and `diracx/tasks` images are further built upon their respective base images, adding necessary diracx packages through `pip install --no-dependencies`.
114
+
### Versioning
126
115
127
-
### Entrypoint
116
+
- Release builds are tagged with the version (e.g., `ghcr.io/diracgrid/diracx/services:v0.X.Y`).
117
+
- Development builds from `main` are tagged as `dev`.
128
118
129
-
TODO: document the entry point
119
+
### Server Entry Points
130
120
131
121
-`diracx-routers`:
132
122
-`diracx.diracx_min_client_version` entry-point defines the diracx minimum client version required by the server to prevent issues. This also searches for extension names instead of `diracx`. The minimum version number has to be updated in `diracx-routers/src/__init.py__`
133
123
134
124
## Extensions
135
125
136
-
- Extensions will extend one or more of `diracx`, `diracx-routers`, `diracx-tasks` images (e.g. `lhcbdiracx`, `lhcbdiracx-routers`, `lhcbdiracx-tasks`).
137
-
- Extensions provide a corresponding container image based on a specific release of the corresponding DiracX image.
126
+
Extensions (e.g., Gubbins, LHCbDIRACX) provide their own `pixi.toml` and `pixi.lock` with container environments that pull in both the extension and upstream DiracX packages transitively.
127
+
128
+
The extension container Dockerfile follows the same multi-stage pixi pattern, built from the extension's own source directory.
0 commit comments