hammerkit 2.1.0-next.12 → 2.1.0-next.14
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/dist/harness/connect.js +10 -7
- package/dist/harness/reconnect.js +137 -0
- package/dist/harness/sandbox-client.js +110 -25
- package/dist/remote/remote-work-commands.js +19 -8
- package/dist/server/executor.js +22 -5
- package/dist/server/http.js +4 -1
- package/dist/server/kubernetes-backend.js +155 -52
- package/dist/server/run-logs.js +25 -1
- package/dist/server/runs.js +339 -96
- package/dist/server/server.js +9 -4
- package/package.json +1 -1
package/dist/server/server.js
CHANGED
|
@@ -245,7 +245,10 @@ async function handleRuns(config, registry, definitions, sources, sandboxes, pla
|
|
|
245
245
|
const logs = (0, run_access_1.findReadableRun)(config, registry, principal, id) ? registry.logsOf(id) : undefined;
|
|
246
246
|
// with the tasks, services and the server's own lines (`hammerkit`) the log has
|
|
247
247
|
logs
|
|
248
|
-
? (0, http_2.send)(res, 200, {
|
|
248
|
+
? (0, http_2.send)(res, 200, {
|
|
249
|
+
...(0, run_logs_1.readLogs)(logs.events, logs.index, query, logs.truncated, logs.lostAfter),
|
|
250
|
+
names: logs.index.names(),
|
|
251
|
+
})
|
|
249
252
|
: (0, http_2.send)(res, 404, { error: 'not found' });
|
|
250
253
|
}
|
|
251
254
|
else {
|
|
@@ -722,7 +725,8 @@ async function startRun(config, registry, definitions, sources, sandboxes, plann
|
|
|
722
725
|
}
|
|
723
726
|
catch (e) {
|
|
724
727
|
if (e instanceof runs_1.RunError) {
|
|
725
|
-
|
|
728
|
+
// a proxy answers 503 too, also after the server took the request: this one is safe to send again
|
|
729
|
+
(0, http_2.send)(res, e.status, { error: e.message }, e instanceof runs_1.ShuttingDownError ? { [http_2.RETRY_HEADER]: 'safe' } : {});
|
|
726
730
|
return;
|
|
727
731
|
}
|
|
728
732
|
if (e instanceof sandboxes_1.SandboxError) {
|
|
@@ -1078,8 +1082,9 @@ async function startServer(config, environment, options = {}) {
|
|
|
1078
1082
|
.catch((e) => log(`the outputs of old runs could not be removed: ${e instanceof Error ? e.message : e}`));
|
|
1079
1083
|
const sweepingArtifacts = setInterval(sweepArtifacts, ARTIFACT_SWEEP_MS);
|
|
1080
1084
|
sweepingArtifacts.unref();
|
|
1081
|
-
// the
|
|
1082
|
-
// kept for any other
|
|
1085
|
+
// the runs the server before stopped resume, and the executor hears which service runs sleep
|
|
1086
|
+
// with their volumes kept and which runs resume, and removes what it kept for any other
|
|
1087
|
+
// (RunExecutor.restored)
|
|
1083
1088
|
await registry.restore();
|
|
1084
1089
|
void sweepArtifacts();
|
|
1085
1090
|
const proposals = new proposals_1.ProposalRegistry({
|
package/package.json
CHANGED