From 6ef4ec02e76344c8eaf08feec5f3263fa9c73156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 11:17:59 +0200 Subject: [PATCH 01/15] docs(affiliation-rnsr): Improve Markdown --- services/affiliation-rnsr/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/affiliation-rnsr/README.md b/services/affiliation-rnsr/README.md index d95b0c6be..e39e3b9ab 100644 --- a/services/affiliation-rnsr/README.md +++ b/services/affiliation-rnsr/README.md @@ -17,7 +17,8 @@ Nécessite les variables d'environnement: `npm run build:dev` et `npm start:dev` importent le fichier `.env` quand il existe. -> 📗 Suggestion: déclarez les variables dans le fichier `.env` de cette manière: +> [!TIP] +> Déclarez les variables dans le fichier `.env` de cette manière: > > ```bash > export WEBDAV_URL=webdavs://your.webdav.com/dvc From ab9acecdc81fbb722ee07647251b9332502b5431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 11:24:06 +0200 Subject: [PATCH 02/15] docs(affiliation-rnsr): Add comments to tests.hurl To trigger test pipeline. --- services/affiliation-rnsr/tests.hurl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/services/affiliation-rnsr/tests.hurl b/services/affiliation-rnsr/tests.hurl index f158c5f76..6a2bea4e4 100644 --- a/services/affiliation-rnsr/tests.hurl +++ b/services/affiliation-rnsr/tests.hurl @@ -1,3 +1,17 @@ +# To test locally, use: +# hurl --test --variable host=http://localhost:31976 --jobs 1 services/affiliation-rnsr/tests.hurl +# npm run test:local affiliation-rnsr +# +# To test remotely, use: +# hurl --test --variable host=https://affiliation-rnsr.services.istex.fr --jobs 1 services/affiliation-rnsr/tests.hurl +# npm run test:remote affiliation-rnsr +# +# The service should be launched as a local server. URL: http://localhost:31976 +# Just launch: +# npm -w services/affiliation-rnsr run start:dev +# npm run generate:example-tests services/affiliation-rnsr +# npm -w services/affiliation-rnsr run stop:dev + POST {{host}}/v3/affiliation/rnsr?indent=true content-type: application/json [ From 82ec2839ff55559b19272933639d449b0839f94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 11:29:34 +0200 Subject: [PATCH 03/15] build(affiliation-rnsr): Update DVC --- services/affiliation-rnsr/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 0a6247014..8ab60e426 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.9-slim-bullseye AS dvc-files WORKDIR /dvc RUN apt-get update && apt-get -y --no-install-recommends install git=1:2.30.2-1+deb11u5 && apt-get clean && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir dvc[webdav]==3.39.0 +RUN pip install --no-cache-dir dvc[webdav]==3.67.1 RUN --mount=type=secret,id=webdav_login \ --mount=type=secret,id=webdav_password \ --mount=type=secret,id=webdav_url \ From 45ecc4c1481b741fa2571dd40a87b5b326b656a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 11:48:47 +0200 Subject: [PATCH 04/15] build(affiliation-rnsr): Increase timeouts --- services/affiliation-rnsr/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 8ab60e426..1c7acda13 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -12,7 +12,10 @@ RUN --mount=type=secret,id=webdav_login \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" COPY ./v3/affiliation/models.dvc /dvc -RUN dvc pull -v +RUN dvc pull -v \ + --remote-config timeout=120 \ + --remote-config connect-timeout=60 \ + --retry 3 FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13 From 51150b9d993852b3a5730c75d5d2c21abc3ee8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 12:02:47 +0200 Subject: [PATCH 05/15] build(affiliation-rnsr): Add debug traces --- services/affiliation-rnsr/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 1c7acda13..b2e55104a 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -12,10 +12,10 @@ RUN --mount=type=secret,id=webdav_login \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" COPY ./v3/affiliation/models.dvc /dvc -RUN dvc pull -v \ - --remote-config timeout=120 \ - --remote-config connect-timeout=60 \ - --retry 3 +RUN dvc doctor +RUN dvc remote list +RUN dvc status -v +RUN dvc pull -v FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13 From 4e57b42de0e1a26fd73820d0a5b95a5644390127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 14:14:24 +0200 Subject: [PATCH 06/15] build(affiliation-rnsr): Manually create cache directory --- services/affiliation-rnsr/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index b2e55104a..0858667c0 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -11,9 +11,10 @@ RUN --mount=type=secret,id=webdav_login \ dvc remote add -d webdav-remote "$(cat /run/secrets/webdav_url)" && \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" + COPY ./v3/affiliation/models.dvc /dvc +RUN mkdir -p .dvc/cache RUN dvc doctor -RUN dvc remote list RUN dvc status -v RUN dvc pull -v From a6ed5bb145f55f42622ca3681a4e4398b1363e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 14:49:22 +0200 Subject: [PATCH 07/15] build(affiliation-rnsr): Check secrets presence --- services/affiliation-rnsr/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 0858667c0..7353939f1 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -16,6 +16,8 @@ COPY ./v3/affiliation/models.dvc /dvc RUN mkdir -p .dvc/cache RUN dvc doctor RUN dvc status -v +# Check secret presence +RUN --mount=type=secret,id=webdav_login cat /run/secrets/webdav_login || true RUN dvc pull -v FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13 From 599ff3a485dd68af22885ec58d51a12b0ddde43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:00:58 +0200 Subject: [PATCH 08/15] build(affiliation-rnsr): Let's increase timeouts --- services/affiliation-rnsr/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 7353939f1..2128432aa 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -10,14 +10,14 @@ RUN --mount=type=secret,id=webdav_login \ dvc init && \ dvc remote add -d webdav-remote "$(cat /run/secrets/webdav_url)" && \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ - dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" + dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" \ + dvc remote modify --local webdav-remote timeout 120 \ + dvc remote modify --local webdav-remote connect-timeout 60 COPY ./v3/affiliation/models.dvc /dvc RUN mkdir -p .dvc/cache RUN dvc doctor RUN dvc status -v -# Check secret presence -RUN --mount=type=secret,id=webdav_login cat /run/secrets/webdav_login || true RUN dvc pull -v FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13 From 143f1287bd23c0498c552859299ee6706b35e754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:07:30 +0200 Subject: [PATCH 09/15] build(affiliations-rnsr): Fix syntax --- services/affiliation-rnsr/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 2128432aa..934eadc70 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -10,8 +10,8 @@ RUN --mount=type=secret,id=webdav_login \ dvc init && \ dvc remote add -d webdav-remote "$(cat /run/secrets/webdav_url)" && \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ - dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" \ - dvc remote modify --local webdav-remote timeout 120 \ + dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" && \ + dvc remote modify --local webdav-remote timeout 120 && \ dvc remote modify --local webdav-remote connect-timeout 60 COPY ./v3/affiliation/models.dvc /dvc From 0b6d4fedb2a44eb3e76717ce3a91ac904397c92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:11:47 +0200 Subject: [PATCH 10/15] build(affiliation-rnsr): Remove connect-timeout --- services/affiliation-rnsr/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 934eadc70..53543707a 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -11,8 +11,7 @@ RUN --mount=type=secret,id=webdav_login \ dvc remote add -d webdav-remote "$(cat /run/secrets/webdav_url)" && \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" && \ - dvc remote modify --local webdav-remote timeout 120 && \ - dvc remote modify --local webdav-remote connect-timeout 60 + dvc remote modify --local webdav-remote timeout 120 COPY ./v3/affiliation/models.dvc /dvc RUN mkdir -p .dvc/cache From 3b0bf8516f15991864006e58d20ef0738416d43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:45:18 +0200 Subject: [PATCH 11/15] Revert "ci: Remove useless scripts" This reverts commit 98c146471a9398e6c346c1aa1430f8648cafffb3. --- bin/build-and-push.sh | 20 ++++++++++++++++++++ bin/build-and-test.sh | 31 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 bin/build-and-push.sh create mode 100755 bin/build-and-test.sh diff --git a/bin/build-and-push.sh b/bin/build-and-push.sh new file mode 100755 index 000000000..6416f0797 --- /dev/null +++ b/bin/build-and-push.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# tag should be in the format: +# ws-@ +TAG=$1 +SERVICE_INTERMEDIATE=${TAG#ws-} # remove ws- part +SERVICE_NAME=${SERVICE_INTERMEDIATE%@*} # remove version part + +if [ ! -d "services/$SERVICE_NAME" ]; then + echo "Could not find directory services/$SERVICE_NAME" + exit 1 +fi + +echo "Building $TAG" + +cd "services/$SERVICE_NAME" +npm run build +npm run publish diff --git a/bin/build-and-test.sh b/bin/build-and-test.sh new file mode 100755 index 000000000..72e683af0 --- /dev/null +++ b/bin/build-and-test.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +set -eu + +# Wait until $1 is available, retrying every $3 milliseconds up to $2 times. +wait_for_url () { + echo "Waiting for $1" + printf 'GET %s\nHTTP 200' "$1" | hurl --retry "$2" --retry-interval "$3" --verbose> /dev/null; + return 0 +} + +# branch name should be in the format: +# services// +BRANCH_NAME=$1 +SERVICE_INTERMEDIATE=${BRANCH_NAME#services/} # remove services/ part +SERVICE_NAME=${SERVICE_INTERMEDIATE%/*} + +echo "Starting container of $SERVICE_NAME" +cd "services/$SERVICE_NAME" +npm run start:dev + +echo "Waiting server to be ready" +wait_for_url "http://localhost:31976" 10 30000 + +echo "Running hurl tests" +hurl --jobs 1 --variable host=http://localhost:31976 --test tests.hurl + +echo "Stopping container of $SERVICE_NAME" +npm run stop:dev + +echo "Done" From 85ace316612f346e7135bcb203ddb37c56b9ef6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:46:54 +0200 Subject: [PATCH 12/15] Revert "ci: Increase timeout for big models to be loaded" This reverts commit a9b67b6f9b5bb440cdf1e9e1faad7ec43c65d362. --- .github/workflows/test-and-publish-on-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish-on-tag.yml b/.github/workflows/test-and-publish-on-tag.yml index 7150f12ce..2bd96d984 100644 --- a/.github/workflows/test-and-publish-on-tag.yml +++ b/.github/workflows/test-and-publish-on-tag.yml @@ -73,7 +73,7 @@ jobs: exit 0 fi echo "Attempt $i/10 - waiting..." - sleep 30 + sleep 5 done echo "Server did not become ready" exit 1 From 6682064c1eb81dd13a78387e565de2054cf67796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:47:20 +0200 Subject: [PATCH 13/15] Revert "ci: Use cache for Docker images" This reverts commit aa526f73dd47a73ba2a75e094d2aca175c4259f2. --- .github/workflows/test-and-publish-on-tag.yml | 84 ++++++------------- 1 file changed, 26 insertions(+), 58 deletions(-) diff --git a/.github/workflows/test-and-publish-on-tag.yml b/.github/workflows/test-and-publish-on-tag.yml index 2bd96d984..f2199e2a1 100644 --- a/.github/workflows/test-and-publish-on-tag.yml +++ b/.github/workflows/test-and-publish-on-tag.yml @@ -7,11 +7,8 @@ on: tags: - "ws-*@*" -env: - REGISTRY: docker.io - jobs: - build-test-push: + test-on-tag: runs-on: ubuntu-latest steps: - name: Checkout from Git @@ -28,65 +25,24 @@ jobs: sudo dpkg -i hurl_5.0.1_amd64.deb hurl --version - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Parse tag to get service info - id: parse - run: | - TAG=${{ github.ref_name }} - SERVICE_INTERMEDIATE=${TAG#ws-} - SERVICE_NAME=${SERVICE_INTERMEDIATE%@*} - VERSION=${TAG##*@} - echo "service_name=$SERVICE_NAME" >> $GITHUB_OUTPUT - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "image_name=cnrsinist/ws-$SERVICE_NAME" >> $GITHUB_OUTPUT - - name: Build .env from Github Actions secrets shell: bash run: | bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}} ${{secrets.ILAAS_API_KEY}} ls -l services/*/.env - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - context: services/${{ steps.parse.outputs.service_name }} - push: false - load: true - tags: | - ${{ steps.parse.outputs.image_name }}:latest - ${{ steps.parse.outputs.image_name }}:${{ steps.parse.outputs.version }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Start container for testing - run: | - docker run --name test-container --rm --detach -p 31976:31976 ${{ steps.parse.outputs.image_name }}:latest - - - name: Wait for server to be ready - run: | - echo "Waiting for http://localhost:31976" - for i in {1..10}; do - if curl -s http://localhost:31976 > /dev/null 2>&1; then - echo "Server is ready!" - exit 0 - fi - echo "Attempt $i/10 - waiting..." - sleep 5 - done - echo "Server did not become ready" - exit 1 - - - name: Run Hurl tests + - name: Build Docker Image & Test + shell: bash run: | - cd services/${{ steps.parse.outputs.service_name }} - hurl --variable host=http://localhost:31976 --variable blocked=true --test --jobs 1 tests.hurl + bin/test-on-tag.sh ${{ github.ref_name }} - - name: Stop test container - if: always() - run: | - docker stop test-container || true + build-on-tag: + needs: + - test-on-tag + runs-on: ubuntu-latest + steps: + - name: Checkout from Git + uses: actions/checkout@v4 - name: Docker Login uses: docker/login-action@v3 @@ -94,7 +50,19 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Push Docker image + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 24 + + - name: Build .env from Github Actions secrets + shell: bash + run: | + bin/create-env.sh ${{ github.ref_name }} ${{ secrets.WEBDAV_LOGIN }} ${{ secrets.WEBDAV_PASSWORD }} ${{ secrets.WEBDAV_URL }} ${{secrets.OPENALEX_API_KEY}} ${{secrets.UNPAYWALL_API_KEY}} ${{secrets.CROSSREF_API_KEY}} ${{secrets.LIBRARIES_IO_API_KEY}} ${{secrets.ORCID_CLIENT_ID}} ${{secrets.ORCID_SECRET}} ${{secrets.ILAAS_API_KEY}} + ls -l services/*/.env + + - name: Build & Push Docker Image + shell: bash run: | - docker push ${{ steps.parse.outputs.image_name }}:latest - docker push ${{ steps.parse.outputs.image_name }}:${{ steps.parse.outputs.version }} + echo "Building and pushing image for ${{ github.ref_name }}" + bin/build-and-push.sh ${{ github.ref_name }} From b68f0238bd266d37243f8962f431bb6d7530c460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:48:41 +0200 Subject: [PATCH 14/15] build(affiliation-rnsr): Get back to original Dockerfile --- services/affiliation-rnsr/Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 53543707a..6fd9f738d 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -10,13 +10,9 @@ RUN --mount=type=secret,id=webdav_login \ dvc init && \ dvc remote add -d webdav-remote "$(cat /run/secrets/webdav_url)" && \ dvc remote modify --local webdav-remote user "$(cat /run/secrets/webdav_login)" && \ - dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" && \ - dvc remote modify --local webdav-remote timeout 120 + dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" COPY ./v3/affiliation/models.dvc /dvc -RUN mkdir -p .dvc/cache -RUN dvc doctor -RUN dvc status -v RUN dvc pull -v FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13 From 13b48afedfbe748f63e6c5a8d0cf2faddc7b8bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Parmentier?= Date: Wed, 13 May 2026 15:59:28 +0200 Subject: [PATCH 15/15] build(affiliation-rnsr): Add --allow-missing and --jobs 1 --- services/affiliation-rnsr/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/affiliation-rnsr/Dockerfile b/services/affiliation-rnsr/Dockerfile index 6fd9f738d..063a69343 100644 --- a/services/affiliation-rnsr/Dockerfile +++ b/services/affiliation-rnsr/Dockerfile @@ -13,7 +13,7 @@ RUN --mount=type=secret,id=webdav_login \ dvc remote modify --local webdav-remote password "$(cat /run/secrets/webdav_password)" COPY ./v3/affiliation/models.dvc /dvc -RUN dvc pull -v +RUN dvc pull --allow-missing --jobs 1 --verbose FROM cnrsinist/ezs-python-server:py3.9-no24-1.0.13