fix: remove distribution-specific logic from Containerfile

The Containerfile should be generic and not contain conditionals tied to
specific distributions. Instead, users specify which config to use via
command-line arguments.

Changes:
- Removed ENABLE_POSTGRES_STORE conditional from entrypoint
- Updated docs to show proper usage: passing config as argument
  Example: llama stack run starter::run-with-postgres-store.yaml
- Maintains generic, reusable container entrypoint

This follows the principle of separation of concerns - the container
provides the runtime, while the user specifies the configuration.
This commit is contained in:
Roy Belio 2025-11-05 19:10:58 +02:00
parent 2efaecd887
commit 68d39bb2a7
2 changed files with 7 additions and 9 deletions

View file

@ -135,11 +135,6 @@ RUN cat <<'EOF' >/usr/local/bin/llama-stack-entrypoint.sh
#!/bin/sh
set -e
# Check if ENABLE_POSTGRES_STORE is set to switch to postgres config
if [ "${ENABLE_POSTGRES_STORE:-}" = "1" ] && [ "$DISTRO_NAME" = "starter" ]; then
exec llama stack run "starter::run-with-postgres-store.yaml" "$@"
fi
if [ -n "$RUN_CONFIG_PATH" ] && [ -f "$RUN_CONFIG_PATH" ]; then
exec llama stack run "$RUN_CONFIG_PATH" "$@"
fi

View file

@ -170,8 +170,7 @@ The container will run the distribution with a SQLite store by default. This sto
- Agents store: store agent configurations (sessions, turns, etc.)
- Agents Responses store: store responses from the agents
However, you can override the default behavior by setting the `ENABLE_POSTGRES_STORE` environment variable to `1`.
To run the distribution with a Postgres store, you can use the following command:
However, you can use PostgreSQL instead by running the `starter::run-with-postgres-store.yaml` configuration:
```bash
docker run \
@ -186,7 +185,8 @@ docker run \
-e POSTGRES_DB=your_postgres_db \
-e POSTGRES_USER=your_postgres_user \
-e POSTGRES_PASSWORD=your_postgres_password \
-e ENABLE_POSTGRES_STORE=1
llamastack/distribution-starter \
starter::run-with-postgres-store.yaml
```
Postgres environment variables:
@ -205,8 +205,11 @@ Ensure you have configured the starter distribution using the environment variab
# Install dependencies for the starter distribution
uv run --with llama-stack llama stack list-deps starter | xargs -L1 uv pip install
# Run the server
# Run the server (with SQLite - default)
uv run --with llama-stack llama stack run starter
# Or run with PostgreSQL
uv run --with llama-stack llama stack run starter::run-with-postgres-store.yaml
```
## Example Usage