[Jobs] Document built-in environment variables in Jobs docs (JOB_ID, MEMORY, etc.) - #3834
Conversation
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 Agent can help with this pull request. Just |
|
Related to #3828 |
|
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. |
|
@cursor document also the 3 other env variables mentioned in huggingface/hub-docs#2241 (review) |
|
I've added documentation for the 3 additional environment variables mentioned by @coyotte508: Added to both guides: The examples have also been updated to show how to access all 4 environment variables. Changes pushed to the PR branch. |
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>
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>


Document the
JOB_IDenvironment variable in Jobs CLI and Python API guides to enable programmatic access for users.The
JOB_IDenvironment 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
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 jobsCLI guide and the Pythonrun_jobguide.Adds a new section listing
JOB_ID,ACCELERATOR,CPU_CORES, andMEMORY, plus small examples showing how to read them fromos.environfor logging/adapting to available resources.Written by Cursor Bugbot for commit f4b0bd2. This will update automatically on new commits. Configure here.