Skip to content

Commit c9bfd91

Browse files
author
Raunak Bhagat
authored
[FEAT] run cluster on commit (#3461)
# Overview This PR extends the existing `run-clusters` workflow with the ability to run on any arbitrary daft-wheel that is given to it.
1 parent acb8118 commit c9bfd91

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

.github/assets/.template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ setup_commands:
4848
- uv v
4949
- echo "source $HOME/.venv/bin/activate" >> $HOME/.bashrc
5050
- source .venv/bin/activate
51-
- uv pip install pip ray[default] py-spy getdaft\{{DAFT_VERSION}}
51+
- uv pip install pip ray[default] py-spy \{{DAFT_INSTALL}}

.github/ci-scripts/templatize_ray_config.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Optional
55

66
CLUSTER_NAME_PLACEHOLDER = "\\{{CLUSTER_NAME}}"
7-
DAFT_VERSION_PLACEHOLDER = "\\{{DAFT_VERSION}}"
7+
DAFT_INSTALL_PLACEHOLDER = "\\{{DAFT_INSTALL}}"
88
PYTHON_VERSION_PLACEHOLDER = "\\{{PYTHON_VERSION}}"
99
CLUSTER_PROFILE__NODE_COUNT = "\\{{CLUSTER_PROFILE/node_count}}"
1010
CLUSTER_PROFILE__INSTANCE_TYPE = "\\{{CLUSTER_PROFILE/instance_type}}"
@@ -51,6 +51,7 @@ class Profile:
5151

5252
parser = ArgumentParser()
5353
parser.add_argument("--cluster-name")
54+
parser.add_argument("--daft-wheel-url")
5455
parser.add_argument("--daft-version")
5556
parser.add_argument("--python-version")
5657
parser.add_argument("--cluster-profile")
@@ -59,10 +60,17 @@ class Profile:
5960
if args.cluster_name:
6061
content = content.replace(CLUSTER_NAME_PLACEHOLDER, args.cluster_name)
6162

62-
if args.daft_version:
63-
content = content.replace(DAFT_VERSION_PLACEHOLDER, f"=={args.daft_version}")
63+
if args.daft_wheel_url and args.daft_version:
64+
raise Exception(
65+
"Cannot specify both the `daft-wheel-name` and the `daft-version`; please choose one or the other"
66+
)
67+
elif args.daft_wheel_url:
68+
daft_install = args.daft_wheel_url
69+
elif args.daft_version:
70+
daft_install = f"getdaft=={args.daft_version}"
6471
else:
65-
content = content.replace(DAFT_VERSION_PLACEHOLDER, "")
72+
daft_install = "getdaft"
73+
content = content.replace(DAFT_INSTALL_PLACEHOLDER, daft_install)
6674

6775
if args.python_version:
6876
content = content.replace(PYTHON_VERSION_PLACEHOLDER, args.python_version)

.github/workflows/run-cluster.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ name: run-cluster
33
on:
44
workflow_dispatch:
55
inputs:
6+
daft_wheel_url:
7+
type: string
8+
description: The url pointing to a daft python-wheel for which to install and run
9+
required: false
610
daft_version:
711
type: string
8-
description: The version of daft to install
12+
description: The version of daft to install (errors if both this and `daft_wheel_url` are provided)
913
required: false
1014
python_version:
1115
type: string
@@ -62,6 +66,7 @@ jobs:
6266
(cat .github/assets/.template.yaml \
6367
| python .github/ci-scripts/templatize_ray_config.py \
6468
--cluster-name "ray-ci-run-${{ github.run_id }}_${{ github.run_attempt }}" \
69+
--daft-wheel-url '${{ inputs.daft_wheel_url }}' \
6570
--daft-version '${{ inputs.daft_version }}' \
6671
--python-version '${{ inputs.python_version }}' \
6772
--cluster-profile '${{ inputs.cluster_profile }}'

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ typeCheckingMode = "off"
9090
venv = ".venv"
9191
venvPath = "."
9292

93+
[[tool.pyright.executionEnvironments]]
94+
root = ".github/ci-scripts"
95+
9396
[tool.pytest.ini_options]
9497
addopts = "-m 'not (integration or benchmark or hypothesis)'"
9598
minversion = "6.0"

0 commit comments

Comments
 (0)