Run Dune verification on the Gitea job network
Verify and publish checkpoint container / container (push) Successful in 10m32s
Verify and publish checkpoint container / container (push) Successful in 10m32s
This commit is contained in:
1 parent
de7fe7d64a
commit
c012374cf1
2 files changed
+11
-3
No files matched your search
@@ -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'
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in new issue
Block a user