Multi-platform environment installation #5389
trchen1033
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Pixi Devs,
I would like to be able to install multiple platform variants of the same environment name in a workspace. For example, both the linux-64 variant and linux-aarch64 variant of the default environment to coexist.
The initial motivation was to be able to prebuild environments for some offline IoT devices from beefy build servers. Later as I started prototype the idea I realized that it is likely the right thing to do even in the general use case.
e.g. consider a shared NFS home mount, the "native" (a.k.a.
environment.best_platform()) might not be consistent in the same workspace when worked from different workstation. IMO an environment installation should always associate with both the environment name and the targeted platform.Here I already have a quick prototype that sort of works: 5fa7c1b
It adds
--platformargument topixi installandpixi shell. I've testedpixi shell --platform linux-aarch64on a Debian multiarch host to launch an aarch64 environment.Please let me know what's your thoughts on the general direction of the change, and how should we implement this properly and get it reviewed. Thanks for your time!
Here's a copy of the commit message:
[WIP] Adding multi-platform installation support
This patch decouples environment installation (
./.pixi/envs/${env}) fromthe current native platform.
The existing behavior was that when an environment gets installed, it picks
the platform variant by matching the native platform against the supported
platforms declared by the workspace.
This approach has a couple drawbacks:
When a workspace is NFS mounted by multiple workstation, it is wrong to
assume all workstation runs the same platform. For example, we have a
namespace conflict here when both an aarch64 linux and a x86_64 linux
attempt to install the default environment, as they will both install into
./.pixi/envs/default.Some Linux distros support installing shared libraries from multiple archs,
and run foreign binaries seamlessly through qemu-user. Notably Debian
multiarch. It is useful to be able to run native pixi but install environments
for an emulated arch.
It is also useful to be able to install environments on a build server which
will be tarred and transferred to a target environment that doesn't have
internet access. e.g. IoT platforms, industrial computers, e.t.c.
This patch does the following things:
Environment installation path changed to
./.pixi/envs/${env}/{$platform}.Adds
PIXI_ENVIRONMENT_PLATFORMenvvar to indicate the targetting platform ofthe current environment.
By the way there is the similarly named
PIXI_ENVIRONMENT_PLATFORMSvariablefor the list of supported platforms. Not sure how is that useful at all.
Adds
--platformargument topixi installto select the set of platformvariants to install.
Adds
--platformargument topixi shellto select alternative platformvariant to activate.
Beta Was this translation helpful? Give feedback.
All reactions