-
Notifications
You must be signed in to change notification settings - Fork 18
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
Automatic Julia upgrade may be surprising #39
Comments
+1 Yeah I think #29 would also help because we could fix a single recommended version. That way a new Julia release wouldn't instantly brick packages upon simply importing a Python package. |
you don't wanna know how much money this cost us. A new julia release was downloaded automagically on all nodes individually in a distributed cluster because a new julia was released. |
Agreed that a setting to prefer existing installations would be good. In the meantime you can set the environment variable |
well, we had this in place:
so we thought we were safe ... So the only thing that works is going via the ENV vars. |
You can also import |
Could we maybe make the default behavior prefer existing installations? |
Import side effects are really not ok. Just don't |
The entire julia and julia-dependency installation in |
Part of the issue is that for most Python backends, the dependencies can be entirely independent. JAX has its own compiled backend. PyTorch has its own compiled backend. While they aren’t compatible with eachother (can’t do Whereas for Julia backends of Python libraries, all the backend libraries can actually talk to eachother and pass objects back and forth. Different backends all get to sit in the same combined environment and compile methods from one on objects of the other - which is great for compatibility across tools. But I think this is why it’s also way easier to do this environment config at import time. And why it is unusual compared to traditional Python backends. I mean ideally I think it would be nice to set this up automatically. I think it’s just not as straightforward as one might expect though, because of this dynamicism and cross-compatibility of Julia backends for Python. |
Yeah... juliapkg is trying to be the interface to Julia's package manager for all Julia packages required by python packages in the current virtual env. An alternative is to make the resolution process manually triggered - you run a command like |
It can get worse:
Also, it's manipulating the (project's) Project.toml & Manifest.toml files. It should not do this, it should just listen to them. They (should) have authority. |
Manipulating the managed Project.toml and Manifest.toml is how juliapkg works. There’s no other way to install stuff in Julia other than manipulating those. But it owns and manages those files so this shouldn’t be unexpected. I suppose what is unexpected was these being changed at runtime, but this is kinda needed at the moment just due to the dynamic and shared nature of Julia environments - see explanation above. But yeah it’d be nice to have this stuff happen at pip install time if it’s even possible. (If you mean an externally non-managed project, this shouldn’t happen. So please submit a bug report if this does.) But then again I suppose if the Manifest.toml is already compatible with
So if it’s a shared filesystem, then the compile will only happen in one process because Julia will use a file locking mechanism to prevent simultaneous precompilation. But the download of Julia itself I suppose is not locked since juliapkg manages this. So we should probably put in a patch for that. P.S., as a workaround to prevent these unintended updates, you should be freezing the version with: import juliapkg
juliapkg.require_julia("=1.11.2") If you write "1.11.2" by itself, this is actually setting the minimum version, rather than fixing it. Similar for other dependencies. |
if import order matters you're doing something wrong. really. |
I mean this isn't even that uncommon a pattern import matplotlib
matplotlib.use('Agg') # Change backend
import matplotlib.pyplot as plt Lots of libraries involve manipulating the backend settings before loading the package. Another example:
|
Sigh. Even though the side effect of updating a global dict is probably suspect, It's limited and predictable. Compare this to downloading a kitchen sink and writing all over the file system. Anyway, we contained this behaviour via ENV vars.. ( |
Ok so these are a few different things:
Regarding "writing all over the file system," it really only writes to:
Which are both required and [I would assume] expected. It's just when it installs that seems unexpected. Right? |
@toolslive It sounds like you might just not want what We manage Julia package dependencies by supplying a fixed The problem with this approach is that it rules out anybody using a different python package that uses If julia package management were integrated with python package management, we could proably avoid a lot of these shenanigans. |
It's surprising to me that
juliapkg
will automatically pick the latest compatible Julia version fromjuliaup
's list, even if it isn't installed, while a previous compatible version is available.I'd prefer to default to using an installed version if it meets the Julia compat constraints. Partly this is because I want to have a way to keep a "recommended" version of Julia even if a newer version is available (see also #29).
Also, Julia Pkg now has the
PRESERVE_TIERED_INSTALLED
resolver mode that prefers to use compatible, already-installed versions of packages even if the registry has newer releases. It would be nice ifjuliapkg
had a corresponding mode for Julia installation.Could maybe make this behavior configurable?
The text was updated successfully, but these errors were encountered: