Skip to content

Commit 8847bca

Browse files
authored
[iris] Propagate --region/--zone into --reserve entries (#4989)
The controller's reservation claim loop only evaluates each entry's own constraints plus auto-injected device constraints, so iris job run --region X --reserve DEVICE would claim matching devices in any region. Mirror the holder-job fallback in transitions.py by merging the job's routing constraints (region/zone/preemptible) into each parsed entry before submit, and add a regression test. Fixes #4988
1 parent 9bb6cad commit 8847bca

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/iris/src/iris/cli/job.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,17 @@ def run_iris_job(
598598

599599
reservation: list[ReservationEntry] | None = None
600600
if reserve:
601+
# --reserve is mutually exclusive with --region/--zone: the controller's
602+
# claim loop only evaluates each reservation entry's own constraints, so
603+
# job-level routing constraints would not gate worker claims (#4988).
604+
# A caller who needs a specific region/zone should name it directly; a
605+
# caller who uses a reservation is by definition not picking the region.
606+
if regions or zone:
607+
raise click.UsageError(
608+
"--reserve cannot be combined with --region or --zone. "
609+
"Use --region/--zone to target a specific location, or --reserve "
610+
"to claim from a reservation (which chooses the location for you)."
611+
)
601612
reservation = []
602613
for spec in reserve:
603614
reservation.extend(parse_reservation_spec(spec))

0 commit comments

Comments
 (0)