diff --git a/integration_tests.py b/integration_tests.py index e04d4ffb723..9ffc041d2ae 100755 --- a/integration_tests.py +++ b/integration_tests.py @@ -348,13 +348,6 @@ def install_server(): """Install DIRAC in the server container.""" _check_containers_running() - typer.secho("Running server installation", fg=c.GREEN) - base_cmd = _build_docker_cmd("server", tty=False) - subprocess.run( - base_cmd + ["bash", "/home/dirac/LocalRepo/TestCode/DIRAC/tests/CI/install_server.sh"], - check=True, - ) - # This runs a continuous loop that exports the config in yaml # for the diracx container to use typer.secho("Starting configuration export loop for diracx", fg=c.GREEN) @@ -364,6 +357,13 @@ def install_server(): check=True, ) + typer.secho("Running server installation", fg=c.GREEN) + base_cmd = _build_docker_cmd("server", tty=False) + subprocess.run( + base_cmd + ["bash", "/home/dirac/LocalRepo/TestCode/DIRAC/tests/CI/install_server.sh"], + check=True, + ) + typer.secho("Copying credentials and certificates", fg=c.GREEN) base_cmd = _build_docker_cmd("client", tty=False) subprocess.run( diff --git a/tests/CI/docker-compose.yml b/tests/CI/docker-compose.yml index eb0c1892438..92289233b21 100644 --- a/tests/CI/docker-compose.yml +++ b/tests/CI/docker-compose.yml @@ -136,7 +136,7 @@ services: - diracx-cs-store:/cs_store/ - diracx-key-store:/signing-key/ entrypoint: | - /dockerMicroMambaEntrypoint.sh bash -xc 'dirac internal generate-cs /cs_store/initialRepo --vo=vo --user-group=dirac_user --idp-url=http://dsdsd.csds/a/b && dirac internal add-user /cs_store/initialRepo --vo vo --user-group dirac_user --sub vo:35632895-df94-45de-acaa-43185c822a16 --dn "/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser" --preferred-username ciuser && dirac internal add-user /cs_store/initialRepo --vo vo --user-group dirac_user --sub vo:e3784483-c854-4258-9bd4-200959db1208 --dn "/C=ch/O=DIRAC/OU=DIRAC CI/CN=ciuser" --preferred-username adminusername' + /dockerMicroMambaEntrypoint.sh bash -xc 'dirac internal generate-cs /cs_store/initialRepo --vo=vo --user-group=dirac_user --idp-url=http://dsdsd.csds/a/b' pull_policy: always diracx-init-db: @@ -162,7 +162,7 @@ services: - DIRACX_DB_URL_SANDBOXMETADATADB=mysql+aiomysql://Dirac:Dirac@mysql/SandboxMetadataDB - DIRACX_SERVICE_AUTH_TOKEN_KEY=file:///signing-key/rs256.key - DIRACX_SERVICE_AUTH_ALLOWED_REDIRECTS=["http://diracx:8000/docs/oauth2-redirect"] - # Obtained with echo 'InsecureChangeMe' | base64 -d | openssl sha512 + # Obtained with echo 'InsecureChangeMe' | base64 -d | openssl sha256 - DIRACX_LEGACY_EXCHANGE_HASHED_API_KEY=07cddf6948d316ac9d186544dc3120c4c6697d8f994619665985c0a5bf76265a ports: - 8000:8000 diff --git a/tests/CI/exportCSLoop.sh b/tests/CI/exportCSLoop.sh index 5295dcc7eef..4e88325c7a4 100755 --- a/tests/CI/exportCSLoop.sh +++ b/tests/CI/exportCSLoop.sh @@ -2,14 +2,22 @@ # This script will export to the `Production.cfg` file to the # yaml format for diracx every 5 seconds set -x -exec >/tmp/cs-loop.log 2>&1 +exec >>/tmp/cs-loop.log 2>&1 +while [[ ! -f /home/dirac/ServerInstallDIR/bashrc ]]; do + sleep 1; +done +sleep 1; source /home/dirac/ServerInstallDIR/bashrc + git config --global user.name "DIRAC Server CI" git config --global user.email "dirac-server-ci@invalid" while true; do curl -L https://gitlab.cern.ch/chaen/chris-hackaton-cs/-/raw/integration-tests/convert-from-legacy.py |DIRAC_COMPAT_ENABLE_CS_CONVERSION=True /home/dirac/ServerInstallDIR/diracos/bin/python - /home/dirac/ServerInstallDIR/etc/Production.cfg /cs_store/initialRepo/ git --git-dir=.git -C /cs_store/initialRepo/ commit -am "export $(date)" + if [[ "${1}" == "--once" ]]; then + break + fi sleep 5; done