Name the remote Docker host through LINUX_HOST instead of a fixed machine name, keep test checkouts under the remote home directory, and rename the scripts, Makefile target, artifact directory and deployment module to match.
- commit
- 4eb2c99fd6cc23a5da8e2876035ad397dbe63151
- parent
- 71d8d53c8edfe93a18ed8a9bd41fa775f437858a
- author
- Dami <dami.etoile@gmail.com>
| M | Makefile | 6 | +++--- |
| M | README.md | 4 | ++-- |
| R | deploy/ | 0 | |
| M | docs/ | 12 | ++++++------ |
| M | docs/ | 16 | ++++++++-------- |
| M | internal/ | 4 | ++-- |
| R | scripts/ | 10 | +++++----- |
| R | scripts/ | 18 | +++++++++--------- |
@@ -1,4 +1,4 @@
1-1+22 33 TEST_PACKAGES ?= ./...44 @@ -20,5 +20,5 @@ docker-test:
2020 docker-build:2121 docker build --target runtime -t tinyrelay:local .2222 23-slate:24- ./scripts/test-slate.sh23+linux-test:24+ ./scripts/test-linux.sh@@ -66,7 +66,7 @@ sudo systemctl enable --now tiny
6666 6767 Keep the data directory on local durable storage. The process exposes `/healthz` and `/readyz`. An optional diagnostics listener provides `/metrics` and protected pprof endpoints. Set `--otlp-endpoint` or `OTEL_EXPORTER_OTLP_ENDPOINT` when exporting traces.6868 69-See [Personal relay deployment](docs/personal-relay.md) for the current Slate installation.69+See [Personal relay deployment](docs/personal-relay.md) for the reference installation.7070 7171 ## Test and diagnose7272 @@ -77,4 +77,4 @@ make docker-test
7777 make benchmark7878 ```7979 80-Run the Linux race suite on Slate with `SLATE_HOST=slate ./scripts/test-slate.sh`. Run the conformance harness against a started daemon with `node scripts/conformance/run.mjs`; results are written under `artifacts/conformance/`.80+Run the Linux race suite on a Docker host with `LINUX_HOST=<host> ./scripts/test-linux.sh`. Run the conformance harness against a started daemon with `node scripts/conformance/run.mjs`; results are written under `artifacts/conformance/`.No content changes.
@@ -1,6 +1,6 @@
11 # Personal relay deployment22 3-The personal relay runs on Slate and is available through Tailscale. Open [https://tiny](https://tiny) on this Mac, or use [https://tiny.tailbe516a.ts.net](https://tiny.tailbe516a.ts.net) on your phone with Tailscale connected.3+The personal relay runs on a Linux Docker host and is available through Tailscale. Open [https://tiny](https://tiny) on this Mac, or use [https://tiny.tailbe516a.ts.net](https://tiny.tailbe516a.ts.net) on your phone with Tailscale connected.44 55 ## Storage66 @@ -22,13 +22,13 @@ The service is `tiny.service`, with certificate renewal scheduled by `tiny-certi
2222 In the Tailscale admin console, open **Machines > tiny > Endpoints** to find the HTTP and HTTPS listeners. The node's key expiry is disabled.2323 2424 ```sh25-ssh slate sudo systemctl status tiny26-ssh slate sudo systemctl restart tiny27-ssh slate sudo systemctl status tiny-certificates.timer28-ssh slate docker logs tiny25+ssh <host> sudo systemctl status tiny26+ssh <host> sudo systemctl restart tiny27+ssh <host> sudo systemctl status tiny-certificates.timer28+ssh <host> docker logs tiny2929 ```3030 31-To deploy an update, build the images from a checkout on Slate, then restart the service:31+To deploy an update, build the images from a checkout on the host, then restart the service:3232 3333 ```sh3434 docker build --target runtime -t tiny:dogfood .@@ -1,4 +1,4 @@
1-# Testing and the Linux slate1+# Testing and the Linux host22 33 The normal development loop is local:44 @@ -9,17 +9,17 @@ make test
99 1010 The repository also contains a multistage Docker build. `make docker-test` runs `TEST_PACKAGES` (default `./...`) under Go 1.27.1 on Debian Bookworm with the race detector. `make docker-build` builds the self-hosted runtime image.1111 12-## Remote slate12+## Remote Linux host1313 14-`scripts/test-slate.sh` runs the same internal race test in an isolated Docker build on the configured Linux host. It synchronizes the exact worktree, including untracked files, over SSH into a unique directory under `/home/tank/tinyrelay-tests/`; it never runs global Docker cleanup and never edits host configuration.14+`scripts/test-linux.sh` runs the same internal race test in an isolated Docker build on the configured Linux host. It synchronizes the exact worktree, including untracked files, over SSH into a unique directory under `~/tinyrelay-tests/` in the remote home directory; it never runs global Docker cleanup and never edits host configuration.1515 1616 ```sh17-SLATE_HOST=slate SLATE_NAME=tinyrelay-review-1 ./scripts/test-slate.sh17+LINUX_HOST=<host> LINUX_NAME=tinyrelay-review-1 ./scripts/test-linux.sh1818 ```1919 20-Useful overrides are `SLATE_PACKAGES` (the default internal package list) and `SLATE_ARTIFACTS` (local artifact destination). The script records UTC time, host, kernel, CPU count, Docker server version, Go version, target platform, and SQLite module version beside the Docker build log, including a status file when the build fails. A unique `SLATE_NAME` is required when multiple runs share a slate host.20+Useful overrides are `LINUX_PACKAGES` (the default internal package list) and `LINUX_ARTIFACTS` (local artifact destination). The script records UTC time, host, kernel, CPU count, Docker server version, Go version, target platform, and SQLite module version beside the Docker build log, including a status file when the build fails. A unique `LINUX_NAME` is required when multiple runs share a host.2121 22-To run the complete tree on Linux, set `SLATE_PACKAGES='./...'`.22+To run the complete tree on Linux, set `LINUX_PACKAGES='./...'`.2323 2424 The runtime image is a small Debian image containing the static Go binary, `ca-certificates`, and `git`. It runs as UID 10001 (`relay`) with `/data` as the writable volume. Bind the relay and diagnostics listeners explicitly; diagnostics should stay on loopback or a protected Tailscale address and must not be published publicly.2525 @@ -29,10 +29,10 @@ The checked-in benchmarks provide a repeatable first baseline without claiming a
2929 3030 ```sh3131 make benchmark32-SLATE_HOST=slate ./scripts/bench-slate.sh32+LINUX_HOST=<host> ./scripts/bench-linux.sh3333 ```3434 35-`BenchmarkSave`, `BenchmarkQuery`, and `BenchmarkTextSearch` use a local SQLite WAL store with representative seeded events. `BenchmarkFanout` measures only the in-memory broadcast and enqueue path to 10, 100, and 1,000 subscribed clients; it excludes websocket network writes and client-reader scheduling. The slate script records the Linux host, CPU count, Docker/Go/SQLite versions, benchmark output, and exit status under `artifacts/bench/`; use `BENCH_PACKAGES` and `BENCHTIME` for controlled comparisons. Treat these as baselines until a workload and hardware matrix supports a capacity claim.35+`BenchmarkSave`, `BenchmarkQuery`, and `BenchmarkTextSearch` use a local SQLite WAL store with representative seeded events. `BenchmarkFanout` measures only the in-memory broadcast and enqueue path to 10, 100, and 1,000 subscribed clients; it excludes websocket network writes and client-reader scheduling. The benchmark script records the Linux host, CPU count, Docker/Go/SQLite versions, benchmark output, and exit status under `artifacts/bench/`; use `BENCH_PACKAGES` and `BENCHTIME` for controlled comparisons. Treat these as baselines until a workload and hardware matrix supports a capacity claim.3636 3737 For Git workloads that include child processes inside Docker, `scripts/observe-git-benchmark.py` captures the benchmark output, host load/memory, and Docker cgroup v2 CPU, memory, I/O, and PID samples every 500ms. It also snapshots authenticated `/metrics`, heap, and goroutine profiles before and after the run. The optional `--cpu-profile` captures one bounded 60-second Go CPU profile; cgroup samples remain the source for child CPU accounting.3838 @@ -72,7 +72,7 @@ func TestInboxSourceFollowsOwnerWithHourlyPull(t *testing.T) {
7272 t.Fatal(err)7373 }7474 defer app.Close(ctx)75- meta, err := app.Catalog().Create(ctx, catalog.CreateOptions{Name: "inbox", Owner: creationOwner, Template: "inbox", Source: "https://slate.example/relay"})75+ meta, err := app.Catalog().Create(ctx, catalog.CreateOptions{Name: "inbox", Owner: creationOwner, Template: "inbox", Source: "https://upstream.example/relay"})7676 if err != nil {7777 t.Fatal(err)7878 }@@ -91,7 +91,7 @@ func TestInboxSourceFollowsOwnerWithHourlyPull(t *testing.T) {
9191 if !strings.Contains(payload, `"every":1`) || !strings.Contains(payload, "#p") || !strings.Contains(payload, creationOwner) {9292 t.Fatalf("inbox source job payload = %s", payload)9393 }94- if strings.Contains(payload, "https://") || !strings.Contains(payload, "wss://slate.example/relay") {94+ if strings.Contains(payload, "https://") || !strings.Contains(payload, "wss://upstream.example/relay") {9595 t.Fatalf("inbox source URL was not converted: %s", payload)9696 }9797 }@@ -1,10 +1,10 @@
11 22 set -euo pipefail33 4-remote_host="${SLATE_HOST:-slate}"5-name="${SLATE_NAME:-tinyrelay-bench-${USER:-user}-$$}"4+remote_host="${LINUX_HOST:?set LINUX_HOST to the SSH name of the Linux Docker host}"5+name="${LINUX_NAME:-tinyrelay-bench-${USER:-user}-$$}"66 safe_name="$(printf '%s' "$name" | tr -cs 'A-Za-z0-9_.-' '-' | sed 's/^-*//;s/-*$//')"7-remote_root="/home/tank/tinyrelay-tests/${safe_name}"7+remote_root="tinyrelay-tests/${safe_name}"88 image="tinyrelay-bench-${safe_name}"99 packages="${BENCH_PACKAGES:-./internal/storage ./internal/relay}"1010 benchtime="${BENCHTIME:-5s}"@@ -19,13 +19,13 @@ COPYFILE_DISABLE=1 tar --no-xattrs \
1919 -cf - . | ssh "$remote_host" "mkdir -p '$remote_root' && tar -xf - -C '$remote_root'"2020 2121 set +e22-ssh "$remote_host" "SLATE_PACKAGES_B64='$packages_b64' sh -s -- '$remote_root' '$image' '$stamp' '$benchtime'" <<'REMOTE'22+ssh "$remote_host" "LINUX_PACKAGES_B64='$packages_b64' sh -s -- '$remote_root' '$image' '$stamp' '$benchtime'" <<'REMOTE'2323 set -eu2424 remote_root=$12525 image=$22626 stamp=$32727 benchtime=$428-packages=$(printf '%s' "$SLATE_PACKAGES_B64" | base64 -d)28+packages=$(printf '%s' "$LINUX_PACKAGES_B64" | base64 -d)2929 artifact_dir="$remote_root/artifacts/$stamp"3030 mkdir -p "$artifact_dir"3131 {@@ -1,18 +1,18 @@
11 22 set -euo pipefail33 4-remote_host="${SLATE_HOST:-slate}"5-name="${SLATE_NAME:-tinyrelay-${USER:-user}-$$}"4+remote_host="${LINUX_HOST:?set LINUX_HOST to the SSH name of the Linux Docker host}"5+name="${LINUX_NAME:-tinyrelay-${USER:-user}-$$}"66 safe_name="$(printf '%s' "$name" | tr -cs 'A-Za-z0-9_.-' '-' | sed 's/^-*//;s/-*$//')"77 if [[ -z "$safe_name" ]]; then8- echo "invalid empty SLATE_NAME" >&28+ echo "invalid empty LINUX_NAME" >&299 exit 21010 fi11-remote_root="/home/tank/tinyrelay-tests/${safe_name}"12-image="tinyrelay-slate-${safe_name}"13-packages="${SLATE_PACKAGES:-./internal/auth ./internal/blob ./internal/catalog ./internal/policy ./internal/relay ./internal/replication ./internal/storage ./internal/syncprotocol ./internal/telemetry ./internal/templates ./internal/work}"11+remote_root="tinyrelay-tests/${safe_name}"12+image="tinyrelay-linux-${safe_name}"13+packages="${LINUX_PACKAGES:-./internal/auth ./internal/blob ./internal/catalog ./internal/policy ./internal/relay ./internal/replication ./internal/storage ./internal/syncprotocol ./internal/telemetry ./internal/templates ./internal/work}"1414 stamp="$(date -u +%Y%m%dT%H%M%SZ)"15-local_artifacts="${SLATE_ARTIFACTS:-artifacts/slate/${safe_name}/${stamp}}"15+local_artifacts="${LINUX_ARTIFACTS:-artifacts/linux/${safe_name}/${stamp}}"1616 mkdir -p "$local_artifacts"1717 packages_b64="$(printf '%s' "$packages" | base64 | tr -d '\n')"1818 @@ -29,12 +29,12 @@ COPYFILE_DISABLE=1 tar \
2929 3030 echo "running Linux race tests in ${image}"3131 set +e32-ssh "$remote_host" "SLATE_PACKAGES_B64='$packages_b64' sh -s -- '$remote_root' '$image' '$stamp'" <<'REMOTE'32+ssh "$remote_host" "LINUX_PACKAGES_B64='$packages_b64' sh -s -- '$remote_root' '$image' '$stamp'" <<'REMOTE'3333 set -eu3434 remote_root=$13535 image=$23636 stamp=$337-packages=$(printf '%s' "$SLATE_PACKAGES_B64" | base64 -d)37+packages=$(printf '%s' "$LINUX_PACKAGES_B64" | base64 -d)3838 artifact_dir="$remote_root/artifacts/$stamp"3939 mkdir -p "$artifact_dir"4040 {