Skip to content

Commit

Permalink
dynamically mount diracx
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Sep 1, 2023
1 parent 7292c60 commit 8813b1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ def _gen_docker_compose(modules):
# Load the docker-compose configuration and mount the necessary volumes
input_fn = Path(__file__).parent / "tests/CI/docker-compose.yml"
docker_compose = yaml.safe_load(input_fn.read_text())
# dirac-init-db needs the volume to be able to run the witing script
for ctn in ("dirac-server", "dirac-client", "dirac-init-db"):
if "volumes" not in docker_compose["services"][ctn]:
docker_compose["services"][ctn]["volumes"] = []
Expand All @@ -546,8 +547,14 @@ def _gen_docker_compose(modules):
docker_compose["services"]["dirac-client"]["volumes"].extend(volumes[:])
docker_compose["services"]["dirac-init-db"]["volumes"].extend(volumes[:])

module_configs = _load_module_configs(modules)
if "diracx" in module_configs:
docker_compose["services"]["diracx"]["volumes"].append(
f"{modules['diracx']}/src/diracx:{module_configs['diracx']['install-location']}"
)

# Add any extension services
for module_name, module_configs in _load_module_configs(modules).items():
for module_name, module_configs in module_configs.items():
for service_name, service_config in module_configs["extra-services"].items():
typer.secho(f"Adding service {service_name} for {module_name}", err=True, fg=c.GREEN)
docker_compose["services"][service_name] = service_config.copy()
Expand Down
2 changes: 1 addition & 1 deletion tests/CI/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ services:
volumes:
- diracx-cs-store:/cs_store/
- diracx-key-store:/signing-key/
- /home/chaen/dirac/diracx-project/diracx/src/diracx/:/opt/conda/lib/python3.11/site-packages/diracx
# - /home/chaen/dirac/diracx-project/diracx/src/diracx/:/opt/conda/lib/python3.11/site-packages/diracx

healthcheck:
test: ["CMD", "/dockerMicroMambaEntrypoint.sh", "curl", "-f", "http://localhost:8000/.well-known/openid-configuration"]
Expand Down

0 comments on commit 8813b1a

Please sign in to comment.