@omen.foundation/node-microservice-runtime 0.1.89 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/publish-service.mjs +49 -11
package/package.json
CHANGED
|
@@ -469,7 +469,16 @@ async function fetchJson(url, options = {}) {
|
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
async function resolveGamePid(apiHost, token, cid, pid, explicitGamePid) {
|
|
472
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
473
|
+
console.error(`[beamo-node] [STEP: Resolve Game PID]`);
|
|
474
|
+
console.error(`[beamo-node] Explicit Game PID: ${explicitGamePid || '(none)'}`);
|
|
475
|
+
console.error(`[beamo-node] Realm PID: ${pid}`);
|
|
476
|
+
}
|
|
477
|
+
|
|
472
478
|
if (explicitGamePid) {
|
|
479
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
480
|
+
console.error(`[beamo-node] Using explicit game PID: ${explicitGamePid}`);
|
|
481
|
+
}
|
|
473
482
|
return explicitGamePid;
|
|
474
483
|
}
|
|
475
484
|
|
|
@@ -477,16 +486,28 @@ async function resolveGamePid(apiHost, token, cid, pid, explicitGamePid) {
|
|
|
477
486
|
try {
|
|
478
487
|
const url = new URL(`/basic/realms/game`, apiHost);
|
|
479
488
|
url.searchParams.set('rootPID', pid);
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
489
|
+
const requestHeaders = {
|
|
490
|
+
Authorization: `Bearer ${token}`,
|
|
491
|
+
Accept: 'application/json',
|
|
492
|
+
...(scope ? { 'X-BEAM-SCOPE': scope } : {}),
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
496
|
+
console.error(`[beamo-node] Fetching game PID from: ${url}`);
|
|
497
|
+
console.error(`[beamo-node] Headers:`, JSON.stringify(requestHeaders, null, 2));
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
const body = await fetchJson(url, { headers: requestHeaders });
|
|
501
|
+
|
|
502
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
503
|
+
console.error(`[beamo-node] Response:`, JSON.stringify(body, null, 2));
|
|
504
|
+
}
|
|
487
505
|
|
|
488
506
|
const projects = Array.isArray(body?.projects) ? body.projects : [];
|
|
489
507
|
if (projects.length === 0) {
|
|
508
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
509
|
+
console.error(`[beamo-node] No projects found, using realm PID: ${pid}`);
|
|
510
|
+
}
|
|
490
511
|
return pid;
|
|
491
512
|
}
|
|
492
513
|
|
|
@@ -498,7 +519,10 @@ async function resolveGamePid(apiHost, token, cid, pid, explicitGamePid) {
|
|
|
498
519
|
current = byPid.get(current.parent);
|
|
499
520
|
}
|
|
500
521
|
const resolved = current?.pid ?? pid;
|
|
501
|
-
|
|
522
|
+
|
|
523
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
524
|
+
console.error(`[beamo-node] Resolved Game PID: ${resolved}`);
|
|
525
|
+
}
|
|
502
526
|
return resolved;
|
|
503
527
|
} catch (error) {
|
|
504
528
|
// Debug logging only
|
|
@@ -1224,6 +1248,13 @@ async function main() {
|
|
|
1224
1248
|
const inspect = await runCommand('docker', ['image', 'inspect', '--format', '{{.Id}}', dockerTag], { capture: true });
|
|
1225
1249
|
const fullImageId = inspect.stdout.trim();
|
|
1226
1250
|
const imageTarPath = path.join(tempRoot, `${serviceId.replace(/[^a-z0-9-_]/gi, '_')}.tar`);
|
|
1251
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1252
|
+
console.error(`[beamo-node] [STEP: Extract Image ID]`);
|
|
1253
|
+
console.error(`[beamo-node] Docker Tag: ${dockerTag}`);
|
|
1254
|
+
console.error(`[beamo-node] Full Image ID: ${fullImageId}`);
|
|
1255
|
+
console.error(`[beamo-node] Short Image ID: ${shortDigest(fullImageId)}`);
|
|
1256
|
+
console.error(`[beamo-node] Image Tar Path: ${imageTarPath}`);
|
|
1257
|
+
}
|
|
1227
1258
|
await runCommand('docker', ['image', 'save', dockerTag, '-o', imageTarPath], { silent: true });
|
|
1228
1259
|
progress.complete('Image prepared');
|
|
1229
1260
|
|
|
@@ -1296,11 +1327,18 @@ async function main() {
|
|
|
1296
1327
|
};
|
|
1297
1328
|
|
|
1298
1329
|
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1299
|
-
console.error(`[beamo-node]
|
|
1300
|
-
console.error(`[beamo-node]
|
|
1330
|
+
console.error(`[beamo-node] [STEP: Post-Upload Verification]`);
|
|
1331
|
+
console.error(`[beamo-node] Full Image ID: ${fullImageId}`);
|
|
1332
|
+
console.error(`[beamo-node] Short Image ID: ${shortImageId}`);
|
|
1333
|
+
console.error(`[beamo-node] Base URL: ${baseUrl}`);
|
|
1334
|
+
console.error(`[beamo-node] Verification URL: ${baseUrl}manifests/${shortImageId}`);
|
|
1335
|
+
console.error(`[beamo-node] Verify Headers:`, JSON.stringify(verifyHeaders, null, 2));
|
|
1301
1336
|
}
|
|
1302
1337
|
|
|
1303
1338
|
// Wait a moment for registry to propagate
|
|
1339
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1340
|
+
console.error(`[beamo-node] Waiting 3 seconds for registry propagation...`);
|
|
1341
|
+
}
|
|
1304
1342
|
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
1305
1343
|
|
|
1306
1344
|
const imageExists = await verifyManifestExists(baseUrl, shortImageId, verifyHeaders);
|
|
@@ -1309,7 +1347,7 @@ async function main() {
|
|
|
1309
1347
|
}
|
|
1310
1348
|
|
|
1311
1349
|
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1312
|
-
console.error(`[beamo-node]
|
|
1350
|
+
console.error(`[beamo-node] ✓ Image verification passed`);
|
|
1313
1351
|
}
|
|
1314
1352
|
|
|
1315
1353
|
// Step 7: Discover storage, components, and dependencies
|