Method for outputting environment changes conda is making for use with global installs #9692
Labels
locked
[bot] locked due to inactivity
plugins::run
pertains to conda-run
source::community
catch-all for issues filed by community members
stale::closed
[bot] closed after being marked as stale
stale
[bot] marked as stale due to inactivity
type::feature
request for a new feature or capability
As per the discussion here: #9152
It is getting difficult to use
conda
in a non-interactive method, such as in a Docker container that needs to have conda-installed tools available.As per the docs, it is required to run
conda activate
in order to activate a conda environmenthttps://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment
Previously when using
conda
, you did not actually have to runconda activate
, you could simply make all the conda-installed software available by updating thePATH
yourself:Dockerfile
:When using a container like this, you do not need to ever invoke the
conda
commands to use the installed R and R libraries, they are available from thePATH
update inside the container. This kind of deployment of conda-installed libraries has been an essential functionality for a long time.Similarly, you could do this with a Makefile for really great results;
Here, using
make install
followed bymake run
will install and run your program without ever having to interact directly withconda
. This works really, really well and makes life so much easier for having a simple deployment & delivery system for your projects.The discussion here touches on how the current changes to conda's activation methods (requiring the usage of
conda activate
) are making this kind of usage of conda difficult:#9152
The issue is also referenced here:
#8586 (comment)
The ability to use conda-installed software and libraries without ever actually having to invoke
conda
is extremely important. It was suggested to useconda run
, but this is not a good solution because you should not have to embed references to conda in your command invocation. What if you need to be able to access the same software regardless of if its installed inside conda, Docker, or on bare metal? Usingconda run <some_binary>
needlessly couples your software's invocation toconda
.Here is a concrete example: I have a very large workflow that needs a lot of software. A lot of that software is installed with conda, in containers. But it could also be installed globally on the server. Or it could be inside conda, without containers. Or it could be in a container without conda. It doesnt matter, because my command invocation will always be:
Suddenly forcing that to be
is going to pointlessly limit the places and methods by which I can use my programs that run with software that may or may not be installed with conda. And it will force the execution of my workflow to be tied to
conda
when it was never meant to be. In most cases,conda
is never even in myPATH
at the time of execution. I was usingconda
because it was more convenient, but now with this kind of change it will actually be less convenient to use and supportconda
.I understand that part of the complexity with this comes from the need for conda to run 'activate' scripts to completely initialize the environment. Some of them appear to be described here:
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#macos-and-linux
My suggestion/request is that there be some method to output to the end user all of the changes that
conda
is making when you runconda activate
, so that these changes can be saved statically in order to replicate those changes without actually having to runconda activate
. For example, ifconda activate
is modulating a number of environment variables, then it would be great for me to be able to see what things it is changing and what their final values should be. As suggested in the other Issue comments, this can be done manually by parsing the output ofenv
; it would be really great if we could just haveconda
do this itself and spit out the list of updated env variables, so that I could just copy/paste that into my Dockerfile or Makefile.One way I could have mitigated this issue is to just only use older versions of
conda
that do not have the restriction of requiring interactive activation every time. However, it seems that this is not actually a good solution either. So now, users like me who have madeconda
a cornerstone of their software-deployment methodology, are now stuck in the situation of having to choose between using old, unsupported, conda versions that have the feature we need but are not future proof, trying to hack together a manual solution ourselves, or just droppingconda
support all together.Having
conda
spit out a list of env changes that need to be made in lieu ofconda activate
would be an easy solution for users, copy/pasting your env variables into your static Dockerfile/Makefile is not terrible. The end-result goal being that you dont have to ever actually callconda
or interact with it in order to use its installed software.The text was updated successfully, but these errors were encountered: