Skip to content

About

GitHub Actions cache for a cirun GCP runner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

cirun-gcs-cache-demo

Minimal demo: GitHub Actions cache for a cirun GCP runner, stored in a GCS bucket via S3 interoperability (HMAC keys). Bucket managed by OpenTofu, with tofu state in a separate GCS bucket and applied from CI.

Auto-mode caching (extra_config.cache: true) is AWS-only today; this is the GCP path.

Layout

.cirun.yml                          n1-standard-2, Ubuntu 24.04 amd64, us-central1-a
.github/workflows/cache-demo.yml    cache job using cirunlabs/cache/s3 → GCS
.github/workflows/tofu.yml          plan on PR, apply on push to main
tofu/                               bucket + IAM (state in its own GCS bucket)
bootstrap-state.sh                  one-time: state bucket, SA, HMAC, repo secrets

One-time bootstrap

GCP_PROJECT=<gcp-project-id> REPO=<owner>/<repo> ./bootstrap-state.sh

Creates the state bucket, a cirun-runner service account, an HMAC key, and pushes seven repo secrets via stdin (values never appear in shell args): GOOGLE_CREDENTIALS, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, GCP_PROJECT_ID, TOFU_STATE_BUCKET, GCS_CACHE_BUCKET, RUNNER_SA_EMAIL.

Idempotent — safe to re-run.

You still need to connect the GCP cloud credential to cirun in the dashboard (same SA JSON) so cirun can launch the runner VM. Bootstrap doesn't do that.

After bootstrap

Push to main. The OpenTofu workflow creates the cache bucket; the cache-demo workflow runs the job, MISSes on first run, saves a 64 MiB random payload, HITs on every subsequent run.

Workarounds baked into this demo

Where Why
Image pinned to ubuntu-minimal-2404-noble-amd64-v20260507 (not the family) cirun-go's GCP image resolver has no GetFromFamily fallback today.
AWS_*_CHECKSUM_*=WHEN_REQUIRED on the cache step AWS SDK v3 default checksum-validation trips "Checksum mismatch" on GCS-interop ranged GETs.
GCS-side lifecycle in tofu/main.tf instead of s3-ttl-days The action's lifecycle XML is rejected by GCS.

About

GitHub Actions cache for a cirun GCP runner

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages