fix(render): invoke entrypoint in deployment command
Co-authored-by: Patrick Veverka <296341601+patrickatrender@users.noreply.github.com>
This commit is contained in:
1 parent
bbbc5329bb
commit
86c98c8cf2
4 files changed
+16
-10
No files matched your search
+4
-9
@@ -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
|
||||
|
||||
+2
-1
@@ -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/*"),
|
||||
|
||||
@@ -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"}),
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user