Skip to content

[Jobs] Document built-in environment variables in Jobs docs (JOB_ID, MEMORY, etc.) - #3834

Merged
Wauplin merged 5 commits into
mainfrom
cursor/jobs-cli-environment-variable-documentation-f639
Feb 24, 2026
Merged

Wauplin merged 5 commits into
mainfrom
cursor/jobs-cli-environment-variable-documentation-f639

Conversation

@Wauplin

@Wauplin Wauplin commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

Document the JOB_ID environment variable in Jobs CLI and Python API guides to enable programmatic access for users.

The JOB_ID environment variable is automatically available inside job containers and can be used by users to programmatically access their job's unique identifier, which is useful for tasks like storing job outputs in a uniquely named dataset.


Slack Thread

Open in Web Open in Cursor 


Note

Low Risk
Docs-only change that adds new reference material; no runtime behavior or APIs are modified.

Overview
Documents built-in environment variables available inside Jobs containers in both the hf jobs CLI guide and the Python run_job guide.

Adds a new section listing JOB_ID, ACCELERATOR, CPU_CORES, and MEMORY, plus small examples showing how to read them from os.environ for logging/adapting to available resources.

Written by Cursor Bugbot for commit f4b0bd2. This will update automatically on new commits. Configure here.

Document the JOB_ID environment variable that is automatically available
inside job containers. This allows users to programmatically access the
job ID, for example to store outputs in a dataset with a unique name.

- Add 'Built-in Environment Variables' section to jobs.md guide
- Add 'Built-in Environment Variables' section to cli.md guide
- Include usage examples showing how to access JOB_ID from within a job

Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
@cursor

cursor Bot commented Feb 24, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✔️

@Wauplin

Wauplin commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator Author

Related to #3828

@Wauplin
Wauplin marked this pull request as ready for review February 24, 2026 11:19
@Wauplin Wauplin changed the title Jobs CLI environment variable documentation [Jobs] Document JOB_ID environment variable in Jobs docs Feb 24, 2026
@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin

Wauplin commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor document also the 3 other env variables mentioned in huggingface/hub-docs#2241 (review)

@cursor

cursor Bot commented Feb 24, 2026

Copy link
Copy Markdown

I've added documentation for the 3 additional environment variables mentioned by @coyotte508:

Added to both guides:
ACCELERATOR - The type of accelerator available (e.g., nvidia-a10g, nvidia-l4, google-tpu-v5-lite-podslice). Empty if no accelerator.
CPU_CORES - The number of CPU cores available to the job (e.g., 2, 4, 8).
MEMORY - The amount of memory available to the job (e.g., 16Gi, 32Gi).

The examples have also been updated to show how to access all 4 environment variables. Changes pushed to the PR branch.

Open in Web Open in Cursor 

Add documentation for the 3 additional built-in environment variables
that are available inside job containers:
- ACCELERATOR: Type of accelerator (nvidia-a10g, nvidia-l4, etc.)
- CPU_CORES: Number of CPU cores available
- MEMORY: Amount of memory available (e.g., 16Gi, 32Gi)

These were mentioned in hub-docs PR #2241 review by @coyotte508.

Co-authored-by: Lucain <Wauplin@users.noreply.github.com>

@hanouticelina hanouticelina left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

Comment thread docs/source/en/guides/cli.md Outdated
Swap outer and inner quotes to fix Python syntax error when running
the example command. Use double quotes for shell and single quotes
for f-string to allow proper escaping of dictionary key quotes.

Co-authored-by: Lucain <Wauplin@users.noreply.github.com>
@Wauplin Wauplin changed the title [Jobs] Document JOB_ID environment variable in Jobs docs [Jobs] Document built-in environment variables in Jobs docs (JOB_ID, MEMORY, etc.) Feb 24, 2026
Comment thread docs/source/en/guides/jobs.md Outdated
Comment thread docs/source/en/guides/cli.md Outdated
@Wauplin
Wauplin merged commit 9af3974 into main Feb 24, 2026
7 checks passed
@Wauplin
Wauplin deleted the cursor/jobs-cli-environment-variable-documentation-f639 branch February 24, 2026 14:25
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.

3 participants