Skip to content

Commit 40cd3d0

Browse files
committed
fix: adapt to new github workflows
1 parent 6735aa3 commit 40cd3d0

3 files changed

Lines changed: 33 additions & 24 deletions

File tree

.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: 28 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,29 @@ 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+
- name: Build container for diracx
151+
uses: docker/build-push-action@v6
152+
with:
153+
context: containers/services
154+
tags: diracx/services:dev
155+
load: true
156+
build-args: |
157+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=diraccommon\&subdirectory=dirac-common
158+
159+
- name: Update gubbins Dockerfile base image
160+
if: ${{ matrix.extension == 'gubbins' }}
161+
run: |
162+
sed -i 's|FROM ghcr.io/diracgrid/diracx/services:dev|FROM diracx/services:dev|' extensions/containers/services/Dockerfile
147163
- name: Build container for gubbins
148164
if: ${{ matrix.extension == 'gubbins' }}
149165
uses: docker/build-push-action@v6
150166
with:
151167
context: extensions/containers/services
152168
tags: gubbins/services:dev
153-
outputs: type=docker,dest=/tmp/gubbins_services_image.tar
169+
load: true
154170
build-args: |
155171
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
164172
- name: Start demo
165173
run: |
166174
git clone https://github.com/DIRACGrid/diracx-charts.git ../diracx-charts
@@ -169,16 +177,16 @@ jobs:
169177
demo_args+=("--enable-open-telemetry")
170178
demo_args+=("--enable-coverage")
171179
demo_args+=("--exit-when-done")
180+
demo_args+=("--set-value" "developer.autoReload=false")
172181
demo_args+=("--ci-values" "../diracx-charts/demo/ci_values.yaml")
182+
demo_args+=("--prune-loaded-images")
173183
174184
declare -a demo_source_dirs=("$PWD")
175185
176186
# Download helm/kubectl/kind first
177187
../diracx-charts/run_demo.sh --only-download-deps
178188
179189
if [ ${{ matrix.extension }} == 'gubbins' ]; then
180-
demo_args+=("--set-value" "diracx.developer.autoReload=false")
181-
182190
# We have to copy the code to another directory
183191
# and make it a git repository by itself because otherwise the
184192
# root in the pyproject do not make sense once mounted
@@ -196,11 +204,12 @@ jobs:
196204
demo_args+=("--ci-values" "./extensions/gubbins_values.yaml")
197205
demo_args+=("--load-docker-image" "gubbins/services:dev")
198206
demo_source_dirs+=("/tmp/gubbins/")
199-
elif [ ${{ matrix.extension }} != 'diracx' ]; then
207+
elif [ ${{ matrix.extension }} == 'diracx' ]; then
208+
demo_args+=("--ci-values" "./diracx_values.yaml")
209+
demo_args+=("--load-docker-image" "diracx/services:dev")
210+
else
200211
echo "Unknown extension: ${{ matrix.extension }}"
201212
exit 1
202-
else
203-
demo_args+=("--set-value" "developer.autoReload=false")
204213
fi
205214
206215
# 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)