Files
xinmi/scripts/run_native_graph_backfill.mjs
T
yawan f7fc992f57
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-weknora) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-weknora) / End-to-end inside dsh (latest, advisory) (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Build & Publish (dsh-weknora) / Publish to npm (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
WeKnora deployment source with the reviewed wiki identity, summary and recovery fixes
2026-09-22 16:19:06 +08:00

25 lines
1.7 KiB
JavaScript

#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const storage = resolve(root, '..');
const context = process.env.GRAPH_DOCKER_CONTEXT || 'colima-yawan';
const container = process.env.GRAPH_APP_CONTAINER || 'yawan-native-acceptance';
const inspected = spawnSync('docker', ['--context', context, 'inspect', container], { encoding: 'utf8' });
if (inspected.status !== 0) throw new Error('Cannot inspect graph worker runtime');
const config = JSON.parse(inspected.stdout)[0];
const runtime = Object.fromEntries(config.Config.Env.map(value => {
const index = value.indexOf('=');
return [value.slice(0, index), value.slice(index + 1)];
}));
const selected = Object.fromEntries(Object.entries(runtime).filter(([key]) => /^(DB_|REDIS_)/.test(key) || key === 'LEGACY_GRAPH_ENABLE'));
const args = ['--context', context, 'run', '--rm', '--network', `container:${container}`, '-v', `${root}:/workspace:ro`, '-v', `${storage}/go-cache:/go`, '-v', `${storage}/go-build:/build-cache`, '-e', 'GOMODCACHE=/go/pkg/mod', '-e', 'GOCACHE=/build-cache', '-e', 'GRAPH_NATIVE_WRITE_VERIFIED'];
if (process.env.GRAPH_BACKFILL_REVISION) args.push('-e', 'GRAPH_BACKFILL_REVISION');
if (process.env.GRAPH_LEDGER_RECONCILE_VERIFIED) args.push('-e', 'GRAPH_LEDGER_RECONCILE_VERIFIED');
for (const key of Object.keys(selected)) args.push('-e', key);
args.push('-w', '/workspace', 'golang:1.26-bookworm', 'go', 'run', 'scripts/native_graph_backfill.go', ...process.argv.slice(2));
const result = spawnSync('docker', args, { env: { ...process.env, ...selected }, stdio: 'inherit' });
process.exitCode = result.status ?? 1;