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

Micromamba and uv for Python package management #801

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JonnyTran
Copy link

@JonnyTran JonnyTran commented Jan 27, 2025

This PR includes significant improvement to the Python build process, transitioning from using apt-get to Micromamba for easier python environment management (see #796). The key changes involve using Micromamba to install Python along with pip and uv at the /opt/conda/ Python environment path, instead of the system Python installation. This allows uv as drop-in replacement to replace pip for much faster builds and better extensibility to other projects. All current code using pip3 install has been tested to still work with the CUDA pip cache.

Transition to Micromamba:

  • packages/build/python/Dockerfile: Updated to install core python, uv, and pip in a conda environment. Added environment variables for Micromamba binary and Conda Python environment path for uv.
  • packages/build/python/install.sh: Replaced apt-get commands with Micromamba commands for installing Python and core packages. Added Micromamba initialization to /etc/profile.d for all shells and created symbolic links for python and pip.
  • Optimizing uv in containers by compiling bytecode
  • Remove all apt-get install of python-* packages
  • Upgrade pip3 install to uv pip install in other containers (optional)

@johnnynunez
Copy link
Collaborator

@JonnyTran thanks for the PR.
Also consider that not all libraries support conda and we are not really happy with that.
For example, jetson-utils or nano-llm

@ms1design
Copy link
Collaborator

Oh I like this I wanted also to introduce the uv here. We should make sure that it will not inference with the local PYPI server settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants