Repository navigation
feat: jh job usage shows your compute usage against your limits - #75
Merged
Merged
Conversation
JuliaHub administrators can limit how many jobs a user can have active at once, and how many vCPUs and GPUs those jobs can use in total; a submission that would exceed a limit is rejected. `jh job usage` shows where you stand, so you (or a script, with `--json`) can check whether a job fits before submitting it:
Compute usage on juliahub.com
Jobs 3 of 50 (6%)
vCPUs 960 of 1,000 (96%)
GPUs 0 of 10
It reads the new `GET /api/v1/jobs/usage` endpoint. On a server without it, the request falls through to the job details route (`GET /api/v1/jobs/{job_name}`, for a job called `usage`) and 404s; that is reported as needing a newer JuliaHub version rather than as a generic HTTP error. A 403 means the user may not run jobs at all.
Unit tests cover the request, the 404/403/5xx and incomplete-response errors and the text output; an e2e test checks the `--json` document and skips on instances without the endpoint.
Agent-Harness: Claude Code 2.1.283
Agent-Model: claude-opus-5-5
Agent-Session: 1c99da50-3ba3-4b10-9c46-abc0d712b4d3
Agent-Review: reviewed by @lamdor
lamdor
marked this pull request as ready for review
October 16, 2026 20:15
tanmaykm
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
jh job usageto show your compute usage against your limits.JuliaHub administrators can limit how many jobs a user can have active at once, and how many vCPUs and GPUs those jobs can use in total. A submission that would exceed a limit is rejected.
jh job usageshows where you stand, so you, or a script using--json, can check whether a job fits before submitting it:How it works
GET /api/v1/jobs/usageendpoint, which returns{"jobs", "vcpus", "gpus"}, each{"used", "limit"}.GET /api/v1/jobs/{job_name}, for a job calledusage) and 404s. That 404 is reported as "this JuliaHub server does not report compute usage (it needs a newer JuliaHub version)". I checked this against a current nightly, which doesn't have the endpoint yet.The endpoint isn't in a JuliaHub release yet, so this should go out with or after the release that adds it.
Tests
usage_test.go): the request path and auth header; the 404, 403, 5xx and incomplete-response errors; the text output, including thousands separators and the at-limit marker.TestJobUsageJSON): checks the--jsondocument, and skips on instances without the endpoint.go test ./...,go vet,gofmt -sand the e2e compile check all pass locally.README and CLAUDE.md now document the command.
🤖 Posted by an AI agent · harness: Claude Code 2.1.283 · model: claude-opus-5-5
Review: reviewed by @lamdor
Session: 1c99da50-3ba3-4b10-9c46-abc0d712b4d3