Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions services/agent/src/simcore_service_agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
from fastapi import FastAPI
from servicelib.fastapi.logging_lifespan import create_logging_shutdown_event
from servicelib.tracing import TracingConfig
from simcore_service_agent._meta import APP_NAME
from simcore_service_agent.core.application import create_app
from simcore_service_agent.core.settings import ApplicationSettings

from ._meta import APP_NAME

_logger = logging.getLogger(__name__)

_NOISY_LOGGERS: Final[tuple[str, ...]] = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from fastapi import FastAPI
from servicelib.fastapi.logging_lifespan import create_logging_shutdown_event
from servicelib.tracing import TracingConfig
from simcore_service_api_server._meta import APP_NAME
from simcore_service_api_server.core.application import create_app
from simcore_service_api_server.core.settings import ApplicationSettings

from ._meta import APP_NAME

_logger = logging.getLogger(__name__)

_NOISY_LOGGERS: Final[tuple[str, ...]] = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from fastapi import FastAPI
from servicelib import tracing
from servicelib.fastapi.logging_lifespan import create_logging_shutdown_event
from simcore_service_autoscaling._meta import APP_NAME
from simcore_service_autoscaling.core.application import create_app
from simcore_service_autoscaling.core.settings import ApplicationSettings

from ._meta import APP_NAME

_logger = logging.getLogger(__name__)

_NOISY_LOGGERS: Final[tuple[str, ...]] = (
Expand Down
42 changes: 21 additions & 21 deletions services/docker-compose.devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# NOTES:
# - port 3000 used for ptsv
#
x-common-environment: &common-environment
x-common_environment: &common_environment
# Enforces *_DEBUG option in all services. ONLY allowed in devel-mode!
DEBUG : "true"
# Enforces app to boot debug mode (see docker/boot.sh). ONLY allowed in devel-mode!
Expand All @@ -13,7 +13,7 @@ x-common-environment: &common-environment
services:
api-server:
environment:
<<: *common-environment
<<: *common_environment
API_SERVER_PROFILING : ${API_SERVER_PROFILING}
API_SERVER_LOGLEVEL: DEBUG
volumes:
Expand All @@ -23,7 +23,7 @@ services:

api-worker:
environment:
<<: *common-environment
<<: *common_environment
API_SERVER_PROFILING : ${API_SERVER_PROFILING}
API_SERVER_LOGLEVEL: DEBUG
volumes:
Expand All @@ -33,7 +33,7 @@ services:

autoscaling:
environment:
<<: *common-environment
<<: *common_environment
AUTOSCALING_LOGLEVEL: DEBUG

volumes:
Expand All @@ -43,7 +43,7 @@ services:

invitations:
environment:
<<: *common-environment
<<: *common_environment
INVITATIONS_LOGLEVEL: DEBUG
volumes:
- ./invitations:/devel/services/invitations
Expand All @@ -52,7 +52,7 @@ services:

payments:
environment:
<<: *common-environment
<<: *common_environment
PAYMENTS_LOGLEVEL: DEBUG
volumes:
- ./payments:/devel/services/payments
Expand All @@ -61,7 +61,7 @@ services:

dynamic-schdlr:
environment:
<<: *common-environment
<<: *common_environment
DYNAMIC_SCHEDULER_PROFILING : ${DYNAMIC_SCHEDULER_PROFILING}
DYNAMIC_SCHEDULER_LOGLEVEL: DEBUG
volumes:
Expand All @@ -73,7 +73,7 @@ services:

catalog:
environment:
<<: *common-environment
<<: *common_environment
CATALOG_PROFILING : ${CATALOG_PROFILING}
DYNAMIC_SIDECAR_MOUNT_PATH_DEV : ${PWD}/services/dynamic-sidecar
CATALOG_LOGLEVEL: DEBUG
Expand All @@ -84,7 +84,7 @@ services:

notifications:
environment:
<<: *common-environment
<<: *common_environment
NOTIFICATIONS_PROFILING : ${NOTIFICATIONS_PROFILING}
NOTIFICATIONS_LOGLEVEL: DEBUG
volumes:
Expand All @@ -94,7 +94,7 @@ services:

clusters-keeper:
environment:
<<: *common-environment
<<: *common_environment
CLUSTERS_KEEPER_LOGLEVEL: DEBUG
volumes:
- ./clusters-keeper:/devel/services/clusters-keeper
Expand All @@ -103,7 +103,7 @@ services:

datcore-adapter:
environment:
<<: *common-environment
<<: *common_environment
DATCORE_ADAPTER_LOGLEVEL: DEBUG
volumes:
- ./datcore-adapter:/devel/services/datcore-adapter
Expand All @@ -121,7 +121,7 @@ services:

director-v2:
environment:
<<: *common-environment
<<: *common_environment
DIRECTOR_V2_PROFILING : ${DIRECTOR_V2_PROFILING}
DYNAMIC_SIDECAR_MOUNT_PATH_DEV : ${PWD}/services/dynamic-sidecar
DIRECTOR_V2_LOGLEVEL: DEBUG
Expand All @@ -133,7 +133,7 @@ services:

efs-guardian:
environment:
<<: *common-environment
<<: *common_environment
EFS_GUARDIAN_LOGLEVEL: DEBUG
volumes:
- ./efs-guardian:/devel/services/efs-guardian
Expand All @@ -155,7 +155,7 @@ services:
- ../packages:/devel/packages
- ${HOST_UV_CACHE_DIR}:/home/scu/.cache/uv
environment: &webserver_environment_devel
<<: *common-environment
<<: *common_environment
DEBUG: 1 # NOTE: gunicorn expects an int not a boolean
WEBSERVER_LOGLEVEL: DEBUG
WEBSERVER_PROFILING: ${WEBSERVER_PROFILING}
Expand Down Expand Up @@ -192,7 +192,7 @@ services:
- ${ETC_HOSTNAME:-/etc/hostname}:/home/scu/hostname:ro

environment:
<<: *common-environment
<<: *common_environment
SIDECAR_LOGLEVEL: DEBUG
ports:
- "3000"
Expand All @@ -202,7 +202,7 @@ services:
dask-scheduler:
volumes: *dask-sidecar_volumes_devel
environment:
<<: *common-environment
<<: *common_environment
SIDECAR_LOGLEVEL: DEBUG
ports:
- "3000"
Expand All @@ -212,7 +212,7 @@ services:

resource-usage-tracker:
environment:
<<: *common-environment
<<: *common_environment
RESOURCE_USAGE_TRACKER_LOGLEVEL: DEBUG
volumes:
- ./resource-usage-tracker:/devel/services/resource-usage-tracker
Expand All @@ -225,7 +225,7 @@ services:
- ../packages:/devel/packages
- ${HOST_UV_CACHE_DIR}:/home/scu/.cache/uv
environment:
<<: *common-environment
<<: *common_environment
STORAGE_PROFILING : ${STORAGE_PROFILING}
STORAGE_LOGLEVEL: DEBUG

Expand All @@ -235,7 +235,7 @@ services:
- ../packages:/devel/packages
- ${HOST_UV_CACHE_DIR}:/home/scu/.cache/uv
environment:
<<: *common-environment
<<: *common_environment
STORAGE_PROFILING : ${STORAGE_PROFILING}
STORAGE_LOGLEVEL: DEBUG

Expand All @@ -245,13 +245,13 @@ services:
- ../packages:/devel/packages
- ${HOST_UV_CACHE_DIR}:/home/scu/.cache/uv
environment:
<<: *common-environment
<<: *common_environment
STORAGE_PROFILING : ${STORAGE_PROFILING}
STORAGE_LOGLEVEL: DEBUG

agent:
environment:
<<: *common-environment
<<: *common_environment
AGENT_LOGLEVEL: DEBUG
volumes:
- ./agent:/devel/services/agent
Expand Down
7 changes: 2 additions & 5 deletions services/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#
x-common-environment: &common_environment
SWARM_STACK_NAME : ${SWARM_STACK_NAME:-simcore_local}


services:
api-server:
environment:
Expand Down Expand Up @@ -297,8 +299,3 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.rule=PathPrefix(`/whoami`)
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.entrypoints=traefik_monitor
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.middlewares=${SWARM_STACK_NAME}_gzip@swarm

networks:
docker-api-network:
driver_opts:
{} # override 'encrypted' locally, some WSL versions have issues with encrypted networks SEE https://github.com/microsoft/WSL/issues/10029
8 changes: 4 additions & 4 deletions services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ services:
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
networks:
- default
- docker-api-network
- docker_api_subnet
environment:
<<:
- *common_logging_environments
Expand Down Expand Up @@ -603,7 +603,7 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- docker-api-network
- docker_api_subnet

static-webserver:
image: ${DOCKER_REGISTRY:-itisfoundation}/static-webserver:${DOCKER_IMAGE_TAG:-latest}
Expand Down Expand Up @@ -1557,8 +1557,8 @@ networks:
internal: false
labels:
com.simcore.description: "computational services network"
docker-api-network:
name: ${SWARM_STACK_NAME}_docker-api-network
docker_api_subnet:
name: ${SWARM_STACK_NAME}_docker_api_subnet
driver: overlay
attachable: true
internal: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
create_logging_lifespan,
)
from servicelib.tracing import TracingConfig
from simcore_service_dynamic_scheduler._meta import APP_NAME
from simcore_service_dynamic_scheduler.core.application import create_app
from simcore_service_dynamic_scheduler.core.settings import ApplicationSettings

from ._meta import APP_NAME

_logger = logging.getLogger(__name__)

_NOISY_LOGGERS: Final[tuple[str, ...]] = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
from fastapi import FastAPI
from servicelib.fastapi.logging_lifespan import create_logging_lifespan
from servicelib.tracing import TracingConfig
from simcore_service_notifications._meta import APP_NAME
from simcore_service_notifications.core.application import create_app
from simcore_service_notifications.core.settings import (
ApplicationSettings,
)

from ._meta import APP_NAME

_logger = logging.getLogger(__name__)

_NOISY_LOGGERS: Final[tuple[str, ...]] = (
Expand Down
3 changes: 1 addition & 2 deletions services/storage/src/simcore_service_storage/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
from fastapi import FastAPI
from servicelib.fastapi.logging_lifespan import create_logging_shutdown_event
from servicelib.tracing import TracingConfig
from simcore_service_storage._meta import APP_NAME
from simcore_service_storage.core.application import create_app
from simcore_service_storage.core.settings import ApplicationSettings

from ._meta import APP_NAME

_logger = logging.getLogger(__name__)

_NOISY_LOGGERS: Final[tuple[str, ...]] = (
Expand Down
36 changes: 32 additions & 4 deletions tests/environment-setup/test_used_docker_compose.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=unused-argument
# pylint: disable=bare-except
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=too-many-arguments

import re
import shutil
Expand Down Expand Up @@ -110,7 +111,7 @@ def docker_compose_config_bash(osparc_simcore_scripts_dir: Path) -> Path:
def test_validate_compose_file(
compose_path: Path,
env_devel_file: Path,
ensure_env_file,
ensure_env_file: Path,
docker_compose_config_bash: Path,
):
assert compose_path.exists()
Expand All @@ -119,7 +120,7 @@ def test_validate_compose_file(

# NOTE: with docker stack config, the .env file MUST be alongside the docker-compose file

subprocess.run(
subprocess.run( # noqa: S602
" ".join(
[
f"{docker_compose_config_bash}",
Expand All @@ -135,3 +136,30 @@ def test_validate_compose_file(

# About versioning https://docs.docker.com/compose/compose-file/compose-file-v3/
assert "version" not in compose


@pytest.mark.parametrize(
"compose_path", compose_paths, ids=lambda p: str(p.relative_to(repo_dir))
)
def test_network_names_contain_only_letters_and_underscores(
compose_path: Path,
):
"""Ensure all network names only contain letters and underscores (no hyphens or other symbols).


NOTE: Our docker compose cannot resolve network names with hyphens

e.g. `make .stack-simcore-development.yml` produces a compose file that do not include these networks which
results in an error when the stack starts that prints something like

ERROR: failed to create service master-simcore_docker-api-proxy: Error response from daemon: network master-simcore_docker-api-network not found
"""
assert compose_path.exists()
compose = yaml.safe_load(compose_path.read_text())

networks = compose.get("networks", {})

for network_name in networks:
assert re.match(
r"^[a-zA-Z_]+$", network_name
), f"Network name '{network_name}' in {compose_path.relative_to(repo_dir)} contains invalid characters. Only letters and underscores are allowed."
Loading