mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 20:26:33 +00:00
Path-style invocation in scripts/system/network/dns/common.sh failed with `ImportError: attempted relative import with no known parent package` because cli/meta/domains/__main__.py uses `from . import PROJECT_ROOT`. The DNS host generator silently fell back to a static 3-host list on every bootstrap run (visible in the test-development CI logs). Switch the caller to `PYTHONPATH=<repo> python3 -m cli.meta.domains` so the package context resolves. Keeps the PROJECT_ROOT SPOT (tests/lint/filesystem/python/test_project_root_import.py) intact — no local redefinition. Also: one-line YAML rewrap in compose/cache.override.yml (formatter).
141 lines
6.7 KiB
YAML
141 lines
6.7 KiB
YAML
---
|
|
# Layered on compose.yml by the dev tooling when the cache stack is
|
|
# active. See docs/contributing/environment/cache.md.
|
|
|
|
services:
|
|
registry-cache:
|
|
image: rpardini/docker-registry-proxy:0.6.5
|
|
container_name: infinito-registry-cache
|
|
environment:
|
|
ENABLE_MANIFEST_CACHE: "true"
|
|
AUTH_REGISTRIES: ""
|
|
CACHE_MAX_SIZE: "${INFINITO_CACHE_REGISTRY_MAX_SIZE:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
# Avoid 502s on hosts with broken IPv6 outbound.
|
|
DISABLE_IPV6: "true"
|
|
volumes:
|
|
- type: bind
|
|
source: ${INFINITO_CACHE_REGISTRY_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
|
|
target: /docker_mirror_cache
|
|
bind:
|
|
create_host_path: true
|
|
- type: bind
|
|
source: ${INFINITO_CACHE_REGISTRY_CA_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
|
|
target: /ca
|
|
bind:
|
|
create_host_path: true
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- "wget -qO- http://127.0.0.1:3128/ca.crt >/dev/null 2>&1"
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 30
|
|
start_period: 30s
|
|
restart: unless-stopped
|
|
|
|
package-cache:
|
|
image: sonatype/nexus3:3.91.1-ubi
|
|
container_name: infinito-package-cache
|
|
# Run as root: fresh bind-mount is root:root and Nexus aborts otherwise.
|
|
user: "0:0"
|
|
environment:
|
|
INSTALL4J_ADD_VM_PARAMS: "-Xms${INFINITO_CACHE_PACKAGE_HEAP:?Run 'make dotenv' to generate the .env single source of truth} -Xmx${INFINITO_CACHE_PACKAGE_HEAP:?Run
|
|
'make dotenv' to generate the .env single source of truth} -XX:MaxDirectMemorySize=${INFINITO_CACHE_PACKAGE_DIRECT_MEM:?Run 'make dotenv' to generate the
|
|
.env single source of truth}"
|
|
# Random-password mode leaves no readable secret for the bootstrap.
|
|
NEXUS_SECURITY_RANDOMPASSWORD: "false"
|
|
volumes:
|
|
- type: bind
|
|
source: ${INFINITO_CACHE_PACKAGE_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
|
|
target: /nexus-data
|
|
bind:
|
|
create_host_path: true
|
|
ports:
|
|
- "${INFINITO_BIND_IP:?Run 'make dotenv' to generate the .env single source of truth}:${INFINITO_CACHE_PACKAGE_PORT:?Run 'make dotenv' to generate the .env
|
|
single source of truth}:8081"
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- "curl -fsS http://127.0.0.1:8081/service/rest/v1/status >/dev/null"
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 60
|
|
start_period: 120s
|
|
restart: unless-stopped
|
|
|
|
package-cache-frontend:
|
|
image: nginx:1.27-alpine
|
|
container_name: infinito-package-cache-frontend
|
|
depends_on:
|
|
package-cache:
|
|
condition: service_healthy
|
|
volumes:
|
|
- type: bind
|
|
source: ${INFINITO_CACHE_PACKAGE_FRONTEND_CA_DIR:?Run 'make dotenv' to generate the .env single source of truth}
|
|
target: /etc/nginx/ca
|
|
read_only: true
|
|
bind:
|
|
create_host_path: true
|
|
- type: bind
|
|
source: ${INFINITO_CACHE_PACKAGE_FRONTEND_CERTS_DIR:?Run 'make dotenv' to generate the .env single source of truth}
|
|
target: /etc/nginx/certs
|
|
read_only: true
|
|
bind:
|
|
create_host_path: true
|
|
- ./compose/package-cache-frontend/upstreams.conf:/etc/nginx/conf.d/upstreams.conf:ro
|
|
networks:
|
|
default:
|
|
ipv4_address: ${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}
|
|
healthcheck:
|
|
test:
|
|
- CMD-SHELL
|
|
- "wget -qO- --no-check-certificate https://127.0.0.1/ --header 'Host: pypi.org' >/dev/null 2>&1 || exit 0"
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 30
|
|
start_period: 10s
|
|
restart: unless-stopped
|
|
|
|
infinito:
|
|
depends_on:
|
|
registry-cache:
|
|
condition: service_healthy
|
|
required: false
|
|
package-cache:
|
|
condition: service_healthy
|
|
required: false
|
|
package-cache-frontend:
|
|
condition: service_healthy
|
|
required: false
|
|
environment:
|
|
INFINITO_CACHE_PACKAGE_FRONTEND_IP: ${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}
|
|
extra_hosts:
|
|
- "pypi.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "files.pythonhosted.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "registry.npmjs.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "rubygems.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "index.rubygems.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "repo.packagist.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "proxy.golang.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "dl-cdn.alpinelinux.org:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "raw.githubusercontent.com:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
- "codeload.github.com:${INFINITO_CACHE_PACKAGE_FRONTEND_IP:?Run 'make dotenv' to generate the .env single source of truth}"
|
|
volumes:
|
|
- type: bind
|
|
source: ${INFINITO_CACHE_REGISTRY_CA_HOST_PATH:?Run 'make dotenv' to generate the .env single source of truth}
|
|
target: /opt/registry-cache-ca
|
|
read_only: true
|
|
bind:
|
|
create_host_path: true
|
|
- ${INFINITO_CACHE_REGISTRY_PROXY_CONF:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make
|
|
dotenv')}:/etc/systemd/system/docker.service.d/registry-cache-proxy.conf:ro
|
|
- ./scripts/docker/cache/registry-ca.sh:/usr/local/bin/registry-cache-ca.sh:ro
|
|
- ${INFINITO_CACHE_PACKAGE_PIP_CONF:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make
|
|
dotenv')}:/etc/pip.conf:ro
|
|
- ${INFINITO_CACHE_PACKAGE_NPMRC:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make dotenv')}:/root/.npmrc:ro
|
|
- ${INFINITO_CACHE_PACKAGE_APT_LIST:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make
|
|
dotenv')}:/etc/apt/sources.list.d/package-cache.list:ro
|
|
- ${INFINITO_CACHE_PACKAGE_FRONTEND_CA_FILE:?Set by 'cli deploy development up' / 'make compose-up' (driver-injected, not produced by 'make
|
|
dotenv')}:/opt/package-frontend-ca.crt:ro
|
|
- ./scripts/docker/cache/package-frontend-ca.sh:/usr/local/bin/package-frontend-ca.sh:ro
|