-
Notifications
You must be signed in to change notification settings - Fork 15
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
centralized environment #52
Comments
Currently, you can create a Conda environment yourself, activate it, then load CondaPkg with What exactly do you need that this doesn't do? |
I'd wish julia> using CondaPkg
julia> conda_prefix() = "..."
julia> get!(ENV, "MAMBA_ROOT_PREFIX", conda_prefix())
julia> get!(ENV, "JULIA_CONDAPKG_TOPENV", conda_prefix())
julia> get!(ENV, "JULIA_CONDAPKG_BACKEND", "MicroMamba")
julia> CondaPkg.resolve()
julia> CondaPkg.add("matplotlib") I also want to point out that it is impossible to currently reuse the Assuming that any of the command is available in This would also be a flaw if The approach using |
I have a fairly heavyweight Python dependency provided by PyThermo.jl (~1.1 GB) that gets duplicated in every project/environment PyThermo's installed in. In most cases, there's only the one big Python dependency - it'd be great to keep Conda files in some centralized location akin to ~/.julia/packages. Maybe ~/.julia/conda/envs//, and cache by a content hash of .CondaPkg/meta? |
@t-bltg The Current backend is not really intended for the way you are using it. It is aimed at someone who has manually created an environment themselves at the command line, so it is reasonable to assume that the conda (or mamba or micromamba) command is in the PATH in this case. Anyway, that's by the by. I think what you really want is a means to specify where the environment is put, say |
@stillyslalom The Conda root directory (where packages are cached to) is in a central place in the Julia depot, so is shared by different projects. When packages are installed into different projects by Conda, the files are (by default) hardlinked. This should mean that very little extra disk space is actually used when you have the same package installed in several projects. |
Interesting! I've seen CondaPkg downloading dependencies on |
Exactly. |
Ok thanks, shouldn't be too hard to implement. |
@stillyslalom Please open a new issue if you'd like to discuss further. |
I can do it, but may not have time before the new year. I'm happy to take a PR for it, but it may be reasonably involved to do it right. The approach in #53 is appealingly simple, but will end up re-resolving the environment every time you run Julia in a different project because the dependencies will have changed. I think the "right" way to do this is to still store the CondaPkg metadata in a per-project location, but allow the conda environment itself to be somewhere else (controlled by an env var), and when in this mode of operation, only ever install packages, never uninstall (because otherwise you may uninstall something required by another project). |
I've updated #53 to use the approach you described, using per-project metadata makes sense. Can you disable the waiting approval for the ci run ? It's cumbersome to request approval for each gh action run. Side note: |
Using
Conda
it was possible to centralize a conda installation in a single directory, usingCONDA_JL_HOME
env variable, shared between multiple julia versions.AFAIK, this is not possible using
CondaPkg
.Using the
MicroMamba
backend, I can useMAMBA_ROOT_PREFIX
to centralize downloaded packages, but I would like an option to move everything related to conda out ofDEPOT_PATH
.Something like
CONDA_PREFIX
, but also usable with theMicroMamba
backend:https://github.com/cjdoris/CondaPkg.jl/blob/75ef6edef098cc37a13427e8291f54c7beca05c2/src/resolve.jl#L389-L401
Or maybe something like
JULIA_CONDAPKG_TOPENV
.Conda environments quickly grow in space, and I'd like to avoid duplicates (easily understandable when you have a julia lts version, a release version, a nightly version, ...).
I'd be happy to create a PR, if we agree on the feature ?
The text was updated successfully, but these errors were encountered: