Skip to main content

RayDog: Ray clusters on YellowDog

RayDog runs Ray clusters on the YellowDog Platform. YellowDog finds and provisions the compute, across clouds, regions and instance types, according to templates you define; RayDog turns that compute into a Ray cluster and keeps the two in step.

  • Autoscaler: YellowDog as a cloud for Ray's own cluster launcher. Write a cluster YAML, run ray up, and Ray adds and removes workers as its workload demands. This is the usual way to use RayDog.
  • Builder: a Python API for creating a cluster of a size you choose and controlling it from your own code. Use it when a cluster is part of a larger program, or when your machine cannot reach the head node over SSH.
  • raydog command: see what clusters exist in a namespace and shut them down from anywhere, including what a failed run left behind.

Documentation: https://docs.yellowdog.ai/raydog/index.html. To start a cluster, run a job on it and shut it down, follow the quick start.

Install

pip install yellowdog-ray

Python 3.10 or later; Ray 2.54 or later (installed with it).

A first look

With the Autoscaler:

ray up cluster.yaml       # create the cluster: a head node, and workers on demand
ray down cluster.yaml     # shut it down

With the Builder:

from yellowdog_ray import ClusterSpec, NodeSpec, RayDogCluster

head = NodeSpec(
    compute_requirement_template="my-namespace/head", start_script=HEAD_SCRIPT
)
worker = NodeSpec(
    compute_requirement_template="my-namespace/worker", start_script=WORKER_SCRIPT
)

with RayDogCluster(
    ClusterSpec(name="demo", namespace="my-namespace", head=head)
) as cluster:
    cluster.add_worker_pool("workers", worker, count=4)
    head_node = cluster.build()  # returns when the head node is running
    ...  # use Ray at head_node.private_ip
# the cluster is shut down here, whatever happened inside the block

And from anywhere:

raydog list -n my-namespace
raydog down demo -n my-namespace --wait

Credentials are read from YD_API_KEY_ID and YD_API_KEY_SECRET, in the environment or in a .env file.

How it works

A Ray cluster is one YellowDog work requirement. Each kind of node (the head, each pool of workers) is a task group fed by its own worker pool, and each node is a task: the script that starts Ray on it. Ending the task ends the node, and YellowDog releases the instance. Every cluster has a lifetime, 24 hours by default, after which it is stopped whatever else has happened.

In this repository

  • examples/autoscaler and examples/builder: complete, runnable examples, with the scripts that set nodes up and start Ray.
  • packer: a Packer template for an AWS machine image with the YellowDog Agent, Python and Ray installed, which makes nodes start much faster than setting them up at boot.
  • docs: the documentation source.
  • tests: the test suite; tests/README.md explains its tiers, including the tests that run against a live YellowDog account.

Development

uv venv && source .venv/bin/activate
make install      # uv pip install -e ".[dev,docs]"
make lint typecheck test

DEVELOPMENT.md is the guide for working on RayDog itself: the architecture, the rules that must stay true, what RayDog relies on YellowDog and Ray to do, testing and debugging. See RELEASING.md for how releases are made.

Licence

Apache 2.0. See LICENSE.

Metadata

Release files for yellowdog-ray 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yellowdog-ray 3.0.0
File Size Uploaded Provenance Actions
yellowdog_ray-3.0.0.tar.gz 76.2 kB Without provenance Details for yellowdog_ray-3.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yellowdog-ray 3.0.0
File Interpreter ABI Platform Actions
yellowdog_ray-3.0.0-py3-none-any.whl Python 3 none any Details for yellowdog_ray-3.0.0-py3-none-any.whl

Total release size: 159.4 kB

Release files / yellowdog_ray-3.0.0.tar.gz

Download URL yellowdog_ray-3.0.0.tar.gz
Size 76.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f410da82ab18a6d4511e41fa7149093f969d5bc2acc67e7c66df0023283daac0
BLAKE2b-256 checksum
How to use checksums
f493732aead4e9185382e167dd610a18d0d5284d9122c4a16c3e61adb2d395c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / yellowdog_ray-3.0.0-py3-none-any.whl

Download URL yellowdog_ray-3.0.0-py3-none-any.whl
Size 83.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6672bb6fa57f350c02778b7ed067e64f46fcbd692793ef9640da039f886a8b9f
BLAKE2b-256 checksum
How to use checksums
e63b9b725f5cfbcee9a11de13ade594c16160038026b2357dcb229a26dc871ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for yellowdog-ray 3.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page