fix(render): invoke entrypoint in deployment command

Co-authored-by: Patrick Veverka <296341601+patrickatrender@users.noreply.github.com>
This commit is contained in:
chengyongruandPatrick Veverka authored and chengyongru committed 2026-11-09 15:19:28 +08:00
1 parent bbbc5329bb
commit 86c98c8cf2
4 files changed
+16 -10

No files matched your search

+4 -9
View File
@@ -4,15 +4,10 @@ services:
runtime: docker runtime: docker
dockerfilePath: ./Dockerfile dockerfilePath: ./Dockerfile
dockerContext: . dockerContext: .
# Render's Docker Command REPLACES the Dockerfile CMD but keeps the # Render's Docker Command replaces the image startup command. The entrypoint
# ENTRYPOINT (entrypoint.sh), so pass only the command args here — otherwise # prepares the mounted disk, drops privileges, initializes config.json from
# the entrypoint path is reinjected as an argument and nanobot fails with # render-config.json if needed, and appends --config.
# "No such command /usr/local/bin/entrypoint.sh". When RENDER=true the dockerCommand: /usr/local/bin/entrypoint.sh gateway
# 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
# Deploy-to-Render templates should not auto-deploy on every repo push # Deploy-to-Render templates should not auto-deploy on every repo push
# (Render's recommendation); trigger deploys manually or via the Dashboard. # (Render's recommendation); trigger deploys manually or via the Dashboard.
autoDeploy: false autoDeploy: false
+2 -1
View File
@@ -39,6 +39,7 @@ RULES = (
(("pyproject.toml", "uv.lock", "hatch_build.py", "nanobot/webui/build.py", "scripts/install*", (("pyproject.toml", "uv.lock", "hatch_build.py", "nanobot/webui/build.py", "scripts/install*",
"scripts/build*"), ALL, "cross-domain dependency, build or installation contract"), "scripts/build*"), ALL, "cross-domain dependency, build or installation contract"),
(("tests/test_docker*.py",), PYTHON | DOCKER, "Docker Python regression tests"), (("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", (("Dockerfile", "Dockerfile.*", ".dockerignore", "docker-compose*.yml", "entrypoint.sh",
"render-config.json", "README.md", "LICENSE", "THIRD_PARTY_NOTICES.md", "render-config.json", "README.md", "LICENSE", "THIRD_PARTY_NOTICES.md",
"tests/test_docker*", "scripts/docker_compose_smoke.py"), DOCKER, "Docker input or acceptance"), "tests/test_docker*", "scripts/docker_compose_smoke.py"), DOCKER, "Docker input or acceptance"),
@@ -53,7 +54,7 @@ RULES = (
frozenset(), "test fixture provenance and license"), frozenset(), "test fixture provenance and license"),
(("docs/*", ".agent/*", ".github/ISSUE_TEMPLATE/*", "AGENTS.md", "CLAUDE.md", (("docs/*", ".agent/*", ".github/ISSUE_TEMPLATE/*", "AGENTS.md", "CLAUDE.md",
"COMMUNICATION.md", "CONTRIBUTING.md", "SECURITY.md", "webui/README.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"), (("scripts/check_client_import_boundaries.*",), WEBUI | TUI, "shared client import boundary checker"),
(("packages/client-events/*",), WEBUI | TUI | DOCKER, "shared client event protocol"), (("packages/client-events/*",), WEBUI | TUI | DOCKER, "shared client event protocol"),
(("webui/*", "nanobot/channels/*/webui/*", "nanobot/channels/*/tests/webui/*"), (("webui/*", "nanobot/channels/*/webui/*", "nanobot/channels/*/tests/webui/*"),
+1
View File
@@ -25,6 +25,7 @@ def selected(result):
("README.md", {"docker"}), ("README.md", {"docker"}),
("Dockerfile", {"docker"}), ("Dockerfile", {"docker"}),
("entrypoint.sh", {"docker"}), ("entrypoint.sh", {"docker"}),
("render.yaml", {"python"}),
("tests/test_docker_config.py", {"python", "docker"}), ("tests/test_docker_config.py", {"python", "docker"}),
("tests/test_docker_smoke.py", {"python", "docker"}), ("tests/test_docker_smoke.py", {"python", "docker"}),
("tests/test_docker.sh", {"docker"}), ("tests/test_docker.sh", {"docker"}),
+9
View File
@@ -1,10 +1,12 @@
import json import json
import os import os
import shlex
import subprocess import subprocess
import sys import sys
from pathlib import Path from pathlib import Path
import pytest import pytest
import yaml
from nanobot.channels.websocket.runtime import WebSocketConfig from nanobot.channels.websocket.runtime import WebSocketConfig
from nanobot.config.loader import load_config, resolve_config_env_vars 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): def test_first_boot_generates_valid_container_config(tmp_path):
path = tmp_path / "instance" / "config.json" path = tmp_path / "instance" / "config.json"
result = _initialize(path) result = _initialize(path)