Files
zeekayandHanzo Dev 3865963ddb Serve static sites from memory, checked against the store once a second
Every request to an object-store root cost a HEAD and a GET to S3, 80 ms at
the median, before a byte left the ingress. One process-wide cache, bounded at
256 MiB and shared by every site, now holds objects up to 2 MiB with their
absence: an entry checked within the last second is served from memory, an
older one costs one HEAD, and the bytes are read again only when the ETag
moved. Sites publish in place, so a publish is served within a second.
Concurrent misses ask the store once; a store that stops answering leaves held
objects serving.

Text is held brotli-encoded beside its bytes and sent that way to a client
that accepts br, as its own representation (ETag "<tag>-br", Vary). Cloudflare
was pulling 557 KB of docs HTML uncompressed across the country per miss.

Everything under /_next/static/ is immutable whatever its extension. Every
middleware shares one S3 client and its connection pool.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-03 11:33:14 -07:00

37 lines
1.8 KiB
YAML

# Canonical CI config for hanzoai/ingress — read by the hanzoai/ci reusable
# (.hanzo/workflows/cicd.yml) and platform.hanzo.ai. ci.hanzo.ai builds this on the
# git-runner pool (act_runner on git.hanzo.ai); hanzoai/ci pushes to `repo:` and
# server-side-mirrors to registry.hanzo.ai.
#
# WHY THIS FILE EXISTS: ingress was the last core repo still building through
# .github/workflows/ci.yml on GitHub Actions, so it was outside git.hanzo.ai /
# ci.hanzo.ai / cd.hanzo.ai — two ways to build one fleet. It is also why a commit
# that had been on main for hours had no image: nothing on the native pipeline was
# watching this repo.
#
# The Dockerfile is self-contained: its first stage builds the webui bundle with
# pnpm, which is what `go build ./cmd/ingress` needs (webui/embed.go embeds
# webui/static) and why a bare local Go build fails without it. So the image build
# needs no separate asset step.
#
# TAGS: `sha-<sha7>-amd64` on every main push, and the bare semver on a cut v* tag.
# PIN THE DIGEST in universe — infra/k8s/ingress/deployment.yaml already does
# (`:1.10.6@sha256:…`), which is the practice to keep: a digest cannot be re-pointed.
images:
- name: ingress
context: .
dockerfile: Dockerfile
repo: ghcr.io/hanzoai/ingress
platforms: [linux/amd64, linux/arm64]
# Ported from the retired GitHub Actions `test` job. The Go tests need the webui
# bundle present, because webui/embed.go embeds webui/static and the package will
# not compile without it.
test:
- name: go
run: |
corepack enable && corepack prepare [email protected] --activate
( cd webui && pnpm install --frozen-lockfile && pnpm build )
go mod download
go test . ./pkg/api/... ./pkg/kms/... ./pkg/provider/acme/... ./pkg/tls/... ./pkg/middlewares/staticfiles/...