An experimental runner for Forgejo actions
  • Rust 97.2%
  • Shell 2.3%
  • Makefile 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Pi Coding Agent 42b68ae124
Some checks failed
CI / ci (pull_request) Failing after 23m17s
CI / ci (push) Successful in 23m0s
docs(plans): rewrite Phase 6 cache design
Replace the previous cache and artifact proxy plan with a new design
centered on a daemon trust boundary and S3 storage via pre-signed URLs.

The agent-side cache server speaks the Forgejo Runner-compatible REST
protocol (/_apis/artifactcache/) and runs on 127.0.0.1:8080 inside the
VM.  The daemon validates repository and branch on every operation and
provides pre-signed S3 URLs scoped to cache/{repo}/{branch}/.  The agent
has no S3 credentials and cannot bypass isolation.

Key decisions:

- Artifact proxy removed (VM can reach Forgejo directly)
- S3 storage: s3s-fs on daemon for Firecracker, native S3 for cloud
- Eviction: periodic background task, reservations blocked near capacity
- PR branches can read main-branch caches, writes restricted to own branch
- Daemon unreachable: graceful cache miss, job continues

Configuration: [cache] with enabled, endpoint, bucket, total_size, repo_size.
Four implementation PRs: daemon S3 server, REST cache handler, agent
integration, cloud S3 support.
2026-07-22 17:00:59 +00:00
.forgejo/workflows Add CI job 2026-07-10 18:26:00 +00:00
contrib OOM protection: MemoryLow, huge pages, zram swap, keepalives 2026-07-13 20:43:32 +00:00
docs/plans docs(plans): rewrite Phase 6 cache design 2026-07-22 17:00:59 +00:00
scripts Add host setup script and systemd VM template service 2026-06-30 13:43:51 +00:00
src Execution-time expression evaluation 2026-07-14 10:17:23 +00:00
.dockerignore Add workspace config and build infrastructure 2026-06-30 10:48:26 +00:00
.gitignore Add workspace config and build infrastructure 2026-06-30 10:48:26 +00:00
AGENTS.md Update AGENTS with testing and acceptance criteria 2026-07-09 21:11:19 +00:00
ampoule-threat-model-20260624.md Update threat model and reviews 2026-07-07 21:36:22 +00:00
ampoule-threat-model-20260707.md harden VM destroy and fix overlay path for short_id 2026-07-08 09:52:08 +00:00
Cargo.lock Execution-time expression evaluation 2026-07-14 10:17:23 +00:00
Cargo.toml Execution-time expression evaluation 2026-07-14 10:17:23 +00:00
config.toml.example Config and check improvements 2026-06-22 23:38:03 +00:00
DIFFERENTIAL_REVIEW_2026-06-21.md Add threat model and harden phase plans with security mitigations 2026-06-21 22:06:01 +00:00
DIFFERENTIAL_REVIEW_2026-07-07.md harden VM destroy and fix overlay path for short_id 2026-07-08 09:52:08 +00:00
Makefile Add workspace config and build infrastructure 2026-06-30 10:48:26 +00:00
README.md Update general metadata, style alignments, and Forgejo status-down APIs 2026-06-21 18:51:09 +00:00

Ampoule — Forgejo Actions Runner

Ampoule is a Forgejo Actions runner that executes each job inside an ephemeral, isolated environment. The initial backend uses Firecracker microVMs; the architecture supports alternative backends (cloud VMs, etc.) through a pluggable executor interface.

Introduction

Forgejo is a software forge, like GitHub and GitLab. It contains Forgejo Actions, which is modeled closely on GitHub Actions, but not entirely the same.

A Runner is a tool that takes job definitions from an Actions workflow and executes them.

Motivation

Since a job is essentially just some random executable code, inherently it cannot be trusted. Therefore it needs to be isolated. To combat that, this project provides a runner that creates a lightweight virtual machine to run this code in.

Naming

The project is named ampoule — a hermetically sealed, single-use glass container used in medicine and chemistry. The metaphor fits: each job gets a clean, sealed environment that is discarded after use. The name has no association with any specific technology or vendor, which is intentional given that the executor backend is designed to be swappable.