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

Having a pip installable file(like requirements.txt) that can be used directly(without installing pixi or conda) inside docker environment. #2172

Open
raceychan opened this issue Oct 1, 2024 · 4 comments

Comments

@raceychan
Copy link

raceychan commented Oct 1, 2024

Problem description

I use pixi for managing my project dependencies, However, it seems redundant to Install pixi inside a docker container.

  1. docker container is an isolated environment, so installing dependencies is relatively 'safe'
  2. by using pixi in local development, I already have a clean dependency lock file.
  3. it feels difficult Installing pixi in docker using os like alpine
  4. pip freeze > requirements.txt would only list dependencies in current conda environment.

Feature Request:
Having a pip installable file(like requirements.txt) that can be used a docker environment.

I noticed that in recent version of pixi
'pixi project export' is introduced, however, AFAIK, it only exportx conda environment.yaml files, but I don't want to include conda inside my docker image, same reasons as 1,2,3 listed above.

@raceychan raceychan changed the title Having a pip installable file(like requirements.txt) that can be used a docker environment. Having a pip installable file(like requirements.txt) that can be used inside docker environment. Oct 1, 2024
@raceychan raceychan changed the title Having a pip installable file(like requirements.txt) that can be used inside docker environment. Having a pip installable file(like requirements.txt) that can be used directly(without installing pixi or conda) inside docker environment. Oct 1, 2024
@synapticarbors
Copy link
Contributor

pixi project export also supports explicit conda specs that don't require a solve and can be installed via micromamba, which is very lightweight. I also started a draft of exporting a pip requirements file in #2049, but that will only be for pypi dependencies, not conda packages.

@raceychan
Copy link
Author

pixi project export also supports explicit conda specs that don't require a solve and can be installed via micromamba, which is very lightweight. I also started a draft of exporting a pip requirements file in #2049, but that will only be for pypi dependencies, not conda packages.

Yeah, it is just that it takes some extra effort to install a package manager inside docker container, most importantly, package managers does not do much inside docker.

I was expecting that it might be a little tricky to export a requirements.txt when I am relying on conda dependencies.

I am comfortable switching to pypi-dependencies, but just ouf of curiousity:
Since we can already export conda environment to a requirements.txt by "pip freeze", does that mean it would automatically 'translate' dependencies we installed via "conda install" to pypi dependencies, or it just ignores them?

@olivier-lacroix
Copy link
Contributor

No it won't @raceychan .

There is likely a more idiomatic way to achieve what you want (not including pixi in the docker image). I recommend you have a look at the Docker example, which shows how to achieve that efficiently.

Let me know how you go 😃 !

@raceychan
Copy link
Author

No it won't @raceychan .

There is likely a more idiomatic way to achieve what you want (not including pixi in the docker image). I recommend you have a look at the Docker example, which shows how to achieve that efficiently.

Let me know how you go 😃 !

The docker example you provided make more sense than the ones I found, would definitely try it out!

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

No branches or pull requests

3 participants