diff --git a/render.yaml b/render.yaml index 1f9d1826d..91e3d7d05 100644 --- a/render.yaml +++ b/render.yaml @@ -4,15 +4,10 @@ services: runtime: docker dockerfilePath: ./Dockerfile dockerContext: . - # Render's Docker Command REPLACES the Dockerfile CMD but keeps the - # ENTRYPOINT (entrypoint.sh), so pass only the command args here — otherwise - # the entrypoint path is reinjected as an argument and nanobot fails with - # "No such command /usr/local/bin/entrypoint.sh". When RENDER=true the - # entrypoint initializes render-config.json on the mounted disk at - # $HOME/.nanobot/config.json (so the runtime data_dir lands on the persistent - # disk), chowns the root-owned mount, drops to the non-root nanobot user, and - # appends the --config flag itself. - dockerCommand: gateway + # Render's Docker Command replaces the image startup command. The entrypoint + # prepares the mounted disk, drops privileges, initializes config.json from + # render-config.json if needed, and appends --config. + dockerCommand: /usr/local/bin/entrypoint.sh gateway # Deploy-to-Render templates should not auto-deploy on every repo push # (Render's recommendation); trigger deploys manually or via the Dashboard. autoDeploy: false diff --git a/scripts/ci_scope.py b/scripts/ci_scope.py index bdb5234cd..7bea004cd 100644 --- a/scripts/ci_scope.py +++ b/scripts/ci_scope.py @@ -39,6 +39,7 @@ RULES = ( (("pyproject.toml", "uv.lock", "hatch_build.py", "nanobot/webui/build.py", "scripts/install*", "scripts/build*"), ALL, "cross-domain dependency, build or installation contract"), (("tests/test_docker*.py",), PYTHON | DOCKER, "Docker Python regression tests"), + (("render.yaml",), PYTHON, "Render Blueprint startup contract"), (("Dockerfile", "Dockerfile.*", ".dockerignore", "docker-compose*.yml", "entrypoint.sh", "render-config.json", "README.md", "LICENSE", "THIRD_PARTY_NOTICES.md", "tests/test_docker*", "scripts/docker_compose_smoke.py"), DOCKER, "Docker input or acceptance"), @@ -53,7 +54,7 @@ RULES = ( frozenset(), "test fixture provenance and license"), (("docs/*", ".agent/*", ".github/ISSUE_TEMPLATE/*", "AGENTS.md", "CLAUDE.md", "COMMUNICATION.md", "CONTRIBUTING.md", "SECURITY.md", "webui/README.md", - "tui/README.md", "render.yaml", "images/*"), frozenset(), "documentation only"), + "tui/README.md", "images/*"), frozenset(), "documentation only"), (("scripts/check_client_import_boundaries.*",), WEBUI | TUI, "shared client import boundary checker"), (("packages/client-events/*",), WEBUI | TUI | DOCKER, "shared client event protocol"), (("webui/*", "nanobot/channels/*/webui/*", "nanobot/channels/*/tests/webui/*"), diff --git a/tests/scripts/test_ci_scope.py b/tests/scripts/test_ci_scope.py index e5e836f9b..4403ec757 100644 --- a/tests/scripts/test_ci_scope.py +++ b/tests/scripts/test_ci_scope.py @@ -25,6 +25,7 @@ def selected(result): ("README.md", {"docker"}), ("Dockerfile", {"docker"}), ("entrypoint.sh", {"docker"}), + ("render.yaml", {"python"}), ("tests/test_docker_config.py", {"python", "docker"}), ("tests/test_docker_smoke.py", {"python", "docker"}), ("tests/test_docker.sh", {"docker"}), diff --git a/tests/test_docker_config.py b/tests/test_docker_config.py index 9725654a0..007385e05 100644 --- a/tests/test_docker_config.py +++ b/tests/test_docker_config.py @@ -1,10 +1,12 @@ import json import os +import shlex import subprocess import sys from pathlib import Path import pytest +import yaml from nanobot.channels.websocket.runtime import WebSocketConfig from nanobot.config.loader import load_config, resolve_config_env_vars @@ -18,6 +20,13 @@ def _initialize(path: Path, web_token: str = "", api_key: str = "") -> subproces ) +def test_render_blueprint_starts_gateway_through_entrypoint(): + blueprint_path = Path(__file__).resolve().parents[1] / "render.yaml" + blueprint = yaml.safe_load(blueprint_path.read_text(encoding="utf-8")) + service = next(service for service in blueprint["services"] if service["name"] == "nanobot") + assert shlex.split(service["dockerCommand"]) == ["/usr/local/bin/entrypoint.sh", "gateway"] + + def test_first_boot_generates_valid_container_config(tmp_path): path = tmp_path / "instance" / "config.json" result = _initialize(path)