Skip to content

docs: Document Serverless worker fitness checks (SDK v1.9.0)#705

Open
promptless[bot] wants to merge 3 commits into
mainfrom
promptless/serverless-fitness-checks
Open

docs: Document Serverless worker fitness checks (SDK v1.9.0)#705
promptless[bot] wants to merge 3 commits into
mainfrom
promptless/serverless-fitness-checks

Conversation

@promptless

@promptless promptless Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Open this suggestion in Promptless to view citations and reasoning process

Adds a new Serverless development page documenting custom fitness checks (the register_fitness_check decorator API) and the automatic built-in system checks with their environment-variable configuration, introduced in runpod-python v1.9.0. Also adds a release-notes entry. Updated the "Test fitness checks locally" section to reflect runpod-python PR #536: a failed check now force-kills the worker via os._exit(1) (not sys.exit(1)), so the failure is uncatchable and the prior SystemExit-based example was corrected to call check functions directly, with a warning about the runner's force-kill.

Trigger Events


Tip: Assign suggestions to team members in the Promptless dashboard to claim work 👥

promptless Bot added 3 commits June 16, 2026 01:22
… (PR #536)

A failed fitness check now force-kills the worker via os._exit(1) instead of
sys.exit(1), so the previous example that caught SystemExit around
run_fitness_checks() no longer works. Call check functions directly and add a
warning about the runner's uncatchable force-kill.

## Register a custom fitness check

Use the `@runpod.serverless.register_fitness_check` decorator to register your own checks. A check is a function that raises an exception (typically `RuntimeError`) to signal failure. If it returns without raising, the check passes. Both synchronous and asynchronous functions are supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourced the @runpod.serverless.register_fitness_check decorator API, sync/async support, startup-only execution in registration order, and the failure behavior (worker exits code 1, marked unhealthy) from the upstream worker_fitness_checks.md doc. Rewritten to fit Runpod docs style rather than copied.

Source: https://github.com/runpod/runpod-python/blob/main/docs/serverless/worker_fitness_checks.md

"""Verify required environment variables are set."""
required_vars = ["API_KEY", "MODEL_PATH", "CONFIG_URL"]
missing = [var for var in required_vars if not os.environ.get(var)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourced the automatic built-in system checks and their environment variables/defaults (RUNPOD_MIN_MEMORY_GB, RUNPOD_MIN_DISK_PERCENT, RUNPOD_NETWORK_CHECK_TIMEOUT, RUNPOD_MIN_CUDA_VERSION, RUNPOD_GPU_BENCHMARK_TIMEOUT, GPU test tuning vars) and the disable flags (RUNPOD_SKIP_AUTO_SYSTEM_CHECKS, RUNPOD_SKIP_GPU_CHECK) from the upstream doc.

Source: https://github.com/runpod/runpod-python/blob/main/docs/serverless/worker_fitness_checks.md

Comment thread release-notes.mdx

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Line 7)

Confirmed fitness checks shipped in the runpod-python v1.9.0 release, which sets the SDK version requirement (runpod>=1.9.0) noted in the release-notes entry and the new page.

Source: https://github.com/runpod/runpod-python/releases/tag/v1.9.0

asyncio.run(main())
```

<Warning>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #536 routes the unhealthy exit in rp_fitness.py through a new _terminate_unhealthy helper that calls os._exit(1) instead of sys.exit(1). Because os._exit terminates the process without raising SystemExit or running except/finally blocks, I rewrote the local-testing example to call check functions directly and added a <Warning> that run_fitness_checks() force-kills the worker uncatchably.

Source: runpod/runpod-python#536

@mintlify

mintlify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
runpod-docs 🟢 Ready View Preview Jul 11, 2026, 3:30 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants