Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,18 @@ Various tags are maintained for this image:
- `rhoai-v*-latest` will always point to the latest image that has been built off of a merge to the corresponding `rhoai-v*` branch

You can see the source code that implements this build strategy [here](.github/workflows/redhat-distro-container.yml)

### Running with a custom run YAML

The distribution image allows you to run a custom run YAML file within it. To do so, run the image in the following way. The "path" mentioned should be the path to your custom run YAML file.

```bash
podman run \
-p 8321:8321 \
-v <path_on_host>:<path_in_container> \
-e RUN_CONFIG_PATH=<path_in_container> \
quay.io/opendatahub/llama-stack:<tag>
```

> [!IMPORTANT]
> The distribution image ships with various dependencies already pre-installed. There is *no* guarantee that your custom run YAML will necessarily work with the included dependencies.
3 changes: 2 additions & 1 deletion distribution/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ RUN pip install --no-deps sentence-transformers
RUN pip install --no-cache --no-deps git+https://github.com/opendatahub-io/llama-stack.git@v0.3.0rc3+rhai0
RUN mkdir -p ${HOME}/.llama ${HOME}/.cache
COPY distribution/run.yaml ${APP_ROOT}/run.yaml
COPY --chmod=755 distribution/entrypoint.sh ${APP_ROOT}/entrypoint.sh
#TODO: remove this once we have a stable version of llama-stack
# LLS server version is not aligned with the client version, so we disable the version check
# Currently, LLS client version is 0.3.0, while the server version is 0.3.0rc3+rhai0
ENV LLAMA_STACK_DISABLE_VERSION_CHECK=true
ENTRYPOINT ["llama", "stack", "run", "/opt/app-root/run.yaml"]
ENTRYPOINT [ "/opt/app-root/entrypoint.sh" ]
5 changes: 4 additions & 1 deletion distribution/Containerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ WORKDIR /opt/app-root
RUN pip install sqlalchemy # somehow sqlalchemy[asyncio] is not sufficient
{dependencies}
{llama_stack_install_source}

RUN mkdir -p ${{HOME}}/.llama ${{HOME}}/.cache
COPY distribution/run.yaml ${{APP_ROOT}}/run.yaml
COPY --chmod=755 distribution/entrypoint.sh ${{APP_ROOT}}/entrypoint.sh

#TODO: remove this once we have a stable version of llama-stack
# LLS server version is not aligned with the client version, so we disable the version check
# Currently, LLS client version is 0.3.0, while the server version is 0.3.0rc3+rhai0
ENV LLAMA_STACK_DISABLE_VERSION_CHECK=true

ENTRYPOINT ["llama", "stack", "run", "/opt/app-root/run.yaml"]
ENTRYPOINT [ "/opt/app-root/entrypoint.sh" ]
12 changes: 12 additions & 0 deletions distribution/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -e
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea to use instead to catch pipeline errors too.
set -euo pipefail


if [ -n "$RUN_CONFIG_PATH" ] && [ -f "$RUN_CONFIG_PATH" ]; then
exec llama stack run "$RUN_CONFIG_PATH" "$@"
fi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Nathan for this PR. few small nits.

If RUN_CONFIG_PATH is set but file doesn’t exist, container silently falls through to default config. Add explicit error or a clear message in the logs might help.

if [ -n "$DISTRO_NAME" ]; then
exec llama stack run "$DISTRO_NAME" "$@"
fi

exec llama stack run /opt/app-root/run.yaml "$@"
Loading