
rigcast
io.github.Killian1023/rigcast
Run GPU jobs, read logs, and fetch artifacts from your private Rigcast daemon.
Documentation
rigcast
Run jobs from a local project on a private Linux GPU host. A single Go binary provides the client CLI, a Docker-backed daemon, and an MCP server for coding agents. Jobs run asynchronously on the daemon; only workspace code goes with each submission. Datasets sync separately.
Build
Install Go 1.25 or later, then run make build. The binary is in dist/. Run
make release VERSION=0.1.0 to build CGO-free binaries for Linux, macOS, and
Windows (amd64 and arm64). You can also build directly with
CGO_ENABLED=0 go build ./cmd/rigcast in a POSIX shell.
Set up the GPU host
-
Install Docker Engine and the NVIDIA Container Toolkit on the Linux host. Confirm
docker infoandnvidia-smiwork. For a CPU-only job, setgpus: "none"; GPU status still requiresnvidia-smi. -
Install Tailscale on the host and client, join the same tailnet, and run
tailscale ip -4on the host. Restrict TCP port 7474 with your tailnet grants or ACLs to the users/devices that should have job access. -
Generate a long random bearer token (for example,
openssl rand -hex 32). SetRIGCAST_TOKENon the host and start:rigcast daemon --bind "$(tailscale ip -4):7474" --data-dir "$HOME/.local/share/rigcast"The daemon account needs access to the Docker socket. The daemon also accepts
RIGCAST_BINDandRIGCAST_DATA_DIR. For a persistent service, install the binary at/usr/local/bin/rigcast, create arigcastsystem account/group, and installdeploy/rigcast.serviceas/etc/systemd/system/rigcast.service. Create/etc/rigcast/daemon.envowned by root with mode0600:RIGCAST_BIND=100.64.10.20:7474 RIGCAST_TOKEN=YOUR_GENERATED_TOKENReplace the example IP with the host's Tailscale IP, then run
sudo systemctl daemon-reloadandsudo systemctl enable --now rigcast. -
On the client, create
~/.config/rigcast/config.yaml(or$XDG_CONFIG_HOME/rigcast/config.yaml) with owner-only access:host: "http://gpu-pc:7474" token: "YOUR_GENERATED_TOKEN"Use the host's MagicDNS name or Tailscale IP.
RIGCAST_HOSTandRIGCAST_TOKENoverride the respective fields. Runrigcast status.
Trust boundary: The daemon accepts shell commands and Docker images from anyone with its bearer token. Run it on a trusted private host with trusted users and images; it is not a multi-tenant sandbox. Docker socket access is effectively host-root access. The daemon serves plain HTTP by default; do not expose it to the public internet. Use Tailscale or a trusted HTTPS reverse proxy. Do not put credentials in project YAML, commands, or logs.
Run a job
rigcast init
rigcast data push /path/to/market-ticks market-ticks
rigcast data ls
rigcast run --dataset market-ticks -- python train.py --epochs 10
job_id=$(rigcast run --detach --dataset market-ticks -- python train.py --epochs 50)
rigcast ps --status running
rigcast logs -f --tail 30 --sanitize "$job_id"
rigcast pull "$job_id"
run follows logs by default and propagates the container's exit code.
Ctrl-C stops the local log follower; rigcast kill <job_id> cancels the
remote job. Pass separate arguments after -- for literal argument
boundaries. For shell operators, pass a single shell string, e.g.
rigcast run -- 'python train.py && cp result.json /outputs/'.
Submitted code is mounted at /workspace. Write artifacts to /outputs;
files left only in /workspace are not included in pull. Artifacts
download to ./outputs/<job_id> by default; pass a second argument to
choose another directory. Existing files are not overwritten.
Project configuration
image: "pytorch/pytorch:2.4.0-cuda12.4-cudnn9-runtime"
gpus: "all"
datasets: ["market-ticks"]
env:
PYTHONUNBUFFERED: "1"
workdir: "/workspace"
timeout: "4h"
memory_limit: "32g"
imageis required unless supplied with--image. The daemon pulls an image if it isn't available locally. The image must have/bin/sh.gpusacceptsall(default),none, or comma-separated device indices like0,1. Pass--gpusto override. Rigcast does not reserve GPUs or schedule jobs by VRAM; avoid overcommitting devices.datasetsare mounted read-only under/data/<name>.--datasetreplaces the YAML list; repeat it to mount multiple datasets.envsets container environment variables.workdirdefaults to/workspaceand may be a subdirectory.timeoutis an optional Go duration, starting before the image pull.memory_limitis an optional Docker-style memory size.
Workspace archives exclude .git, .venv, venv, __pycache__,
node_modules, .pytest_cache, and .mypy_cache directories. Root
.gitignore and .rigcastignore patterns are also applied, in that order.
Use .rigcastignore for secrets, local outputs, and large files. Symlinks
and special files are not transferred. Workspace uploads are limited to
2 GiB, both as an HTTP request and after decompression.
Datasets
data push <local_dir> <name> compares SHA-256 hashes and uploads only new
or modified regular files. Files absent locally are deleted remotely.
This is a mirror, not an append operation. Serialise pushes to the same
dataset and avoid changing the local tree during a push. Even though jobs
cannot modify datasets, an active job can see changes from a concurrent
push; use a new dataset name when a run needs a stable snapshot.
MCP
rigcast mcp uses stdio with the same client config as the CLI. It exposes
gpu_status, list_datasets, submit_job, job_status, tail_logs,
cancel_job, list_artifacts, and read_artifact. submit_job waits for
workspace upload and queuing, not for the job. Pass workdir if the
MCP process wasn't started in the project directory. tail_logs defaults
to 50 sanitized lines, with a maximum of 500 lines and 128 KiB of text.
read_artifact accepts UTF-8 text up to 100 KiB. Dataset pushes remain a
human CLI operation.
With Claude Code, register the executable using its absolute path:
claude mcp add --transport stdio rigcast -- /absolute/path/to/rigcast mcp
For Cursor, add this to .cursor/mcp.json (or ~/.cursor/mcp.json for
global configuration) and use the appropriate executable path:
{
"mcpServers": {
"rigcast": {
"command": "/absolute/path/to/rigcast",
"args": ["mcp"]
}
}
}
Prefer the user-level client config over putting tokens in MCP project files. Only grant an agent access to project directories you intend to upload and review commands before letting it start remote jobs.
npm Distribution
The rigcast-mcp npm package bundles the stdio launcher and all six
native client builds. It requires Node.js 22 or later and uses the same
private Rigcast config as the standalone binary. Once the package version
is published, register it on a workstation without manually copying a
binary:
codex mcp add rigcast -- npx -y rigcast-mcp@0.1.0
The npm package and the MCP Registry entry distribute only the client. They do not expose your daemon or include its URL, credentials, or data.
To prepare a release, update the version in npm/package.json and both
version fields in server.json, then run make npm-pack. That builds
the binaries, collects third-party notices, and creates
dist/rigcast-mcp-<version>.tgz. Use tar -tzf to inspect the package
and npm exec --yes --package=./dist/rigcast-mcp-0.1.0.tgz -- rigcast-mcp
to launch the packed server for a stdio test. Publish the tested tarball
to npm before publishing server.json with mcp-publisher:
npm publish ./dist/rigcast-mcp-0.1.0.tgz --access public
mcp-publisher login github
mcp-publisher publish
Verification
make test runs the SQLite, archive, HTTP, CLI, and MCP tests without
Docker. To test actual container execution, cleanup, and read-only dataset
mounts, run the following on a Linux host whose Docker daemon sees the
same filesystem and can pull alpine:3.22:
RIGCAST_TEST_DOCKER=1 go test -count=1 -v ./internal/daemon ./internal/cli -run Docker
These tests deliberately use gpus: "none" so they also run on a
CPU-only Docker host. On the GPU host, use NVIDIA Container Toolkit and
run rigcast run --gpus all --image nvidia/cuda:12.4.1-base-ubuntu22.04 -- nvidia-smi
from a small workspace to verify GPU passthrough. The daemon retains
workspaces, artifacts, and logs under its data directory; plan retention
and disk capacity before running large workloads. Use a local filesystem
for this directory and run only one daemon per data directory. Running
containers are left in place at daemon shutdown and reattached on startup;
jobs whose containers are no longer running are marked failed on recovery.
rigcast-mcpnpm install rigcast-mcp