Merge remote-tracking branch 'origin/main'
Verify and publish checkpoint container / container (push) Successful in 9m40s

This commit is contained in:
Quintine committed 2026-11-20 18:39:55 +11:00
commit 6ba8ecc544
4 files changed
+21 -15

No files matched your search

+2
View File
@@ -34,6 +34,8 @@ jobs:
load: true load: true
tags: dune:verify tags: dune:verify
- name: Verify isolated storage and HTTP behavior - name: Verify isolated storage and HTTP behavior
env:
DUNE_VERIFY_NETWORK: ${{ job.container.network }}
run: node tools/verify-container.mjs dune:verify run: node tools/verify-container.mjs dune:verify
- name: Configure container registry - name: Configure container registry
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
+1 -1
View File
@@ -1,6 +1,6 @@
services: services:
dune: dune:
image: ghcr.io/quintine/dune:checkpoint image: git.juiced.computer/admin/dune:checkpoint
init: true init: true
restart: unless-stopped restart: unless-stopped
environment: environment:
+9 -11
View File
@@ -17,15 +17,15 @@ the `CONTAINER_REGISTRY_TOKEN` Actions secret. The default image name is
`git.juiced.computer/admin/dune`. Registry access and image visibility depend `git.juiced.computer/admin/dune`. Registry access and image visibility depend
on the actual Gitea package settings; do not assume anonymous pulls work. on the actual Gitea package settings; do not assume anonymous pulls work.
An `ubuntu-latest` Gitea runner is configured. On 29 October 2026, run #83 The instance-wide `truenas-general` runner serves `ubuntu-latest` jobs.
On 29 October 2026, run #83
verified and published commit `b18a7674702b92b6988b00cbde6212fa3b66b74a`. verified and published commit `b18a7674702b92b6988b00cbde6212fa3b66b74a`.
The registry shows its immutable `sha-b18a7674702b92b6988b00cbde6212fa3b66b74a` The registry shows its immutable `sha-b18a7674702b92b6988b00cbde6212fa3b66b74a`
tag and `checkpoint` with the same digest. Run #85 failed before publication, tag and `checkpoint` with the same digest. Run #85 failed before publication,
so a source push still does not by itself establish a verified image or a so a source push still does not by itself establish a verified image or a
deployment. For each checkpoint, verify the relevant workflow run and its deployment. For each checkpoint, verify the relevant workflow run and its
published revision before considering a manual NAS update. The existing TrueNAS published revision before considering a manual NAS update. TrueNAS and the Compose configuration
deployment and Compose configuration continue to reference the GHCR image; a use `git.juiced.computer/admin/dune:checkpoint`, which supports anonymous pulls.
Gitea publication does not migrate them.
The previous GitHub workflow, `.github/workflows/container.yml`, builds a The previous GitHub workflow, `.github/workflows/container.yml`, builds a
production image using the lockfile on GitHub pushes. Types, lint and offline production image using the lockfile on GitHub pushes. Types, lint and offline
@@ -36,8 +36,8 @@ and rejected HTTP origins, verifies saved-seat restoration through restart and
container replacement, then runs the HTTP integration suite. container replacement, then runs the HTTP integration suite.
Only a passing GitHub image is pushed to `ghcr.io/quintine/dune:checkpoint`, Only a passing GitHub image is pushed to `ghcr.io/quintine/dune:checkpoint`,
alongside `ghcr.io/quintine/dune:sha-<full-commit>`. TrueNAS currently pulls alongside `ghcr.io/quintine/dune:sha-<full-commit>`. Failed checks leave the
that image. Failed checks leave the previous update tag untouched. This previous update tag untouched. This
workflow targets Linux AMD64, the architecture of ordinary x86 TrueNAS systems. workflow targets Linux AMD64, the architecture of ordinary x86 TrueNAS systems.
The user selected the existing GHCR image as **public**, matching the public The user selected the existing GHCR image as **public**, matching the public
@@ -112,11 +112,9 @@ See [NGINX WebSocket forwarding](https://nginx.org/en/docs/http/websocket.html).
### Applying an update ### Applying an update
1. Wait for the checkpoint workflow for the configured image registry to 1. Wait for the Gitea checkpoint workflow to succeed and confirm the intended
succeed and confirm the intended revision was published. A Gitea source revision was published. Check for image updates in TrueNAS and apply the
push alone is insufficient, and the GHCR Compose image does not automatically update manually at a safe point between decisions.
switch registries. Check for image updates in TrueNAS and apply the update
manually at a safe point between decisions.
2. Before updating, stop the app and back up or snapshot its persistent storage. 2. Before updating, stop the app and back up or snapshot its persistent storage.
Include the named volume in the Apps backup procedure; a dedicated host Include the named volume in the Apps backup procedure; a dedicated host
dataset provides a more explicit ZFS snapshot boundary. dataset provides a more explicit ZFS snapshot boundary.
+9 -3
View File
@@ -13,6 +13,11 @@ if (!image) throw new Error('Usage: node tools/verify-container.mjs IMAGE');
const name = `dune-verify-${randomUUID()}`; const name = `dune-verify-${randomUUID()}`;
const volume = `${name}-data`; const volume = `${name}-data`;
const docker = (...args) => execFileSync('docker', args, { encoding: 'utf8' }).trim(); const docker = (...args) => execFileSync('docker', args, { encoding: 'utf8' }).trim();
const jobNetwork = process.env.DUNE_VERIFY_NETWORK;
const useJobNetwork = jobNetwork && jobNetwork !== 'host';
const endpoint = () => useJobNetwork
? `http://${name}:3000`
: `http://${docker('port', name, '3000/tcp')}`;
let base; let base;
const adminFiles = mkdtempSync(joinPath(tmpdir(), 'dune-admin-container-')); const adminFiles = mkdtempSync(joinPath(tmpdir(), 'dune-admin-container-'));
let adminCookie; let adminCookie;
@@ -34,11 +39,12 @@ async function ready() {
throw new Error('Container did not become ready'); throw new Error('Container did not become ready');
} }
function start(publicOrigin = '') { function start(publicOrigin = '') {
const networkArgs = useJobNetwork ? ['--network', jobNetwork] : ['-p', '127.0.0.1::3000'];
docker('run', '-d', '--name', name, '--init', '--cap-drop=ALL', docker('run', '-d', '--name', name, '--init', '--cap-drop=ALL',
'--security-opt=no-new-privileges:true', '--security-opt=no-new-privileges:true',
'-p', '127.0.0.1::3000', '-v', `${volume}:/data`, ...networkArgs, '-v', `${volume}:/data`,
'-e', `DUNE_PUBLIC_ORIGIN=${publicOrigin}`, image); '-e', `DUNE_PUBLIC_ORIGIN=${publicOrigin}`, image);
base = `http://${docker('port', name, '3000/tcp')}`; base = endpoint();
} }
const bootstrapKeys = (logs) => logs.match(/dune-admin\.[0-9a-f-]{36}\.[0-9a-f]{64}/g) || []; const bootstrapKeys = (logs) => logs.match(/dune-admin\.[0-9a-f-]{36}\.[0-9a-f]{64}/g) || [];
function checkBootstrap(count) { function checkBootstrap(count) {
@@ -95,7 +101,7 @@ try {
stage = 'container restart and saved witnesses'; stage = 'container restart and saved witnesses';
docker('restart', '--time', '60', name); docker('restart', '--time', '60', name);
// Docker may assign a different ephemeral host port after a restart. // Docker may assign a different ephemeral host port after a restart.
base = `http://${docker('port', name, '3000/tcp')}`; base = endpoint();
await ready(); await ready();
assert.equal(checkBootstrap(1), bootstrapKey, 'Restart must not replace the owner key'); assert.equal(checkBootstrap(1), bootstrapKey, 'Restart must not replace the owner key');
await restored(); await restored();