Skip to content

test (CI): give diracx-init-db a URL for every DiracX DB - #8827

Merged
fstagni merged 3 commits into
DIRACGrid:integrationfrom
aldbr:ci/diracx-all-db-urls
Oct 19, 2026
Merged

fstagni merged 3 commits into
DIRACGrid:integrationfrom
aldbr:ci/diracx-all-db-urls

Conversation

@aldbr

@aldbr aldbr commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

DiracX is about to require a URL for every registered DB entry point, instead of silently skipping the ones that are not set (DIRACGrid/diracx#1034, following DIRACGrid/diracx-charts#280).

In the integration setup, diracx-init-db only sets DIRACX_DB_URL_AUTHDB. With the stricter DiracX, python -m diracx.db init-sql fails with TaskDB found but no URL connection set, so the diracx container never starts.

Changes to tests/CI/docker-compose.yml:

  • create a DiracXTaskDB database and set DIRACX_DB_URL_TASKDB on diracx-init-db and diracx
  • on diracx-init-db, point the DBs shared with DIRAC to sqlite+aiosqlite:///:memory:: this satisfies the URL check without DiracX creating tables in DIRAC's databases (DIRAC creates e.g. the TaskQueueDB tables itself, at service start)
  • drop init-os from diracx-init-db, it had nothing to initialise before either

This also works with the current DiracX, so it should be merged before DIRACGrid/diracx#1034, whose integration job clones DIRAC integration. Same change for rel-v9r0: #8828.

BEGINRELEASENOTES
*tests
CHANGE: diracx-init-db sets a URL for every DiracX DB, initialising only the DiracX-owned ones in MySQL
ENDRELEASENOTES

🤖 Generated with Claude Code

aldbr and others added 3 commits October 15, 2026 14:18
DiracX is about to require a URL for every registered DB entry point
(DIRACGrid/diracx#1034) instead of silently skipping the unset ones.
diracx-init-db only set the AuthDB URL, so init-sql/init-os would fail
on TaskDB, JobDB, ... and the diracx service would never start.

- create DiracXTaskDB and set DIRACX_DB_URL_TASKDB on init-db and diracx
- set the DIRAC-shared SQL DB URLs and the JobParametersDB OS URL on init-db
- start init-db after diracx-wait-for-db (DIRAC creates the shared DBs)
  and once opensearch is healthy

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Running init-sql against the DBs shared with DIRAC created DiracX tables
before DIRAC did: TaskQueueDB.sql has no tables, so tq_TaskQueues was
created by DiracX (signed TQId) and DIRAC then failed to add
tq_RAM_requirements (unsigned foreign key, MySQL error 3780).

Only initialise the DiracX-owned DBs (AuthDB, TaskDB) in MySQL, point the
shared ones to in-memory SQLite to satisfy DiracX's URL check, drop
init-os and restore the original start order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A value ending with a colon is parsed by YAML as a mapping, which docker
compose rejects (environment.[2]: unexpected type map).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aldbr
aldbr force-pushed the ci/diracx-all-db-urls branch from 9749ca6 to 6be8f42 Compare October 15, 2026 12:18
@fstagni
fstagni merged commit 53661ba into DIRACGrid:integration Oct 19, 2026
25 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better error reporting when DB_URL env variables are missing

3 participants