Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
27d193f
refactor!: rust rewrite of the server
LouisHaftmann Oct 23, 2026
f6827d8
perf(db): skip the connection ping on sqlite pool checkout
LouisHaftmann Oct 23, 2026
11ddb3a
test: benchmark comparing server images
LouisHaftmann Oct 23, 2026
00bde51
perf(db): run SQLite in WAL mode with normal sync
LouisHaftmann Oct 24, 2026
aa0cf85
perf: use mimalloc and read files in 256 KiB chunks
LouisHaftmann Oct 24, 2026
d135032
perf(storage): upload merges to object storage four parts at a time
LouisHaftmann Oct 24, 2026
ed1ce91
perf(db): serve SQLite lookups from read-only connections
LouisHaftmann Oct 24, 2026
88610af
perf(storage): match a cache entry in at most two queries
LouisHaftmann Oct 24, 2026
bc82adf
perf(db): build SQLite without memory statistics
LouisHaftmann Oct 24, 2026
9dc6b33
perf(db): match key prefixes with substr on SQLite
LouisHaftmann Oct 24, 2026
6117f85
perf(storage): merge filesystem parts with a kernel copy
LouisHaftmann Oct 24, 2026
b7c5d7c
fix(scope): warn once that token validation is disabled
LouisHaftmann Oct 24, 2026
b42928b
perf(storage): serve single-part entries without a merge
LouisHaftmann Oct 24, 2026
d40b708
perf(db): checkpoint the SQLite WAL every 10000 pages
LouisHaftmann Oct 24, 2026
bfbac1d
perf(storage): stream parts of known length to object storage in one …
LouisHaftmann Oct 24, 2026
ea3ba4f
perf(storage): stream merges to object storage in one request
LouisHaftmann Oct 24, 2026
7417bdd
perf(storage): remember objects seen to exist for a minute
LouisHaftmann Oct 24, 2026
1c8eb7b
style: format with nightly rustfmt
LouisHaftmann Oct 24, 2026
c022ace
Merge branch 'dev' into refactor/rust-rewrite
LouisHaftmann Oct 24, 2026
e85d8a8
refactor: encode a download's extent in one enum and follow the glossary
LouisHaftmann Oct 24, 2026
bd0e6a2
fix: fence merge claims on merged state, time out presigned uploads, …
LouisHaftmann Oct 24, 2026
0621174
refactor: drop unread object names and upload fields, simplify match …
LouisHaftmann Oct 24, 2026
05112e7
fix: keep the original server's config, schedule and API contracts
LouisHaftmann Oct 24, 2026
7caec64
refactor(db): pick the SQLite URL mode from the connection's access
LouisHaftmann Oct 24, 2026
3319d29
refactor(cleanup): align schedules with duration_trunc
LouisHaftmann Oct 24, 2026
d984f96
fix: close the remaining gaps to the original server's contracts
LouisHaftmann Oct 24, 2026
e1b4322
fix: time out uploads on silence, buffer passthrough bodies, read del…
LouisHaftmann Oct 24, 2026
f6bbbad
fix(cleanup): schedule across DST changes like cron
LouisHaftmann Oct 24, 2026
5b93fe3
fix(storage): track presigned upload progress in small pieces and thr…
LouisHaftmann Oct 24, 2026
a39f219
Merge branch 'dev' into refactor/rust-rewrite
LouisHaftmann Oct 25, 2026
dd0c232
fix: port dev's merge cap, stalled-client timeout and log redaction
LouisHaftmann Oct 25, 2026
1392819
test: run the stalled-client test on filesystem storage only
LouisHaftmann Oct 25, 2026
2141383
Merge dev into refactor/rust-rewrite
LouisHaftmann Oct 26, 2026
0734f96
docs(helm): fix stale eagerMerge, preStop and S3 comments in values.yaml
LouisHaftmann Oct 26, 2026
13e3916
Merge dev into refactor/rust-rewrite
LouisHaftmann Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[env]
# SQLite's memory statistics take a global mutex on every allocation, which serializes the
# read connections; nothing reads the statistics.
LIBSQLITE3_FLAGS = "-DSQLITE_DEFAULT_MEMSTATUS=0"
2 changes: 1 addition & 1 deletion .codex/environments/environment.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version = 1
name = "github-actions-cache-server"

[setup]
script = "pnpm install"
script = "cargo fetch"
25 changes: 6 additions & 19 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
node_modules/
.git/
.github/
.nitro/
.output/
.vscode/
data/
.env*
.eslintcache
tests/
certs/
install/
benchmark.ts
docker-compose.yml
vitest.config.ts
prettier.config.js
eslint.config.js
README.md
LICENSE
*
!Cargo.toml
!Cargo.lock
!rust-toolchain.toml
!src
!.cargo
6 changes: 3 additions & 3 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Fast commit gate: lint (ESLint + Prettier) and type-check. The test matrix runs in CI.
# Fast commit gate: format check and clippy. The test matrix runs in CI.
set -e
pnpm run lint
pnpm run type-check
cargo +nightly fmt --check
cargo clippy --all-targets --locked
78 changes: 30 additions & 48 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,61 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
lint:
name: πŸ’… Lint
runs-on: ubuntu-latest
steps:
- name: pnpm install
uses: falcondev-it/.github/actions/pnpm-install@master
- uses: actions/checkout@v6

- name: Cache ESLint & Prettier
uses: actions/cache@v5
with:
path: |
.eslintcache
node_modules/.cache/prettier/.prettier-cache
key: eslint-prettier-cache-${{ runner.os }}
- name: Install nightly rustfmt
run: rustup toolchain install nightly --profile minimal --component rustfmt

- run: pnpm run lint:ci
- run: cargo +nightly fmt --check

type-check:
name: πŸ›ƒ Type Check
runs-on: ubuntu-latest
steps:
- name: pnpm install
uses: falcondev-it/.github/actions/pnpm-install@master
- name: Install toolchain
run: rustup toolchain install

- uses: Swatinem/rust-cache@v2

- run: cargo clippy --all-targets --locked

- run: pnpm run type-check
- run: node --test scripts/*.test.mjs

test-unit:
name: πŸ§ͺ Unit Tests
test:
name: πŸ§ͺ Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
storage-driver: [filesystem, s3, gcs, azblob]
db-driver: [postgres, mysql, sqlite]
steps:
- name: pnpm install
uses: falcondev-it/.github/actions/pnpm-install@master
- uses: actions/checkout@v6

- name: Install toolchain
run: rustup toolchain install

- uses: Swatinem/rust-cache@v2

- run: pnpm run test:run
- name: Start services
run: scripts/test-services.sh ${{ matrix.db-driver }} ${{ matrix.storage-driver }}

- run: cargo test --locked
env:
VITEST_DB_DRIVER: ${{ matrix.db-driver }}
VITEST_STORAGE_DRIVER: ${{ matrix.storage-driver }}
TEST_DB_DRIVER: ${{ matrix.db-driver }}
TEST_STORAGE_DRIVER: ${{ matrix.storage-driver }}

deploy:
if: github.event.ref == 'refs/heads/dev'
name: πŸš€ Build and push
permissions:
packages: write
contents: read
needs: [lint, type-check, test-unit]
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -88,9 +93,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

Expand All @@ -104,23 +106,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_HASH=${{ steps.build_hash.outputs.COMMIT_SHA }}

- name: Extract metadata (tags, labels) for Docker (caged)
id: meta-caged
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
tags: |
dev-caged

- name: Build and push (caged)
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta-caged.outputs.tags }}
labels: ${{ steps.meta-caged.outputs.labels }}
build-args: |
BUILD_HASH=${{ steps.build_hash.outputs.COMMIT_SHA }}
BASE_IMAGE=platformatic/node-caged:26.12.1-alpine
40 changes: 4 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version-file: package.json
node-version: lts/*

- name: ⬆️ Bump version
if: github.event_name == 'workflow_dispatch'
Expand All @@ -63,13 +63,9 @@ jobs:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

npx bumpp ${{ env[inputs.version] }} -y -r --commit "chore(release): v%s" --no-push

export VERSION=$(node -p "require('./package.json').version")
node scripts/release-metadata.mjs bump ${{ inputs.chart_version }}
git stage install/kubernetes/github-actions-cache-server/Chart.yaml
git commit -n --no-edit --amend
git tag -f "v$VERSION"
VERSION=$(node scripts/release-metadata.mjs bump ${{ env[inputs.version] }} ${{ inputs.chart_version }})
git commit -n -am "chore(release): v$VERSION"
git tag "v$VERSION"

echo "RELEASE_REF=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

Expand Down Expand Up @@ -145,9 +141,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

Expand All @@ -160,31 +153,6 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Extract metadata (tags, labels) for Docker (caged)
id: meta-caged
uses: docker/metadata-action@v6
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=false
tags: |
type=semver,pattern={{version}}-caged,value=${{ needs.release.outputs.RELEASE_TAG }}
type=semver,pattern={{major}}.{{minor}}-caged,value=${{ needs.release.outputs.RELEASE_TAG }}
type=semver,pattern={{major}}-caged,value=${{ needs.release.outputs.RELEASE_TAG }}
latest-caged
dev-caged

- name: Build and push (caged)
uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-caged.outputs.tags }}
labels: ${{ steps.meta-caged.outputs.labels }}
build-args: |
BASE_IMAGE=platformatic/node-caged:26.12.1-alpine

deploy-chart:
name: πŸš€ Build and push Helm chart
permissions:
Expand Down
17 changes: 4 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
node_modules
*.log*
.nitro
.cache
.output
.env.local
dist
data/
.eslintcache
/target
.data
.idea
data/
.env.local
.DS_Store
tests/temp/
actions-runner/
benchmark.csv
.idea
8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

23 changes: 3 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"prettier.enable": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},
"eslint.useFlatConfig": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
],
"tailwindCSS.classAttributes": ["class", "className", "ngClass", "classes"]
"rust-analyzer.check.command": "clippy",
"rust-analyzer.check.allTargets": true,
"rust-analyzer.rustfmt.extraArgs": ["+nightly"]
}
19 changes: 13 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
## Commit gate

`pnpm lint` and `pnpm type-check` pass clean, and `pnpm test:run` is green for every driver combo your change touches. The pre-push hook in `.githooks/` runs lint and type-check; `pnpm install` wires it up. `pnpm lint:fix` applies ESLint and Prettier fixes. Prettier also checks Markdown, YAML and JSON, so run the gate after docs-only edits too.
`cargo +nightly fmt --check` and `cargo clippy --all-targets --locked` pass clean, and `cargo test` is green for every driver combo your change touches. The pre-push hook in `.githooks/` runs fmt and clippy; wire it up once per clone with `git config core.hooksPath .githooks`. Release tooling changes also need `node --test scripts/*.test.mjs`.

## Tests

`tests/setup.ts` builds the server, serves it on port 3000 and starts the database and storage containers through testcontainers. Pick the combo with `VITEST_DB_DRIVER` (`sqlite` default, `postgres`, `mysql`) and `VITEST_STORAGE_DRIVER` (`filesystem` default, `s3`, `gcs`, `azblob`), and pass test files as arguments:
Every test starts its own server on a free port. `cargo test` alone runs against SQLite and filesystem storage. For another combo, start its services with `scripts/test-services.sh <db> <storage>` (`sqlite`, `postgres`, `mysql` Γ— `filesystem`, `s3`, `gcs`, `azblob`), then pick it with `TEST_DB_DRIVER` and `TEST_STORAGE_DRIVER`:

```sh
pnpm test:run tests/range-download.test.ts
VITEST_DB_DRIVER=postgres VITEST_STORAGE_DRIVER=s3 pnpm test:run tests/s3-storage.test.ts
cargo test downloads
scripts/test-services.sh postgres s3
TEST_DB_DRIVER=postgres TEST_STORAGE_DRIVER=s3 cargo test
```

`pnpm test:matrix` runs all 12 combos in sequence; CI runs them as a parallel matrix.
CI runs all 12 combos as a parallel matrix.

The server and containers bind fixed host ports: 3000 (server), 5432 (postgres), 3306 (mysql), 9000 (s3, gcs), 10000 (azblob). Run one test run per machine at a time: stop `pnpm dev` and test runs in other worktrees first, and confirm the ports are free with `ss -ltn`. `EADDRINUSE` or a container port-bind error means a collision, so free the port and rerun.
The service containers are named `gha-test-<service>` and bind fixed host ports: 5432 (postgres), 3306 (mysql), 9000 (s3), 4443 (gcs), 10000 (azblob). The script doesn't remove them; `docker rm -f` a leftover container before rerunning it. When a port is taken by another worktree, override it with `TEST_<SERVICE>_PORT` (e.g. `TEST_POSTGRES_PORT=5433`) for both the script and `cargo test`.

## External contributions

External contributions are disabled. If you are not working for a maintainer, report findings as GitHub issues instead of implementing changes or opening PRs. Each issue covers exactly one bug or feature; file separate issues for unrelated ones.

## Commands

- `cargo +nightly fmt` formats; the rules in `rustfmt.toml` need nightly rustfmt.
- `cargo clippy --all-targets` lints; `Cargo.toml` denies a strict lint set, and exceptions are `#[expect(lint, reason = "...")]`, never `#[allow]`.
- `cargo run --release --example benchmark -- label=image ...` compares server images (startup, memory, CPU, transfer speed, lookup latency); it needs Docker with cgroup v2.

## Agent skills

### Issue tracker
Expand Down
Loading
Loading