Skip to content

Commit 3232bab

Browse files
aldbrfstagni
authored andcommitted
fix: adapt to new github workflows
1 parent bd5a12d commit 3232bab

File tree

4 files changed

+46
-20
lines changed

4 files changed

+46
-20
lines changed

.github/workflows/deployment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,6 @@ jobs:
309309
name: Build wheels
310310
runs-on: "ubuntu-latest"
311311
needs: deploy-pypi
312-
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
313312
defaults:
314313
run:
315314
# We need extglob for REFERENCE_BRANCH substitution
@@ -354,7 +353,6 @@ jobs:
354353
needs:
355354
- deploy-pypi
356355
- build-gubbins-wheels
357-
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
358356
timeout-minutes: 30
359357
runs-on: ubuntu-latest
360358
steps:
@@ -393,14 +391,16 @@ jobs:
393391
uses: docker/build-push-action@v6
394392
with:
395393
context: extensions/containers/client
396-
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
394+
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
397395
tags: ghcr.io/diracgrid/gubbins/client:dev
398396
platforms: linux/amd64,linux/arm64
397+
build-args: |
398+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
399399
- name: Build and push service (dev)
400400
uses: docker/build-push-action@v6
401401
with:
402402
context: extensions/containers/services
403-
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
403+
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
404404
tags: ghcr.io/diracgrid/gubbins/services:dev
405405
platforms: linux/amd64,linux/arm64
406406
build-args: |

.github/workflows/main.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,19 @@ jobs:
9999
with:
100100
cache: false
101101
environments: ${{ matrix.extension == 'diracx' && 'default' || 'default-gubbins' }}
102-
- name: Build gubbins wheels
103-
if: ${{ matrix.extension == 'gubbins' }}
102+
- name: Build diracx wheels
104103
run: |
105104
for pkg_dir in $PWD/diracx-*; do
106105
echo "Building $pkg_dir"
107-
pixi exec python-build --outdir $PWD/extensions/containers/services/ $pkg_dir
106+
pixi exec python-build --outdir $PWD/containers/services/ $pkg_dir
108107
done
109108
# Also build the diracx metapackage
110-
pixi exec python-build --outdir $PWD/extensions/containers/services/ .
109+
pixi exec python-build --outdir $PWD/containers/services/ .
110+
- name: Build gubbins wheels
111+
if: ${{ matrix.extension == 'gubbins' }}
112+
run: |
113+
cp $PWD/containers/services/*.whl $PWD/extensions/containers/services/
114+
cp $PWD/containers/services/*.tar.gz $PWD/extensions/containers/services/
111115
# And build the gubbins package
112116
for pkg_dir in $PWD/extensions/gubbins/gubbins-*; do
113117
# Skip the testing package
@@ -120,32 +124,38 @@ jobs:
120124
pixi exec python-build --outdir $PWD/extensions/containers/services/ $pkg_dir
121125
done
122126
- name: Set up Docker Buildx
123-
if: ${{ matrix.extension == 'gubbins' }}
124127
uses: docker/setup-buildx-action@v3
128+
- name: Build container for diracx
129+
if: ${{ matrix.extension == 'diracx' }}
130+
uses: docker/build-push-action@v6
131+
with:
132+
context: containers/services
133+
tags: diracx/services:dev
134+
load: true
135+
build-args: |
136+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
125137
- name: Build container for gubbins
126138
if: ${{ matrix.extension == 'gubbins' }}
127139
uses: docker/build-push-action@v6
128140
with:
129141
context: extensions/containers/services
130142
tags: gubbins/services:dev
131-
outputs: type=docker,dest=/tmp/gubbins_services_image.tar
143+
load: true
132144
build-args: |
145+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
133146
EXTENSION_CUSTOM_SOURCES_TO_INSTALL=/bindmount/gubbins_db*.whl,/bindmount/gubbins_logic*.whl,/bindmount/gubbins_routers*.whl,/bindmount/gubbins_client*.whl
134-
- name: Load image
135-
if: ${{ matrix.extension == 'gubbins' }}
136-
run: |
137-
docker load --input /tmp/gubbins_services_image.tar
138-
docker image ls -a
147+
139148
- name: Start demo
140149
run: |
141-
git clone https://github.com/DIRACGrid/diracx-charts.git ../diracx-charts
150+
git clone --branch main_FEAT_remove-loaded-images https://github.com/aldbr/diracx-charts.git ../diracx-charts
142151
143152
declare -a demo_args=()
144153
demo_args+=("--enable-open-telemetry")
145154
demo_args+=("--enable-coverage")
146155
demo_args+=("--exit-when-done")
147156
demo_args+=("--set-value" "developer.autoReload=false")
148157
demo_args+=("--ci-values" "../diracx-charts/demo/ci_values.yaml")
158+
demo_args+=("--prune-loaded-images")
149159
150160
declare -a demo_source_dirs=("$PWD")
151161
@@ -162,7 +172,10 @@ jobs:
162172
demo_args+=("--ci-values" "./extensions/gubbins_values.yaml")
163173
demo_args+=("--load-docker-image" "gubbins/services:dev")
164174
demo_source_dirs+=("/tmp/gubbins/")
165-
elif [ ${{ matrix.extension }} != 'diracx' ]; then
175+
elif [ ${{ matrix.extension }} == 'diracx' ]; then
176+
demo_args+=("--ci-values" "./diracx_values.yaml")
177+
demo_args+=("--load-docker-image" "diracx/services:dev")
178+
else
166179
echo "Unknown extension: ${{ matrix.extension }}"
167180
exit 1
168181
fi

diracx_values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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: diracx/services
9+
10+
developer:
11+
enabled: true

extensions/gubbins_values.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# values specific to testing gubbins
22
global:
3-
imagePullPolicy: Always
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
47
images:
5-
tag: dev
6-
services: ghcr.io/diracgrid/gubbins/services
8+
services: gubbins/services
79

810
developer:
911
enabled: true

0 commit comments

Comments
 (0)