Add your description here
Project description
ray-pixi
A pixi runtime_env for Ray: declare a pixi
environment in your runtime_env, and Ray installs it on each node and launches
the workers inside it via pixi run.
Install
pip install ray-pixi # or: pixi add --pypi ray-pixi
Plugin registration
Ray discovers runtime_env plugins through the RAY_RUNTIME_ENV_PLUGINS
environment variable, which must be set before the runtime_env agent starts —
that is, before ray start on every node (and before ray.init() for a local
cluster):
export RAY_RUNTIME_ENV_PLUGINS='[{"class":"ray_pixi.PixiPlugin"}]'
ray start --head # or: ray start --address=...
On KubeRay / a cluster YAML, set the same value in each node's container env.
ray-pixi must also be installed in the agent's Python environment on every node
(so it can import ray_pixi.PixiPlugin).
Usage
Once the variable is set, declare the environment with pixi():
import ray
from ray_pixi import pixi
ray.init(runtime_env={"pixi": pixi("pixi.toml", environment="default", locked=True)})
@ray.remote
def task():
import numpy
return numpy.__version__
print(ray.get(task.remote()))
You can also declare the environment inline, without a manifest file:
ray.init(
runtime_env={
"pixi": pixi(
channels=["conda-forge"],
dependencies={"python": "3.13.*", "numpy": "*"},
)
}
)
The pixi field
runtime_env["pixi"] accepts a str (a manifest path) or a dict:
| key | description |
|---|---|
manifest |
path to a pixi.toml / pyproject.toml (mutually exclusive with the inline keys) |
channels / dependencies / pypi_dependencies / platforms |
inline spec |
environment |
environment to select, defaults to default |
locked |
reproduce strictly from pixi.lock, defaults to False |
pixi_version |
if set, bootstrap this pixi version on the node |
pixi_install_options |
extra flags passed through to pixi install |
Prefer building the field with ray_pixi.pixi(): given a manifest path it reads
the file (and a sibling pixi.lock) on the driver and inlines the content, so the
configuration is self-contained across nodes.
Requirements: every node needs a
pixiexecutable (onPATH, or bootstrapped viapixi_version), and the pixi environment must provide apythonandraythat match the cluster (see Version matching below).
Version matching
Ray refuses to connect a worker whose ray or python version differs from the
cluster. Concretely:
- Ray version is always compared exactly — declare the cluster's exact version.
- Python version is compared at the level set by the cluster's
RAY_DEFAULT_PYTHON_VERSION_MATCH_LEVELenvironment variable:patch(Ray's default) — must match down to the micro version (3.13.12≠3.13.13), or Ray errors.minor— onlymajor.minormust match; a micro difference just warns. SetRAY_DEFAULT_PYTHON_VERSION_MATCH_LEVEL=minoron the cluster to allow this.
How ray-pixi helps:
- Inline mode: if you omit
pythonfromdependenciesit is pinned to the node's exact running version, and if you omitrayfrompypi_dependenciesit is added asray[default]==<cluster ray version>, so workers match by default. - Manifest mode: ray-pixi does not edit your manifest, so it must declare
both
pythonandrayitself (ray as a pypi dependency). A manifest that installs neither is rejected after install with a clear error. - Both modes: after installing, ray-pixi verifies the env's python minor and
ray version against the cluster and fails fast (with a clear error) on a
mismatch. The python check is minor-level only, so under the default
patchlevel still pinpythonto the cluster's exact version (e.g.python = "==3.13.12"in your manifest), or relax the cluster tominor.
Known interactions
- Launching the driver with
uv run: Ray's built-in uv integration (RAY_ENABLE_UV_RUN_RUNTIME_ENV, on by default) detects theuv runancestor and tries to rewritepy_executableto replicate the uv environment, which conflicts with the pixi plugin. Disable it when using pixi:RAY_ENABLE_UV_RUN_RUNTIME_ENV=0. platforms: when you declare an inline spec withoutplatforms, ray-pixi defaults it to the building node's platform (e.g.linux-64).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ray_pixi-0.1.0.tar.gz.
File metadata
- Download URL: ray_pixi-0.1.0.tar.gz
- Upload date:
- Size: 51.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1bfc00a754acd6403d6eb84a3280ad8fd1e71a295157eead7ae9a42ceaf02d4
|
|
| MD5 |
83bce475338b6bad20ea341d71a845b3
|
|
| BLAKE2b-256 |
1a1d9f293e95e95d29116e0f435ee0c815594b3642e3c6af7d88cdd279f7923a
|
Provenance
The following attestation bundles were made for ray_pixi-0.1.0.tar.gz:
Publisher:
release.yml on zen-xu/ray-pixi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ray_pixi-0.1.0.tar.gz -
Subject digest:
a1bfc00a754acd6403d6eb84a3280ad8fd1e71a295157eead7ae9a42ceaf02d4 - Sigstore transparency entry: 1642433738
- Sigstore integration time:
-
Permalink:
zen-xu/ray-pixi@0b27359c410e833ae3ebafafe7879b3c45c0889d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zen-xu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b27359c410e833ae3ebafafe7879b3c45c0889d -
Trigger Event:
push
-
Statement type:
File details
Details for the file ray_pixi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ray_pixi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fc3d2d603896d1b8f5fedd8fc9d162d9d7659c71b95de792d7cd1343f9b6f47
|
|
| MD5 |
979bba34a3489074e483efff656d94b0
|
|
| BLAKE2b-256 |
da4771bdf2bd8eac554640efc07270abc5ebf1680e7fe0af31fd5f44a2f2c88f
|
Provenance
The following attestation bundles were made for ray_pixi-0.1.0-py3-none-any.whl:
Publisher:
release.yml on zen-xu/ray-pixi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ray_pixi-0.1.0-py3-none-any.whl -
Subject digest:
2fc3d2d603896d1b8f5fedd8fc9d162d9d7659c71b95de792d7cd1343f9b6f47 - Sigstore transparency entry: 1642433901
- Sigstore integration time:
-
Permalink:
zen-xu/ray-pixi@0b27359c410e833ae3ebafafe7879b3c45c0889d -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zen-xu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b27359c410e833ae3ebafafe7879b3c45c0889d -
Trigger Event:
push
-
Statement type: