datarobot-oss/datarobot-agent-skills / skills/datarobot-workload-api
datarobot-workload-api
VerifiedUse when the user wants to create, configure, scale, debug, observe, or roll out container workloads on DataRobot's Workload API. Triggers: deploy a container as a managed service; list/start/stop workloads; change replica counts or autoscaling; pick CPU/GPU compute bundles; inject DataRobot credentials as env vars; diagnose stuck/errored/crash-looping workloads (CrashLoopBackOff, ImagePullBackOff, OOMKilled, probe failures, exec format error); pull application logs/OpenTelemetry traces/metrics/request stats; create or iterate container artifacts; build images server-side; lock artifacts for production; zero-downtime rolling artifact replacement.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 18.7 KB |
| references/cli-command-map.md | markdown | 4.1 KB |
| references/code-to-workload.md | markdown | 15.2 KB |
| references/common-error-patterns.md | markdown | 6.9 KB |
| references/declarative-cli-deploy.md | markdown | 12.4 KB |
| references/lifecycle-flows.md | markdown | 7.4 KB |
| references/schema-reference.md | markdown | 5.8 KB |
| references/status-vocabulary.md | markdown | 4.1 KB |
| references/web-uis-behind-the-edge.md | markdown | 14.0 KB |
| scripts/check_limits.py | script | 2.8 KB |
| scripts/diagnose_workload.py | script | 8.7 KB |
| scripts/wait_for_build.py | script | 4.1 KB |
| scripts/wait_for_replacement.py | script | 4.0 KB |
| scripts/wait_for_running.py | script | 3.0 KB |
scripts/wait_for_build.py
View on GitHub# Copyright (c) 2026 DataRobot, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""Poll a server-side artifact image build until the image is deployable.
IMPORTANT: only COMPLETED means the image is pushed to the registry and
deployable. BUILT is an intermediate state — the image has been built
locally but NOT yet pushed. Scheduling a workload on a BUILT artifact
returns `422 runtime_image_uri ... None` because the registry can't
resolve the imageUri yet. This script waits for COMPLETED specifically;
BUILT keeps polling.
Build progression: pending → in-progress → BUILT (built, not yet pushed)
→ COMPLETED (pushed, deployable). Lowercase variants (`completed`,
`failed`) from the C2W flow are normalized to uppercase before
comparison.
Reads DATAROBOT_ENDPOINT (must include /api/v2) and DATAROBOT_API_TOKEN
from the environment. Exits 0 on COMPLETED, 2 on FAILED (prints last
2KB of build logs to stderr), 3 on timeout.
Usage:
python wait_for_build.py <artifact_id> <build_id> [--timeout SECONDS] [--interval SECONDS]
"""
from __future__ import annotations
import argparse
import os
import sys
import time
from typing import Any, cast
import httpx
# Only COMPLETED means the image is pushed to the registry and deployable.
# BUILT is intermediate (built locally, not yet pushed) — keep polling.
SUCCESS = {"COMPLETED"}
FAILURE = {"FAILED"}
Headers = dict[str, str]
Json = dict[str, Any]
def wait_for_build(
base: str,
headers: Headers,
artifact_id: str,
build_id: str,
timeout: int,
interval: int,
) -> Json:
deadline = time.time() + timeout
last_status: str | None = None
while time.time() < deadline:
r = httpx.get(
f"{base}/artifacts/{artifact_id}/builds/{build_id}/",
headers=headers,
timeout=30,
)
r.raise_for_status()
b = cast(Json, r.json())
status = (b.get("status") or "").upper()
if status != last_status:
print(
f"[{int(time.time() - (deadline - timeout)):>4}s] build status: {status}",
flush=True,
)
last_status = status
if status in SUCCESS:
return b
if status in FAILURE:
logs = httpx.get(
f"{base}/artifacts/{artifact_id}/builds/{build_id}/logs/",
headers=headers,
timeout=30,
).text
print(f"--- last 2KB of build logs ---\n{logs[-2000:]}", file=sys.stderr)
raise RuntimeError(f"Build {build_id} FAILED")
time.sleep(interval)
raise TimeoutError(
f"Build {build_id} did not finish within {timeout}s (last status: {last_status})"
)
def main() -> int:
p = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
)
p.add_argument("artifact_id")
p.add_argument("build_id")
p.add_argument(
"--timeout",
type=int,
default=1800,
help="Total poll budget in seconds (default: 1800)",
)
p.add_argument(
"--interval",
type=int,
default=15,
help="Poll interval in seconds (default: 15)",
)
args = p.parse_args()
base = os.environ.get("DATAROBOT_ENDPOINT", "").rstrip("/")
token = os.environ.get("DATAROBOT_API_TOKEN", "")
if not base or not token:
print(
"DATAROBOT_ENDPOINT and DATAROBOT_API_TOKEN must be set.", file=sys.stderr
)
return 1
headers = {"Authorization": f"Bearer {token}"}
try:
b = wait_for_build(
base, headers, args.artifact_id, args.build_id, args.timeout, args.interval
)
except RuntimeError as e:
print(f"FAILED: {e}", file=sys.stderr)
return 2
except TimeoutError as e:
print(f"TIMEOUT: {e}", file=sys.stderr)
return 3
print(
f"\nBUILD COMPLETED — image pushed to the registry. "
f"Artifact's imageUri is now populated; GET /artifacts/{args.artifact_id}/ to confirm "
f"before scheduling a workload."
)
return 0
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |