-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
When setting JULIA_DEPOT_PATH
to /path:
, omit the default user depot
#51448
Conversation
What is the "something useful" in this PR? IMO, the best thing to do if |
The same behavior as not setting the variable, i.e., |
I think what Tim wants is a way to say. Remove the user-depot from the search path. So instead of the current.
And IIUC we currently don't have a way to express that, |
I agree that this is a good idea. These are just cache files and if you find one that is valid it is as good as the other and we know with a very high likelihood that the ones for the stdlibs will be valid. And when we start bundling the binary dependencies we have as proper artifacts we also don't want to reinstall them if someone modifies the depot path like this. |
Yes, but without having to specify
So @DilumAluthge, you mentioned that |
361a5bd
to
1284d6f
Compare
Ahh, I see what you're saying - we always load the stdlib source code regardless of the value of the depot path. |
But currently (at least on Julia master) we don't actually verify that the stdlib cachefiles are valid, we just skip the verification and accept them. |
Which makes #49866 ever more pressing, but the question at hand here is orthogonal. |
I think this change is good, but it is technically a minor change and I need in the past at least once use it to undue an overzealous HPC admin puting a |
It seems like a pain to need to opt-out of the environments. @maleadt Is there a way to modify this PR so that it only applies to |
Could we "split" |
IIUC you're proposing to split Anyway, I pushed a change like that, introducing I'm not sure I like this change; the simplicity of just pushing a bundled depot to the actual DEPOT_PATH seemed much easier to reason about, and doesn't require adapting several callers (code loading, Artifacts.jl, ...) to include |
Currently:
Does this mean that |
Yeah, and that is a bit absurd, no?
That would end up writing in your build tree, or in BINDIR, as soon as you perform Pkg operations though. I'm not sure that's wanted? It seems more sane to have the first entry be populated with a writable directory, it be the default homedir, or a temporary directory as suggested by @DilumAluthge. |
Hi Folks, just wanted to weigh in here. I think anything that makes the behaviour of Julia unambiguous and easy to control will get my vote. I have a question: what are in the stdlibs? Is it a bunch of .so files? Is it a lot of Julia source? I'm trying to place the stdlib somewhere on a scale between statically-linked executable and a python environment. Depending on where Julia lands, we'll need to prioritize deploying Julia in containers or in /tmp (the way we have to for python on HPC). Also: Julia is relocatable (in contrast to python). This is a feature the I -- and other HPC users -- like very much. How is the Another question: On HPC it's important to overwrite the location of caches, etc (e.g. some systems set the homes to be RO on the computes). Do we continue to have this ability after this change? (I assume so, eg. the And finally, I would like to propose an addition: can we extend Preferences.jl to also control things like cache, artifact, package locations? That way we have the |
I may want to run in a read-only scenario. Which currently I can. As a note juliaup uses the depot path as well, to obtain a location for install Julia too. |
Thankfully this will be fixed eventually (soon?). Juliaup will switch to using JULIAUP_DEPOT_PATH and will no longer check JULIA_DEPOT_PATH. |
Yeah that is a pure runtime decision. See Line 89 in 7428d8a
Currently the depot itself is not fully relocatable, but #49866 should be a big step in that direction.
So this is a bit tricky; the idea of this PR is to always add the "bundled with Julia" depots to be added to your depot path. E.g. you will no longer be able to opt-out of it. But you will of course be able to insert a depot or change the user_depot to be located in a different place. As an example if you moved the system depot somewhere else, you could insert that location first.
Yeah that's a long-term goal of ours, but the problem is that a lot of these environment flags are read early and sometimes even from C so the whole preference loading infrastructure would need to be able to be already present. So there is a bit of a ordering and boot-strapping challenge. |
I'm not sure of the exact state of this PR (and maybe it has been discussed) but if you are running a centralized installed Julia that also has registries installed in it, you might not want to use those registries if you set |
Thanks for clarifying all. I'll keep and eye on this and run some experiments. For the record: my questions are motivated by more than just the interaction with centralized depots. Rather HPC is possibly heading towards a state where running code on the compute nodes from the home directory is becoming untenable. The usual compromise is that home directories are just read only (eg. Summit, or NERSC + Containers). But I've had conversations which go along the lines of "just tar it all up and use sbcast". So the other thing I've been thinking of is: rather than asking users to stop thinking of Hence I'll have to find some time to do testing. |
2485205
to
917ffae
Compare
My conclusion from the comments here and further offline discussion is that
So it retains all of the following:
That also means this PR only partially fixes #51439, as just setting TL;DR: use |
This looks good -- thanks @maleadt |
Now includes docs and news. I've updated the top post with a new explanation, so this is ready for review again. |
Could this get another round of review? @vchuravy @KristofferC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I would like @StefanKarpinski to chime in since I feel he has the best mental model here.
Instead of expanding to the default (homedir-based) + bundled (bindir-based) depot, only use the bundled depot, so the env var can be used to select a different depot while still being able to load bundled cache files.
c8ec474
to
817689e
Compare
JULIA_DEPOT_PATH
to /path:
, omit the default user depot
JULIA_DEPOT_PATH
to /path:
, omit the default user depotJULIA_DEPOT_PATH
to /path:
, omit the default user depot
@StefanKarpinski Can you review? |
So to get the previous behavior you do something like |
Yes, |
I keep on running into this (with PkgEval, creduce_julia, ... where I need isolated depots, which currently causes excessive compilation now that packages are being moved out of the system image). Given the approvals, let's try this out. I'll keep an eye on any fallout, but I don't think this should cause any issues. |
Summary
This PR slightly changes how the
DEPOT_PATH
works when overriden using the env varJULIA_DEPOT_PATH
, now omitting the default user depot when specifying a path.Before:
After:
Fixes #51439
Motivation
Setting
JULIA_DEPOT_PATH
is often used to isolate/decouple Julia environments (citation needed). When setting it to a path like/foo/bar:
, the resulting depot array however still includes the default user depot (~/.julia
), which isn't great for proper isolation.While it is possible to set it to only
/foo/bar
instead, which achieves proper isolation, that also excludes the system depot. That wasn't much of a problem in the past, but now that we're moving out stdlibs from the system image, using the bundled cache files is essential for a good experience.Proposed change
Instead of requiring users to manually craft a
LOAD_PATH
, I propose to slightly change how theJULIA_DEPOT_PATH
env var is interpreted, omitting the default user depot when specifying a path. For example:Notice how
~/.julia
is now omitted because I included/foo
in theJULIA_DEPOT_PATH
.This does not change any of the other (documented) properties of
JULIA_DEPOT_PATH
, and should also not affect the ability to layer depots over one another by simply prepending/appending to the environment variable: