-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add support for pip/virtualenv environments #55
base: main
Are you sure you want to change the base?
Conversation
a6cd6cd
to
c430f1a
Compare
Just a short comment. @Chroxvi is on vacation and is back in two weeks. I really want him to do the review. Sorry for letting you wait until he is back. |
Gentle nudge (as I too am back from vacation) :) |
Rebased post #56. |
Admittedly, adding support for additional conda/pip package managers in cotainr is pretty far down the line on our roadmap since:
That being said, we are still open to implementing support for uv, if it enables some significant use cases - after all the cotainr development is driven by requests for support for various use cases. @akx, picking up on your comment in #68 (comment) stating that you would be using cotainr on LUMI if this PR #55 was merged, what is your main motivation for wanting uv over the current conda/mamba implementation in cotainr that allows you to install pip packages by adding them to your conda_env.yml file as show in e.g. the cotainr LUMI PyTorch example? (You can even directly include requirements.txt in the conda_env.yml.) Are you looking for a faster environment installer? Or a better dependency solver than pip? Or something else? I think it is likely that conda/mamba at some point is going to be replaced by pixi (which uses rattler for installing conda packages and uv for installing pip packages) or uv (if at some point it implements support for conda packages which I believe is essential to the Scientific Python community). Even though it appears that pixi can be used as a direct replacement for conda/pip, it still has a slightly different design philosophy around managing projects and not just environments making it somewhat odd to integrate into cotainr. @akx Do you have any opinion about pros/cons of integrating cotainr with pixi and using it's uv integration over directly interfacing with uv? |
To be clear, the primary thing this PR adds support for is vanilla standard Python virtualenvs, i.e. not using Conda/Mamba distributions.
The reason I wrote this was that I don't know (or care, to be honest) much about Conda-based distributions (and I've had my share of headaches troubleshooting customer Conda images over at $dayjob (@valohai)). I wanted a simpler option, when you have e.g. a standard
Again,
I hadn't heard of Pixi before, again because I don't keep tabs on the Conda/Mamba world. No opinion. |
…pip` This also experimentally supports [`uv`](https://docs.astral.sh/uv/) (via an environment variable) for possibly faster installs.
The main meat of this PR is
PipInstall
, a sibling ofCondaInstall
that runsvenv
(oruv venv
) andpip install
(oruv pip install
) to install requirements fromrequirements.txt
files.The base image needs to have a
python3
onPATH
for this to work at all, of course.As alluded to above, this also includes support for the uv package installer as a faster alternative to
pip
; this is enabled by the currently-undocumentedCOTAINR_USE_UV
environment variable being set to a non-empty value.All tests, old and new, pass locally (using a dockerized singularity since I'm on a Mac).