@omen.foundation/node-microservice-runtime 0.1.80 → 0.1.81
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 +32 -3
package/package.json
CHANGED
|
@@ -510,11 +510,16 @@ async function uploadDockerImage({
|
|
|
510
510
|
}) {
|
|
511
511
|
const baseUrl = `${registryUrl}${uniqueName}/`;
|
|
512
512
|
// Match C# CLI exactly: use x-ks-* headers (all lowercase) with CID, PID (realm PID), and access token
|
|
513
|
+
// Note: Backend might check using gamePid, but C# CLI uses realm PID for upload headers
|
|
513
514
|
const headers = {
|
|
514
515
|
'x-ks-clientid': cid,
|
|
515
516
|
'x-ks-projectid': pid, // Use realm PID (not gamePid) - matches ctx.Pid in C# CLI
|
|
516
517
|
'x-ks-token': token, // Access token from login
|
|
517
518
|
};
|
|
519
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
520
|
+
console.error(`[beamo-node] Uploading to: ${baseUrl}`);
|
|
521
|
+
console.error(`[beamo-node] Upload headers PID: ${pid} (realm), gamePid: ${gamePid}`);
|
|
522
|
+
}
|
|
518
523
|
|
|
519
524
|
const { manifestEntry, configBuffer, layers } = await readDockerImageTar(imageTarPath);
|
|
520
525
|
|
|
@@ -847,6 +852,12 @@ async function updateManifest({
|
|
|
847
852
|
storageReferences,
|
|
848
853
|
};
|
|
849
854
|
|
|
855
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
856
|
+
console.error(`[beamo-node] Publishing manifest with imageId: ${shortImageId}`);
|
|
857
|
+
console.error(`[beamo-node] Service: ${serviceId}, CID: ${cid}, PID: ${pid}`);
|
|
858
|
+
console.error(`[beamo-node] Manifest service entry:`, JSON.stringify(mappedServices.find(s => s.serviceName === serviceId), null, 2));
|
|
859
|
+
}
|
|
860
|
+
|
|
850
861
|
const response = await fetch(new URL('/api/beamo/manifests', apiHost), {
|
|
851
862
|
method: 'POST',
|
|
852
863
|
headers: {
|
|
@@ -860,6 +871,11 @@ async function updateManifest({
|
|
|
860
871
|
|
|
861
872
|
if (!response.ok) {
|
|
862
873
|
const text = await response.text();
|
|
874
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
875
|
+
console.error(`[beamo-node] Manifest publish failed: ${response.status}`);
|
|
876
|
+
console.error(`[beamo-node] Response: ${text}`);
|
|
877
|
+
console.error(`[beamo-node] Request body:`, JSON.stringify(requestBody, null, 2));
|
|
878
|
+
}
|
|
863
879
|
throw new Error(`Failed to publish manifest: ${response.status} ${text}`);
|
|
864
880
|
}
|
|
865
881
|
}
|
|
@@ -1077,6 +1093,11 @@ async function main() {
|
|
|
1077
1093
|
|
|
1078
1094
|
const registryUrl = await getRegistryUrl(apiHost, token, cid, resolvedGamePid);
|
|
1079
1095
|
const uniqueName = md5Hex(`${cid}_${resolvedGamePid}_${serviceId}`).substring(0, 30);
|
|
1096
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1097
|
+
console.error(`[beamo-node] Registry URL: ${registryUrl}`);
|
|
1098
|
+
console.error(`[beamo-node] Unique name: ${uniqueName}`);
|
|
1099
|
+
console.error(`[beamo-node] CID: ${cid}, PID: ${pid}, Game PID: ${resolvedGamePid}`);
|
|
1100
|
+
}
|
|
1080
1101
|
progress.complete('Authenticated');
|
|
1081
1102
|
|
|
1082
1103
|
// Step 6: Upload Docker image
|
|
@@ -1097,19 +1118,27 @@ async function main() {
|
|
|
1097
1118
|
progress.complete('Image uploaded');
|
|
1098
1119
|
|
|
1099
1120
|
// Verify image exists in registry before proceeding
|
|
1121
|
+
// Note: Backend might check using gamePid, so we verify using the same PID used for upload
|
|
1100
1122
|
const shortImageIdForVerify = shortDigest(fullImageId);
|
|
1101
1123
|
const baseUrl = `${registryUrl}${uniqueName}/`;
|
|
1102
1124
|
const verifyHeaders = {
|
|
1103
1125
|
'x-ks-clientid': cid,
|
|
1104
|
-
'x-ks-projectid': pid,
|
|
1126
|
+
'x-ks-projectid': pid, // Use realm PID (matches upload headers)
|
|
1105
1127
|
'x-ks-token': token,
|
|
1106
1128
|
};
|
|
1107
1129
|
|
|
1108
1130
|
// Wait a moment for registry to propagate, then verify
|
|
1109
|
-
|
|
1131
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1132
|
+
console.error(`[beamo-node] Verifying image exists: ${baseUrl}manifests/${shortImageIdForVerify}`);
|
|
1133
|
+
console.error(`[beamo-node] Using headers:`, { cid, pid, gamePid: resolvedGamePid });
|
|
1134
|
+
}
|
|
1135
|
+
await new Promise(resolve => setTimeout(resolve, 2000)); // Increased delay
|
|
1110
1136
|
const imageExists = await verifyManifestExists(baseUrl, shortImageIdForVerify, verifyHeaders);
|
|
1111
1137
|
if (!imageExists) {
|
|
1112
|
-
throw new Error(`Image verification failed: manifest with tag ${shortImageIdForVerify} not found in registry at ${baseUrl}. The image may not have uploaded successfully.`);
|
|
1138
|
+
throw new Error(`Image verification failed: manifest with tag ${shortImageIdForVerify} not found in registry at ${baseUrl}manifests/${shortImageIdForVerify}. The image may not have uploaded successfully. Check that the registry path and tag match what the backend expects.`);
|
|
1139
|
+
}
|
|
1140
|
+
if (process.env.BEAMO_DEBUG === '1' || process.env.BEAMO_NODE_DEBUG === '1') {
|
|
1141
|
+
console.error(`[beamo-node] Image verification passed: ${baseUrl}manifests/${shortImageIdForVerify}`);
|
|
1113
1142
|
}
|
|
1114
1143
|
|
|
1115
1144
|
// Step 7: Discover storage, components, and dependencies
|