Hugging FaceAbubakar AbidTutorial
Migrating Your GitHub CI to Hugging Face Jobs
Summary
Trackio's GitHub Actions CI was limited by generic hosted machines, maintenance-related delays, and lack of readily available GPU runners, while the project needed CPU checks and CUDA-based tests. The setup keeps GitHub Actions as the CI coordinator and uses a dispatcher Space plus the huggingface/jobs-actions bridge to launch ephemeral GitHub runners inside Hugging Face Jobs, selected through labels such as hf-jobs-cpu-upgrade and hf-jobs-t4-small. The guide covers duplicating and configuring the dispatcher, creating a GitHub App, supplying runner credentials and an HF token, changing runs-on, choosing Docker images, and validating runs and logs; Playwright and NVIDIA CUDA images are used for CPU and GPU examples. In Trackio, the CPU job took 1m10s versus a 1m40s GitHub ubuntu-latest baseline, while the GPU check passed in 45s and cost less than a cent at the t4-small rate; logs were available through both systems.
Context
Trackio wanted reliable CPU CI for basic unit tests and frontend checks, plus GPU CI for tests requiring actual CUDA hardware. The article also says GitHub-hosted runners use generic machines, can be slow or unavailable during maintenance, and do not make GPU access readily available to most open-source projects.
Approach / What changed
A dispatcher Docker Space receives GitHub workflow_job.queued webhooks, verifies them, checks for hf-jobs-* labels, mints a short-lived GitHub runner registration token, and starts a Hugging Face Job on matching hardware. The Job boots an ephemeral GitHub Actions runner, which executes the workflow and reports status back to GitHub. Setup involves creating the dispatcher, installing a GitHub App, adding credentials and tokens, changing runs-on labels, and selecting suitable Docker images.
Takeaways
Changing a workflow from runs-on: ubuntu-latest to labels such as hf-jobs-cpu-upgrade or hf-jobs-t4-small routes the job to Hugging Face Jobs through the dispatcher.
Trackio's CPU job using the Microsoft Playwright image ran in 1m10s, compared with 1m40s for the GitHub ubuntu-latest baseline, an improvement of about 30%.
Trackio's GPU check ran on a t4-small Hugging Face Job, passed in 45 seconds, and cost less than a cent for that duration; Hugging Face Job logs can also be fetched with the CLI.
Source and freshness
- Source
- huggingface.co
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.