|
Download README.md from wulukewu/gitlab-runner-docker-hf: direct link, hf CLI and curl.
- Browser
- Download file 3.28 kB
-
https://huggingface.co/spaces/wulukewu/gitlab-runner-docker-hf/resolve/main/README.md
- Command line
-
hf download hf://spaces/wulukewu/gitlab-runner-docker-hf/README.md
-
curl -L -o README.md https://huggingface.co/spaces/wulukewu/gitlab-runner-docker-hf/resolve/main/README.md
3.28 kB
metadata
title: GitLab Runner Docker HF
sdk: docker
app_port: 7860
GitLab Runner Docker — Hugging Face Spaces Edition
A highly customizable GitLab Runner packaged in a Docker container, designed for Hugging Face Spaces. Features automatic configuration generation and a built-in status dashboard.
Features
- Multi-Token Support: Register and run multiple GitLab Runners using a comma-separated list of tokens.
- Auto-Configuration: Generates
config.tomldynamically from environment variables on startup. - Built-in Dashboard: Lightweight Python-based dashboard to monitor runner status and jobs.
- Supervisor Managed: Ensures both the GitLab Runner and the dashboard stay running.
- Hugging Face Spaces Ready: Pre-configured for 2 vCPU / 16 GB RAM free tier, non-root user (UID 1000).
Deploy on Hugging Face Spaces
Fork this repository to your GitHub account.
Create a new Space on Hugging Face:
- SDK: Docker
- Space hardware: CPU basic (free)
- Set
app_portto7860
Connect your repository to the Space (Settings → Repository).
Set secrets in your Space settings:
RUNNER_TOKEN: Your GitLab runner authentication token(s), comma-separated for multiple runners.GITLAB_API_TOKEN: Personal Access Token withread_apiscope (for the dashboard).RUNNER_NAME: Name prefix for the runners.GITLAB_GROUP_ID: Optional group ID to scope the dashboard.
Keep awake (free tier sleeps after 48h of inactivity):
- Use UptimeRobot (free) to ping
https://your-space.hf.space/healthevery 5 minutes. - Or use a GitHub Actions cron job with curl.
- Use UptimeRobot (free) to ping
Quick Start (Local)
cp .env.example .env
# Edit .env and set RUNNER_TOKEN
docker compose up -d
# Dashboard at http://localhost:7860
Configuration
| Variable | Description | Default |
|---|---|---|
RUNNER_TOKEN |
Required. One or more runner tokens (comma-separated). | - |
GITLAB_API_TOKEN |
PAT with read_api for the dashboard. |
- |
GITLAB_URL |
Your GitLab instance URL. | https://gitlab.com |
RUNNER_NAME |
Base name for the runners. | gitlab-runner |
RUNNER_EXECUTOR |
Executor type (shell, docker). |
shell |
RUNNER_CONCURRENT |
Max parallel jobs. | 2 |
DASHBOARD_PORT |
Dashboard port. | 7860 |
Docker Executor (requires privileged mode, not available on HF Spaces free tier)
If RUNNER_EXECUTOR=docker is used:
RUNNER_DOCKER_IMAGE: Default image (default:docker:24.0.5).RUNNER_DOCKER_PRIVILEGED: Enable privileged mode (default:true).
Keep Alive
Free Hugging Face Spaces sleep after 48 hours of no traffic. To keep your runner online:
- Sign up for UptimeRobot (free, no credit card).
- Add a new monitor → HTTP(s) →
https://your-space.hf.space/health→ 5-minute interval. - The dashboard's
/healthendpoint keeps the Space awake.
Architecture
Dockerfile: Inherits fromgitlab/gitlab-runner:latest, adds Node.js 20, Python 3, Supervisor.entrypoint.sh: Generatesconfig.tomldynamically from environment variables.supervisord.conf: Manages runner + dashboard lifecycle.dashboard/: Status page and Python API server.