mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 09:53:45 +00:00
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:
parent
2efaecd887
commit
68d39bb2a7
2 changed files with 7 additions and 9 deletions
|
|
@ -135,11 +135,6 @@ RUN cat <<'EOF' >/usr/local/bin/llama-stack-entrypoint.sh
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
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
|
if [ -n "$RUN_CONFIG_PATH" ] && [ -f "$RUN_CONFIG_PATH" ]; then
|
||||||
exec llama stack run "$RUN_CONFIG_PATH" "$@"
|
exec llama stack run "$RUN_CONFIG_PATH" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -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 store: store agent configurations (sessions, turns, etc.)
|
||||||
- Agents Responses store: store responses from the agents
|
- 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`.
|
However, you can use PostgreSQL instead by running the `starter::run-with-postgres-store.yaml` configuration:
|
||||||
To run the distribution with a Postgres store, you can use the following command:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run \
|
docker run \
|
||||||
|
|
@ -186,7 +185,8 @@ docker run \
|
||||||
-e POSTGRES_DB=your_postgres_db \
|
-e POSTGRES_DB=your_postgres_db \
|
||||||
-e POSTGRES_USER=your_postgres_user \
|
-e POSTGRES_USER=your_postgres_user \
|
||||||
-e POSTGRES_PASSWORD=your_postgres_password \
|
-e POSTGRES_PASSWORD=your_postgres_password \
|
||||||
-e ENABLE_POSTGRES_STORE=1
|
llamastack/distribution-starter \
|
||||||
|
starter::run-with-postgres-store.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Postgres environment variables:
|
Postgres environment variables:
|
||||||
|
|
@ -205,8 +205,11 @@ Ensure you have configured the starter distribution using the environment variab
|
||||||
# Install dependencies for the starter distribution
|
# Install dependencies for the starter distribution
|
||||||
uv run --with llama-stack llama stack list-deps starter | xargs -L1 uv pip install
|
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
|
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
|
## Example Usage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue