@omen.foundation/node-microservice-runtime 0.1.84 → 0.1.86
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 +31 -5
package/package.json
CHANGED
|
@@ -509,16 +509,16 @@ async function uploadDockerImage({
|
|
|
509
509
|
progress,
|
|
510
510
|
}) {
|
|
511
511
|
const baseUrl = `${registryUrl}${uniqueName}/`;
|
|
512
|
-
//
|
|
513
|
-
//
|
|
512
|
+
// Try using gamePid in headers - backend checks registry using game PID scope
|
|
513
|
+
// The uniqueName is calculated with gamePid, so headers should match
|
|
514
514
|
const headers = {
|
|
515
515
|
'x-ks-clientid': cid,
|
|
516
|
-
'x-ks-projectid': pid, // Use
|
|
516
|
+
'x-ks-projectid': gamePid || pid, // Use gamePid if available, fallback to realm PID
|
|
517
517
|
'x-ks-token': token, // Access token from login
|
|
518
518
|
};
|
|
519
519
|
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
520
520
|
console.error(`[beamo-node] Uploading to: ${baseUrl}`);
|
|
521
|
-
console.error(`[beamo-node] Upload headers PID: ${pid} (
|
|
521
|
+
console.error(`[beamo-node] Upload headers PID: ${gamePid || pid} (gamePid: ${gamePid}, realm: ${pid})`);
|
|
522
522
|
}
|
|
523
523
|
|
|
524
524
|
const { manifestEntry, configBuffer, layers } = await readDockerImageTar(imageTarPath);
|
|
@@ -1134,9 +1134,35 @@ async function main() {
|
|
|
1134
1134
|
});
|
|
1135
1135
|
progress.complete('Image uploaded');
|
|
1136
1136
|
|
|
1137
|
+
// Verify image exists in registry before proceeding
|
|
1138
|
+
const shortImageId = shortDigest(fullImageId);
|
|
1139
|
+
const baseUrl = `${registryUrl}${uniqueName}/`;
|
|
1140
|
+
const verifyHeaders = {
|
|
1141
|
+
'x-ks-clientid': cid,
|
|
1142
|
+
'x-ks-projectid': resolvedGamePid || pid, // Use gamePid to match registry scope
|
|
1143
|
+
'x-ks-token': token,
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1147
|
+
console.error(`[beamo-node] Verifying image exists: ${baseUrl}manifests/${shortImageId}`);
|
|
1148
|
+
console.error(`[beamo-node] Verify headers:`, verifyHeaders);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// Wait a moment for registry to propagate
|
|
1152
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
|
1153
|
+
|
|
1154
|
+
const imageExists = await verifyManifestExists(baseUrl, shortImageId, verifyHeaders);
|
|
1155
|
+
if (!imageExists) {
|
|
1156
|
+
throw new Error(`Image verification failed: manifest with tag ${shortImageId} not found in registry at ${baseUrl}manifests/${shortImageId}. The image may not have uploaded successfully.`);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1160
|
+
console.error(`[beamo-node] ✓ Image verification passed: ${baseUrl}manifests/${shortImageId}`);
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1137
1163
|
// Step 7: Discover storage, components, and dependencies
|
|
1138
1164
|
progress.start('Discovering storage objects and components');
|
|
1139
|
-
|
|
1165
|
+
// shortImageId already defined above from verification step
|
|
1140
1166
|
const existingManifest = await fetchCurrentManifest(apiHost, token, cid, pid);
|
|
1141
1167
|
const discoveredStorage = await discoverStorageObjects('src');
|
|
1142
1168
|
const discoveredComponents = await discoverFederationComponents('src');
|