@@ -54,101 +54,41 @@ jobs:
5454 prepare-gubbins-backend :
5555 runs-on : ubuntu-latest
5656 if : ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }}
57- defaults :
58- run :
59- # We need extglob for REFERENCE_BRANCH substitution
60- shell : bash -l -O extglob {0}
6157 steps :
6258 - name : Clone source
6359 run : |
6460 cd ..
6561 git clone https://github.com/DIRACGrid/diracx.git
6662
67- # Prepare the gubbins extension
68- - name : Where the magic happens (Move extensions to a temporary directory)
69- run : |
70- # We have to copy the code to another directory
71- # and make it a git repository by itself because otherwise the
72- # root in the pyproject to do not make sense once mounted
73- # in the containers.
74- cp -r ../diracx/extensions/gubbins /tmp/
75- sed -i 's@../..@.@g' /tmp/gubbins/pyproject.toml
76- sed -i 's@../../@@g' /tmp/gubbins/gubbins-*/pyproject.toml
77-
78- - name : Upload artifact
79- uses : actions/upload-artifact@v7
80- with :
81- name : gubbins
82- path : /tmp/gubbins
83- include-hidden-files : true
84-
85- # Prepare the gubbins image
86- # - Build the gubbins wheels
87- - uses : actions/setup-python@v6
88- with :
89- python-version : ' 3.14'
90- - name : Installing dependencies
91- run : |
92- cd ../diracx
93- python -m pip install \
94- build \
95- python-dateutil \
96- pytz \
97- readme_renderer[md] \
98- requests \
99- setuptools_scm
100- - name : Build distributions
101- run : |
102- cd ../diracx
103- for pkg_dir in $PWD/diracx-*; do
104- echo "Building $pkg_dir"
105- python -m build --outdir $PWD/dist $pkg_dir
106- done
107- # Also build the diracx metapackage
108- python -m build --outdir $PWD/dist .
109- # And build the gubbins package
110- for pkg_dir in $PWD/extensions/gubbins/gubbins-*; do
111- # Skip the testing package
112- if [[ "${pkg_dir}" =~ .*testing.* ]];
113- then
114- echo "Do not build ${pkg_dir}";
115- continue;
116- fi
117- echo "Building $pkg_dir"
118- python -m build --outdir $PWD/dist $pkg_dir
119- done
120- - name : " Find wheels"
121- id : find_wheel
122- run : |
123- cd ../diracx/dist
124- # We need to copy them there to be able to access them in the RUN --mount
125- cp diracx*.whl gubbins*.whl ../extensions/containers/services/
126- for wheel_fn in *.whl; do
127- pkg_name=$(basename "${wheel_fn}" | cut -d '-' -f 1)
128- echo "${pkg_name}-wheel-name=$(ls "${pkg_name}"-*.whl)" >> $GITHUB_OUTPUT
129- done
130-
131- # - Build the gubbins image using the wheels
132- - name : Set up QEMU
133- uses : docker/setup-qemu-action@v4
63+ # Build gubbins container images using pixi
13464 - name : Set up Docker Buildx
13565 uses : docker/setup-buildx-action@v4
13666
137- - name : Build and export service
67+ - name : Build gubbins services image
13868 uses : docker/build-push-action@v7
13969 with :
140- context : ../diracx/extensions/containers/services
141- tags : gubbins/services:dev
70+ context : ../diracx
71+ file : ../diracx/containers/Dockerfile
72+ build-args : |
73+ PIXI_ENV=gubbins-container-services
74+ tags : ghcr.io/gubbins/services:dev
14275 outputs : type=docker,dest=/tmp/gubbins_services_image.tar
76+
77+ - name : Build gubbins client image
78+ uses : docker/build-push-action@v7
79+ with :
80+ context : ../diracx
81+ file : ../diracx/containers/Dockerfile
14382 build-args : |
144- EXTRA_PACKAGES_TO_INSTALL=git+https://github.com/DIRACGrid/DIRAC.git@integration
145- EXTENSION_CUSTOM_SOURCES_TO_INSTALL=/bindmount/gubbins_db*.whl,/bindmount/gubbins_routers*.whl,/bindmount/gubbins_client*.whl
83+ PIXI_ENV=gubbins-container-client
84+ tags : ghcr.io/gubbins/client:dev
85+ outputs : type=docker,dest=/tmp/gubbins_client_image.tar
14686
147- - name : Upload artifact
87+ - name : Upload gubbins images
14888 uses : actions/upload-artifact@v7
14989 with :
150- name : gubbins-services-img
151- path : /tmp/gubbins_services_image .tar
90+ name : gubbins-images
91+ path : /tmp/gubbins_*_image .tar
15292
15393 prepare-gubbins-frontend-as-a-standalone :
15494 runs-on : ubuntu-latest
@@ -258,29 +198,23 @@ jobs:
258198 # ========================================================================#
259199 # WARNING: In your CI/CD pipeline, you should remove the following steps #
260200 # ------------------------------------------------------------------------#
261- - name : Download gubbins
262- uses : actions/download-artifact@v8
263- with :
264- name : gubbins
265- path : /tmp/gubbins
266-
267- - name : Create a new git repository
268- run : |
269- git init /tmp/gubbins/
270-
271- - name : Clone diracx source
201+ - name : Clone diracx source
272202 run : |
273203 cd ..
274204 git clone https://github.com/DIRACGrid/diracx.git
275205
276- - name : Download gubbins:services image
206+ - name : Download gubbins images
277207 uses : actions/download-artifact@v8
278208 with :
279- name : gubbins-services-img
209+ name : gubbins-images
280210 path : /tmp/
281211
282- - name : Load docker image
283- run : docker load --input /tmp/gubbins_services_image.tar
212+ - name : Load gubbins images
213+ run : |
214+ docker load --input /tmp/gubbins_services_image.tar
215+ rm -f /tmp/gubbins_services_image.tar
216+ docker load --input /tmp/gubbins_client_image.tar
217+ rm -f /tmp/gubbins_client_image.tar
284218
285219 - name : Download gubbins-web
286220 uses : actions/download-artifact@v8
@@ -289,12 +223,32 @@ jobs:
289223 path : /tmp/gubbins-web
290224 # ------------------------------------------------------------------------#
291225 # ========================================================================#
292-
226+
293227 # Runs the demo with the extension source code
294- - name : Start demo
228+ - name : Start demo
295229 run : |
296230 cd ..
297- diracx-charts/run_demo.sh --exit-when-done --set-value developer.autoReload=false --ci-values ./diracx/extensions/gubbins_values.yaml --load-docker-image "gubbins/services:dev" diracx/ /tmp/gubbins/ /tmp/gubbins-web/
231+
232+ # Download helm/kubectl/kind first
233+ diracx-charts/run_demo.sh --only-download-deps
234+
235+ # Copy gubbins-charts to a temporary location and build dependencies
236+ cp -r ./diracx/extensions/gubbins-charts /tmp/
237+ diracx-charts/.demo/helm dependency build /tmp/gubbins-charts
238+ # Replace the downloaded subchart with the locally-cloned one to
239+ # ensure we have the pixi-compatible ConfigMap entrypoint
240+ rm -f /tmp/gubbins-charts/charts/diracx-*.tgz
241+ diracx-charts/.demo/helm package diracx-charts/diracx -d /tmp/gubbins-charts/charts/
242+
243+ diracx-charts/run_demo.sh \
244+ --exit-when-done \
245+ --set-value diracx.developer.autoReload=false \
246+ --extension-chart-path /tmp/gubbins-charts \
247+ --ci-values ./diracx/extensions/gubbins_values.yaml \
248+ --load-docker-image "ghcr.io/gubbins/services:dev" \
249+ --load-docker-image "ghcr.io/gubbins/client:dev" \
250+ --prune-loaded-images \
251+ /tmp/gubbins-web/
298252
299253 - name : Debugging information
300254 run : |
0 commit comments