Skip to content

Commit

Permalink
Start CS loop before running server install script
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Sep 29, 2023
1 parent 5753e66 commit 5be0bb9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
14 changes: 7 additions & 7 deletions integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions tests/CI/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
10 changes: 9 additions & 1 deletion tests/CI/exportCSLoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5be0bb9

Please sign in to comment.