Skip to content

Commit 6735aa3

Browse files
committed
feat: deploy gubbins images
1 parent 9b29d48 commit 6735aa3

2 files changed

Lines changed: 107 additions & 1 deletion

File tree

.github/workflows/deployment.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,109 @@ jobs:
244244
else
245245
echo "No changes to commit"
246246
fi
247+
248+
# -------------------------------------------------------------------------------------------------
249+
# Gubbins deployment
250+
# -------------------------------------------------------------------------------------------------
251+
252+
build-gubbins-wheels:
253+
name: Build wheels
254+
runs-on: "ubuntu-latest"
255+
needs: deploy-pypi
256+
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
257+
defaults:
258+
run:
259+
# We need extglob for REFERENCE_BRANCH substitution
260+
shell: bash -l -O extglob {0}
261+
steps:
262+
- name: Checkout
263+
uses: actions/checkout@v6
264+
- uses: actions/setup-python@v6
265+
with:
266+
python-version: '3.11'
267+
- name: Installing dependencies
268+
run: |
269+
python -m pip install \
270+
build \
271+
python-dateutil \
272+
pytz \
273+
readme_renderer[md] \
274+
requests \
275+
setuptools_scm
276+
- name: Build distributions
277+
run: |
278+
# build the gubbins package
279+
for pkg_dir in $PWD/extensions/gubbins/gubbins-*; do
280+
# Skip the testing package
281+
if [[ "${pkg_dir}" =~ .*testing.* ]];
282+
then
283+
echo "Do not build ${pkg_dir}";
284+
continue;
285+
fi
286+
echo "Building $pkg_dir"
287+
python -m build --outdir $PWD/dist $pkg_dir
288+
done
289+
- name: 'Upload Artifact'
290+
uses: actions/upload-artifact@v6
291+
with:
292+
name: gubbins-whl
293+
path: dist/*.whl
294+
retention-days: 5
295+
296+
# Build to docker image with the code in it
297+
docker-gubbins:
298+
needs:
299+
- deploy-pypi
300+
- build-gubbins-wheels
301+
if: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
302+
timeout-minutes: 30
303+
runs-on: ubuntu-latest
304+
steps:
305+
- name: Checkout
306+
uses: actions/checkout@v6
307+
- name: Set up QEMU
308+
uses: docker/setup-qemu-action@v3
309+
- name: Set up Docker Buildx
310+
uses: docker/setup-buildx-action@v3
311+
- name: Login to GitHub container registry
312+
uses: docker/login-action@v3
313+
with:
314+
registry: ghcr.io
315+
username: ${{ github.actor }}
316+
password: ${{ secrets.GITHUB_TOKEN }}
317+
- name: Download diracx wheels
318+
uses: actions/download-artifact@v7
319+
with:
320+
name: diracx-whl
321+
- name: Download gubbins wheels
322+
uses: actions/download-artifact@v7
323+
with:
324+
name: gubbins-whl
325+
- name: "Find wheels"
326+
id: find_wheel
327+
run: |
328+
# We need to copy them there to be able to access them in the RUN --mount
329+
cp diracx*.whl gubbins*.whl extensions/containers/client/
330+
cp diracx*.whl gubbins*.whl extensions/containers/services/
331+
for wheel_fn in *.whl; do
332+
pkg_name=$(basename "${wheel_fn}" | cut -d '-' -f 1)
333+
echo "${pkg_name}-wheel-name=$(ls "${pkg_name}"-*.whl)" >> $GITHUB_OUTPUT
334+
done
335+
336+
- name: Build and push client (dev)
337+
uses: docker/build-push-action@v6
338+
with:
339+
context: extensions/containers/client
340+
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
341+
tags: ghcr.io/diracgrid/gubbins/client:dev
342+
platforms: linux/amd64,linux/arm64
343+
- name: Build and push service (dev)
344+
uses: docker/build-push-action@v6
345+
with:
346+
context: extensions/containers/services
347+
push: ${{ needs.deploy-pypi.outputs.create-release == 'true' }}
348+
tags: ghcr.io/diracgrid/gubbins/services:dev
349+
platforms: linux/amd64,linux/arm64
350+
build-args: |
351+
EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration#egg=diraccommon\&subdirectory=dirac-common
352+
EXTENSION_CUSTOM_SOURCES_TO_INSTALL=/bindmount/gubbins_db*.whl,/bindmount/gubbins_logic*.whl,/bindmount/gubbins_routers*.whl,/bindmount/gubbins_client*.whl

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: gubbins/services
12+
services: ghcr.io/diracgrid/gubbins/services

0 commit comments

Comments
 (0)