Skip to content

feat(docker_server): slim build branch (no in-image proxy)#2402

Draft
ndeepak-baseten wants to merge 4 commits into
mainfrom
ndeepak/server-proxy-beefeater
Draft

feat(docker_server): slim build branch (no in-image proxy)#2402
ndeepak-baseten wants to merge 4 commits into
mainfrom
ndeepak/server-proxy-beefeater

Conversation

@ndeepak-baseten

@ndeepak-baseten ndeepak-baseten commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

What

Adds a docker_server build that omits nginx and supervisord. Triggered by BT_USE_DOCKER_SERVER_SLIM=true. Customer's start_command runs as PID 1. Routing and probes are the deploying platform's responsibility.

Distinct from #2357: that PR keeps an external nginx in the pod (sidecar). This one assumes no nginx anywhere (in-image or sidecar). Both gates are separate env vars and can coexist.

How

  • _should_use_docker_server_slim(config) predicate gates the slim path.
  • serving_image_builder.prepare_image_build_dir skips nginx/supervisord scaffolding for slim builds.
  • server.Dockerfile.jinja adds a slim branch under config.docker_server: sets DOCKER_SERVER_SLIM and SERVER_START_CMD, switches users, runs ENTRYPOINT ["sh", "-c"] + CMD [start_command].

Transport-agnostic; the customer's start_command runs PID 1 regardless of HTTP or gRPC.

Testing

uv run pytest truss/tests/contexts/image_builder/test_serving_image_builder.py::TestDockerServerSlimBuild covers slim path (parametrized over http and grpc) and legacy fallback when env var unset.

Release requirements

  • Pre-release: none. Env var is not set by default; no-op until the platform enables it.
  • Post-release: none.
  • External communication: none.

@ndeepak-baseten ndeepak-baseten force-pushed the ndeepak/server-proxy-beefeater branch from 2526c92 to de8d45d Compare April 30, 2026 06:45
@ndeepak-baseten ndeepak-baseten changed the title feat: slim docker_server build branch for beefeater-proxied deployments feat(docker_server): slim build branch (no in-image proxy) Apr 30, 2026
Adds a docker_server build that omits nginx and supervisord. Triggered
by BT_USE_DOCKER_SERVER_SLIM=true. The customer's start_command runs as
PID 1. Routing and probes are the deploying platform's responsibility.

Distinct from the sidecar branch in #2357: that PR pairs with an
external nginx sidecar in the pod. This one assumes no nginx anywhere
(in-image or sidecar). Both can coexist; gates are separate env vars.

Transport-agnostic; the customer's start_command runs PID 1 regardless
of HTTP or gRPC.

Made-with: Cursor
Two correctness fixes for the docker_server slim build branch:

1) _should_use_docker_server_slim was using os.getenv(..., False) which
   treats any non-empty string ("false", "0", etc.) as truthy. Switch to
   explicit "true" comparison so only that exact value enables slim.

2) Add a no_build guard. no_build images ship with a customer-supplied
   ENTRYPOINT/CMD; the slim branch overrides those, so we must not enter
   it for no_build regardless of the slim flag.

Also drop the unused DOCKER_SERVER_SLIM env var from the slim Dockerfile
branch (the operator never reads it). Add unit tests for both gates.

Made-with: Cursor
Test names + parametrize values already say what each test pins.

Made-with: Cursor
@ndeepak-baseten ndeepak-baseten force-pushed the ndeepak/server-proxy-beefeater branch from a278fba to 3af0b54 Compare May 28, 2026 23:46
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant