Skip to content

Commit 38db73d

Browse files
committed
fix: adapt to new github workflows
1 parent 6735aa3 commit 38db73d

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

.github/workflows/deployment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ jobs:
253253
name: Build wheels
254254
runs-on: "ubuntu-latest"
255255
needs: deploy-pypi
256-
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
257256
defaults:
258257
run:
259258
# We need extglob for REFERENCE_BRANCH substitution
@@ -298,7 +297,6 @@ jobs:
298297
needs:
299298
- deploy-pypi
300299
- build-gubbins-wheels
301-
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
302300
timeout-minutes: 30
303301
runs-on: ubuntu-latest
304302
steps:
@@ -337,14 +335,16 @@ jobs:
337335
uses: docker/build-push-action@v6
338336
with:
339337
context: extensions/containers/client
340-
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
338+
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
341339
tags: ghcr.io/diracgrid/gubbins/client:dev
342340
platforms: linux/amd64,linux/arm64
341+
build-args: |
342+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
343343
- name: Build and push service (dev)
344344
uses: docker/build-push-action@v6
345345
with:
346346
context: extensions/containers/services
347-
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
347+
push: ${{ github.event_name != 'pull_request' && github.repository == 'DIRACGrid/diracx' && github.ref_name == 'main' }}
348348
tags: ghcr.io/diracgrid/gubbins/services:dev
349349
platforms: linux/amd64,linux/arm64
350350
build-args: |

.github/workflows/main.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,19 @@ jobs:
121121
with:
122122
cache: false
123123
environments: ${{ matrix.extension == 'diracx' && 'default' || 'default-gubbins' }}
124-
- name: Build gubbins wheels
125-
if: ${{ matrix.extension == 'gubbins' }}
124+
- name: Build diracx wheels
126125
run: |
127126
for pkg_dir in $PWD/diracx-*; do
128127
echo "Building $pkg_dir"
129-
pixi exec python-build --outdir $PWD/extensions/containers/services/ $pkg_dir
128+
pixi exec python-build --outdir $PWD/containers/services/ $pkg_dir
130129
done
131130
# Also build the diracx metapackage
132-
pixi exec python-build --outdir $PWD/extensions/containers/services/ .
131+
pixi exec python-build --outdir $PWD/containers/services/ .
132+
- name: Build gubbins wheels
133+
if: ${{ matrix.extension == 'gubbins' }}
134+
run: |
135+
cp $PWD/containers/services/*.whl $PWD/extensions/containers/services/
136+
cp $PWD/containers/services/*.tar.gz $PWD/extensions/containers/services/
133137
# And build the gubbins package
134138
for pkg_dir in $PWD/extensions/gubbins/gubbins-*; do
135139
# Skip the testing package
@@ -142,25 +146,33 @@ jobs:
142146
pixi exec python-build --outdir $PWD/extensions/containers/services/ $pkg_dir
143147
done
144148
- name: Set up Docker Buildx
145-
if: ${{ matrix.extension == 'gubbins' }}
146149
uses: docker/setup-buildx-action@v3
150+
with:
151+
# Use the docker driver to allow the gubbins build to access
152+
# the locally built diracx/services:dev image as its base
153+
driver: docker
154+
- name: Build container for diracx
155+
uses: docker/build-push-action@v6
156+
with:
157+
context: containers/services
158+
tags: diracx/services:dev
159+
load: true
160+
build-args: |
161+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=diraccommon\&subdirectory=dirac-common
162+
163+
- name: Update gubbins Dockerfile base image
164+
if: ${{ matrix.extension == 'gubbins' }}
165+
run: |
166+
sed -i 's|FROM ghcr.io/diracgrid/diracx/services:dev|FROM diracx/services:dev|' extensions/containers/services/Dockerfile
147167
- name: Build container for gubbins
148168
if: ${{ matrix.extension == 'gubbins' }}
149169
uses: docker/build-push-action@v6
150170
with:
151171
context: extensions/containers/services
152172
tags: gubbins/services:dev
153-
outputs: type=docker,dest=/tmp/gubbins_services_image.tar
173+
load: true
154174
build-args: |
155175
EXTENSION_CUSTOM_SOURCES_TO_INSTALL=/bindmount/gubbins_db*.whl,/bindmount/gubbins_logic*.whl,/bindmount/gubbins_routers*.whl,/bindmount/gubbins_client*.whl
156-
- name: Load image
157-
if: ${{ matrix.extension == 'gubbins' }}
158-
run: |
159-
docker load --input /tmp/gubbins_services_image.tar
160-
# Free up disk space by removing the tarball after loading the image
161-
rm -Rf /tmp/gubbins_services_image.tar
162-
docker builder prune -af || true
163-
docker image ls -a
164176
- name: Start demo
165177
run: |
166178
git clone https://github.com/DIRACGrid/diracx-charts.git ../diracx-charts
@@ -169,16 +181,16 @@ jobs:
169181
demo_args+=("--enable-open-telemetry")
170182
demo_args+=("--enable-coverage")
171183
demo_args+=("--exit-when-done")
184+
demo_args+=("--set-value" "developer.autoReload=false")
172185
demo_args+=("--ci-values" "../diracx-charts/demo/ci_values.yaml")
186+
demo_args+=("--prune-loaded-images")
173187
174188
declare -a demo_source_dirs=("$PWD")
175189
176190
# Download helm/kubectl/kind first
177191
../diracx-charts/run_demo.sh --only-download-deps
178192
179193
if [ ${{ matrix.extension }} == 'gubbins' ]; then
180-
demo_args+=("--set-value" "diracx.developer.autoReload=false")
181-
182194
# We have to copy the code to another directory
183195
# and make it a git repository by itself because otherwise the
184196
# root in the pyproject do not make sense once mounted
@@ -196,11 +208,11 @@ jobs:
196208
demo_args+=("--ci-values" "./extensions/gubbins_values.yaml")
197209
demo_args+=("--load-docker-image" "gubbins/services:dev")
198210
demo_source_dirs+=("/tmp/gubbins/")
199-
elif [ ${{ matrix.extension }} != 'diracx' ]; then
211+
elif [ ${{ matrix.extension }} == 'diracx' ]; then
212+
demo_args+=("--load-docker-image" "diracx/services:dev")
213+
else
200214
echo "Unknown extension: ${{ matrix.extension }}"
201215
exit 1
202-
else
203-
demo_args+=("--set-value" "developer.autoReload=false")
204216
fi
205217
206218
# Run the demo with the provided arguments

extensions/gubbins-charts/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ diracx:
99
global:
1010
images:
1111
tag: "dev"
12-
services: ghcr.io/diracgrid/gubbins/services
12+
services: gubbins/services

0 commit comments

Comments
 (0)