Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make llama stack build not create a new conda by default #788

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

ashwinb
Copy link
Contributor

@ashwinb ashwinb commented Jan 16, 2025

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 that llama stack run is actually running the code in some other conda is very surprising.

This PR tries to make things better.

  • Both llama stack build and llama stack run now accept an --image-name argument which represents the (conda, docker, virtualenv) image you want to operate upon.
  • For the default (conda) mode, the script checks if a current conda environment exists. If one exists, it uses it.
  • If --image-name is provided, that option is used. In this case, an environment is created if needed.
  • There is no automatic 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. Run llama 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 with llama stack build --template fireworks --image-name foo. This successfully created a conda environment called foo and installed deps. Ran llama stack run fireworks outside conda which failed. Activated a different conda, ran again, it failed saying it did not find the llamastack-build.yaml file. Then used --image-name foo option and it ran successfully.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 16, 2025
Copy link
Contributor

@raghotham raghotham left a comment

Choose a reason for hiding this comment

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

loving the polish

@ashwinb ashwinb merged commit cee3816 into main Jan 16, 2025
2 checks passed
@ashwinb ashwinb deleted the stack_build branch January 16, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants