llama-stack/llama_stack/cli/stack
Sébastien Han c4987bc349
fix: avoid failure when no special pip deps and better exit (#1228)
# What does this PR do?

When building providers in a virtual environment or containers, special
pip dependencies may not always be provided (e.g., for Ollama). The
check should only fail if the required number of arguments is missing.
Currently, two arguments are mandatory:

1. Environment name
2. Pip dependencies

Additionally, return statements were replaced with sys.exit(1) in error
conditions to ensure immediate termination on critical failures. Error
handling in the stack build process was also improved to guarantee the
program exits with status 1 when facing configuration issues or build
failures.

Signed-off-by: Sébastien Han <seb@redhat.com>

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan

This command shouldn't fail:

```
llama stack build --template ollama --image-type venv
```

[//]: # (## Documentation)

Signed-off-by: Sébastien Han <seb@redhat.com>
2025-02-24 13:18:52 -05:00
..
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
_build.py fix: avoid failure when no special pip deps and better exit (#1228) 2025-02-24 13:18:52 -05:00
build.py feat: add --run to llama stack build (#1156) 2025-02-23 22:06:09 -05:00
list_apis.py API Updates (#73) 2024-09-17 19:51:35 -07:00
list_providers.py feat: support listing all for llama stack list-providers (#1056) 2025-02-12 22:03:28 -08:00
run.py feat: add --run to llama stack build (#1156) 2025-02-23 22:06:09 -05:00
stack.py chore: remove configure subcommand (#1202) 2025-02-21 08:06:25 -08:00