Make llama stack build not create a new conda by default #788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
So far
llama stack build
has always created a separate conda environment for packaging the dependencies of a distribution. The main reason to do so is isolation -- distributions are composed of providers which can have a variety of potentially conflicting dependencies. That said, this has created significant annoyance for new users since it is not at all transparent. The fact thatllama stack run
is actually running the code in some other conda is very surprising.This PR tries to make things better.
llama stack build
andllama stack run
now accept an--image-name
argument which represents the (conda, docker, virtualenv) image you want to operate upon.--image-name
is provided, that option is used. In this case, an environment is created if needed.llamastack-
prefixing of the environment names done anymore.Test Plan
Start in a conda environment, run
llama stack build --template fireworks
; verify that it successfully built into the current environment and stored the build file at$CONDA_PREFIX/llamastack-build.yaml
. Runllama stack run fireworks
which started correctly in the current environment.Ran the same build command outside of conda. It failed asking for
--image-name
. Ran it withllama stack build --template fireworks --image-name foo
. This successfully created a conda environment calledfoo
and installed deps. Ranllama stack run fireworks
outside conda which failed. Activated a different conda, ran again, it failed saying it did not find thellamastack-build.yaml
file. Then used--image-name foo
option and it ran successfully.