Skip to content

Commit 649f318

Browse files
authored
feat: add gubbins-charts Helm chart for gubbins extension (#691)
* feat: add gubbins-charts Helm chart for gubbins extension Add umbrella Helm chart for the gubbins DiracX extension following the lhcbdiracx-charts pattern. This chart extends the base diracx chart with gubbins-specific configuration including: - Gubbins container image registry configuration - LollygagDB database setup - Developer mode enabled for testing - Example hostname configuration The chart serves as a tutorial and test example for community extensions. * feat: adapt gubbins CI to use gubbins-charts Update the gubbins pytest-integration CI to use the gubbins-charts umbrella chart instead of directly using the diracx chart with value overrides. Changes: - Copy gubbins-charts to /tmp/ during CI setup - Run helm dependency build on gubbins-charts before starting demo - Add --chart-path argument to run_demo.sh pointing to gubbins-charts - Simplify gubbins_values.yaml to only contain CI-specific overrides - Move base gubbins configuration to gubbins-charts/values.yaml This approach provides better separation of concerns: - Base configuration lives in gubbins-charts (part of the extension) - CI-specific overrides remain in gubbins_values.yaml - Pattern is reusable for other community extensions Related: DIRACGrid/diracx-charts#186
1 parent f28a32e commit 649f318

File tree

8 files changed

+153
-18
lines changed

8 files changed

+153
-18
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,16 @@ jobs:
167167
demo_args+=("--enable-open-telemetry")
168168
demo_args+=("--enable-coverage")
169169
demo_args+=("--exit-when-done")
170-
demo_args+=("--set-value" "developer.autoReload=false")
171170
demo_args+=("--ci-values" "../diracx-charts/demo/ci_values.yaml")
172171
173172
declare -a demo_source_dirs=("$PWD")
174173
174+
# Download helm/kubectl/kind first
175+
../diracx-charts/run_demo.sh --only-download-deps
176+
175177
if [ ${{ matrix.extension }} == 'gubbins' ]; then
178+
demo_args+=("--set-value" "diracx.developer.autoReload=false")
179+
176180
# We have to copy the code to another directory
177181
# and make it a git repository by itself because otherwise the
178182
# root in the pyproject do not make sense once mounted
@@ -182,12 +186,19 @@ jobs:
182186
sed -i 's@../../@@g' /tmp/gubbins/gubbins-*/pyproject.toml
183187
git init /tmp/gubbins/
184188
189+
# Copy gubbins-charts to a temporary location and build dependencies
190+
cp -r ./extensions/gubbins-charts /tmp/
191+
../diracx-charts/.demo/helm dependency build /tmp/gubbins-charts
192+
193+
demo_args+=("--extension-chart-path" "/tmp/gubbins-charts")
185194
demo_args+=("--ci-values" "./extensions/gubbins_values.yaml")
186195
demo_args+=("--load-docker-image" "gubbins/services:dev")
187196
demo_source_dirs+=("/tmp/gubbins/")
188197
elif [ ${{ matrix.extension }} != 'diracx' ]; then
189198
echo "Unknown extension: ${{ matrix.extension }}"
190199
exit 1
200+
else
201+
demo_args+=("--set-value" "developer.autoReload=false")
191202
fi
192203
193204
# Run the demo with the provided arguments

diracx-testing/src/diracx/testing/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,12 @@ def demo_urls(demo_dir):
529529
import yaml
530530

531531
helm_values = yaml.safe_load((demo_dir / "values.yaml").read_text())
532-
yield helm_values["developer"]["urls"]
532+
try:
533+
yield helm_values["developer"]["urls"]
534+
except KeyError:
535+
# If we're testing an extension they will have an umbrella chart so the
536+
# URLs are under a "diracx" section corrosponding to the vanilla chart
537+
yield helm_values["diracx"]["developer"]["urls"]
533538

534539

535540
@pytest.fixture(scope="session")

docs/dev/explanations/extensions.md

Lines changed: 1 addition & 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+
Additionally, you will need an umbrella helm chart for your extension.
3839

3940
## Gubbins
4041

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Helm dependencies - these are regenerated with `helm dependency update`
2+
charts/
3+
Chart.lock
4+
5+
# Helm package files
6+
*.tgz
7+
8+
# IDE files
9+
.vscode/
10+
.idea/
11+
*.swp
12+
*.swo
13+
14+
# OS files
15+
.DS_Store
16+
Thumbs.db
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v2
2+
name: gubbins
3+
description: Gubbins-specific DiracX Helm chart that extends the base DiracX chart
4+
type: application
5+
version: 0.1.0
6+
# Note: this is not reflected in the app.kubernetes.io/version label :-(
7+
appVersion: "v0.0.1"
8+
9+
dependencies:
10+
- name: diracx
11+
version: "1.0.0"
12+
repository: "https://charts.diracgrid.org/"
13+
maintainers:
14+
- name: Gubbins DiracX Team
15+
16+
17+
keywords:
18+
- diracx
19+
- gubbins
20+
- grid
21+
- computing
22+
23+
home: https://github.com/diracgrid/diracx
24+
sources:
25+
- https://github.com/diracgrid/diracx
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# gubbins-charts
2+
3+
This is an umbrella Helm chart for managing the Gubbins extension of DiracX independently of the base DiracX chart version.
4+
5+
Gubbins is an example extension meant as a tutorial and test for extending DiracX with community-specific functionality.
6+
7+
## Overview
8+
9+
This chart extends the base `diracx` chart by:
10+
11+
- Configuring gubbins-specific container images
12+
- Adding the LollygagDB database
13+
- Setting up gubbins-specific deployment settings
14+
15+
## Prerequisites
16+
17+
- Kubernetes cluster (1.19+)
18+
- Helm 3.0+
19+
- Access to the DiracX charts repository at https://charts.diracgrid.org/
20+
21+
## Installation
22+
23+
### Add the DiracX Helm repository
24+
25+
```bash
26+
helm repo add diracx https://charts.diracgrid.org/
27+
helm repo update
28+
```
29+
30+
### Install dependencies
31+
32+
```bash
33+
helm dependency build
34+
```
35+
36+
### Install the chart
37+
38+
```bash
39+
helm install gubbins . --values values.yaml
40+
```
41+
42+
### Install with custom values
43+
44+
```bash
45+
helm install gubbins . --values values.yaml --values custom-values.yaml
46+
```
47+
48+
## Configuration
49+
50+
The main configuration is in `values.yaml`. Key settings include:
51+
52+
- `diracx.global.images.services`: Container image registry for gubbins services
53+
- `diracx.global.images.tag`: Image tag to use (default: "dev")
54+
- `diracx.diracx.hostname`: Hostname for the gubbins deployment
55+
- `diracx.diracx.sqlDbs.dbs.LollygagDB`: Gubbins-specific database configuration
56+
- `diracx.developer.enabled`: Enable developer mode for testing
57+
58+
## Upgrading
59+
60+
```bash
61+
helm upgrade gubbins . --values values.yaml
62+
```
63+
64+
## Uninstalling
65+
66+
```bash
67+
helm uninstall gubbins
68+
```
69+
70+
## Development
71+
72+
This chart is part of the DiracX extensions ecosystem and serves as an example for communities wanting to extend DiracX functionality.
73+
74+
For more information about creating DiracX extensions, see the [DiracX documentation](https://github.com/diracgrid/diracx).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diracx:
2+
developer:
3+
enabled: true
4+
diracx:
5+
hostname: gubbinsdiracx.example.com
6+
sqlDbs:
7+
dbs:
8+
LollygagDB:
9+
global:
10+
images:
11+
tag: "dev"
12+
services: gubbins/services

extensions/gubbins_values.yaml

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
# values specific to testing gubbins
2-
global:
3-
# Needed to be able to force pre-load the image in kind
4-
# see https://kind.sigs.k8s.io/docs/user/quick-start/#loading-an-image-into-your-cluster
5-
# and https://iximiuz.com/en/posts/kubernetes-kind-load-docker-image/
6-
imagePullPolicy: IfNotPresent
7-
images:
8-
services: gubbins/services
9-
tag: dev
10-
11-
developer:
12-
enabled: true
13-
1+
# CI-specific values for testing gubbins
2+
# Base gubbins configuration is in gubbins-charts/values.yaml
143
diracx:
15-
sqlDbs:
16-
dbs:
17-
LollygagDB:
4+
global:
5+
# Needed to be able to force pre-load the image in kind
6+
# see https://kind.sigs.k8s.io/docs/user/quick-start/#loading-an-image-into-your-cluster
7+
# and https://iximiuz.com/en/posts/kubernetes-kind-load-docker-image/
8+
imagePullPolicy: IfNotPresent

0 commit comments

Comments
 (0)