llama-stack/llama_stack/distribution
Francisco Arceo 2b752df79a
fix: Fixing some small issues with the build scripts (#1132)
# What does this PR do?
I was encountering build issues when building my `ollama` environment
using `llama stack build`

```bash
llama stack build --template ollama --image-type venv
Traceback (most recent call last):
  File "/Users/farceo/dev/llama-stack/.venv/bin/llama", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/farceo/dev/llama-stack/llama_stack/cli/llama.py", line 46, in main
    parser.run(args)
  File "/Users/farceo/dev/llama-stack/llama_stack/cli/llama.py", line 40, in run
    args.func(args)
  File "/Users/farceo/dev/llama-stack/llama_stack/cli/stack/build.py", line 77, in _run_stack_build_command
    return run_stack_build_command(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/farceo/dev/llama-stack/llama_stack/cli/stack/_build.py", line 180, in run_stack_build_command
    _run_stack_build_command_from_build_config(
  File "/Users/farceo/dev/llama-stack/llama_stack/cli/stack/_build.py", line 272, in _run_stack_build_command_from_build_config
    return_code = build_image(
                  ^^^^^^^^^^^^
  File "/Users/farceo/dev/llama-stack/llama_stack/distribution/build.py", line 137, in build_image
    return_code = run_with_pty(args)
                  ^^^^^^^^^^^^^^^^^^
  File "/Users/farceo/dev/llama-stack/llama_stack/distribution/utils/exec.py", line 22, in run_with_pty
    return _run_with_pty_unix(command)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/farceo/dev/llama-stack/llama_stack/distribution/utils/exec.py", line 53, in _run_with_pty_unix
    process = subprocess.Popen(
              ^^^^^^^^^^^^^^^^^
  File "/Users/farceo/.local/share/uv/python/cpython-3.11.6-macos-aarch64-none/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/farceo/.local/share/uv/python/cpython-3.11.6-macos-aarch64-none/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/farceo/dev/llama-stack/llama_stack/distribution/build_venv.sh'
make: *** [build-ollama] Error 1
```

I also had to adjust the script when testing the `common.sh` file
because it returned:

```bash
> source llama_stack/distribution/common.sh
llama_stack/distribution/common.sh:6: command not found: ^M
llama_stack/distribution/common.sh:50: parse error near `\n'
```
On my branch, I ran:
```bash
sed -i '' 's/\r$//' llama_stack/distribution/common.sh
```
And then I was able to successfully build the environment.

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

## Test Plan
N/A

[//]: # (## Documentation)
N/A

---------

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
2025-02-19 22:20:49 -08:00
..
routers feat: support tool_choice = {required, none, <function>} (#1059) 2025-02-18 23:25:15 -05:00
server build: format codebase imports using ruff linter (#1028) 2025-02-13 10:06:21 -08:00
store build: format codebase imports using ruff linter (#1028) 2025-02-13 10:06:21 -08:00
ui fix!: update eval-tasks -> benchmarks (#1032) 2025-02-13 16:40:58 -08:00
utils fix: Fixing some small issues with the build scripts (#1132) 2025-02-19 22:20:49 -08:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
build.py fix: improve stack build on venv (#980) 2025-02-14 09:22:03 -08:00
build_conda_env.sh feat: Add a new template for dell (#978) 2025-02-06 14:14:39 -08:00
build_container.sh Fix uv pip install timeout issue for PyTorch (#929) 2025-02-03 06:39:35 -08:00
build_venv.sh fix: improve stack build on venv (#980) 2025-02-14 09:22:03 -08:00
client.py chore: move all Llama Stack types from llama-models to llama-stack (#1098) 2025-02-14 09:10:59 -08:00
common.sh fix: Fixing some small issues with the build scripts (#1132) 2025-02-19 22:20:49 -08:00
configure.py build: format codebase imports using ruff linter (#1028) 2025-02-13 10:06:21 -08:00
configure_container.sh More generic image type for OCI-compliant container technologies (#802) 2025-01-17 16:37:42 -08:00
datatypes.py fix!: update eval-tasks -> benchmarks (#1032) 2025-02-13 16:40:58 -08:00
distribution.py fix!: update eval-tasks -> benchmarks (#1032) 2025-02-13 16:40:58 -08:00
inspect.py fix: improve signal handling and update dependencies (#1044) 2025-02-13 08:07:59 -08:00
library_client.py style: remove prints in codebase (#1146) 2025-02-18 19:41:37 -08:00
request_headers.py Add X-LlamaStack-Client-Version, rename ProviderData -> Provider-Data (#735) 2025-01-09 11:51:36 -08:00
resolver.py fix!: update eval-tasks -> benchmarks (#1032) 2025-02-13 16:40:58 -08:00
stack.py fix!: update eval-tasks -> benchmarks (#1032) 2025-02-13 16:40:58 -08:00
start_conda_env.sh feat: Add HTTPS serving option (#1000) 2025-02-07 09:39:08 -08:00
start_container.sh feat: Add HTTPS serving option (#1000) 2025-02-07 09:39:08 -08:00
start_venv.sh feat: add support for running in a venv (#1018) 2025-02-12 11:13:04 -05:00