Skip to content

Commit 0d29cef

Browse files
authored
Merge branch 'main' into nicer-app-emails
2 parents 6677844 + d10281e commit 0d29cef

File tree

181 files changed

+8971
-2417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+8971
-2417
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Stop failing attempt spans when a run is cancelled

.changeset/kind-kids-teach.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Added INSTALLING status to the deployment status enum.

CHANGESETS.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ Please follow the best-practice of adding changesets in the same commit as the c
3030

3131
## Snapshot instructions
3232

33-
1. Delete the `.changeset/pre.json` file (if it exists)
33+
1. Update the `.changeset/config.json` file to set the `"changelog"` field to this:
3434

35-
2. Do a temporary commit (do NOT push this, you should undo it after)
35+
```json
36+
"changelog": "@changesets/cli/changelog",
37+
```
3638

37-
3. Copy the `GITHUB_TOKEN` line from the .env file
39+
2. Do a temporary commit (do NOT push this, you should undo it after)
3840

39-
4. Run `GITHUB_TOKEN=github_pat_12345 ./scripts/publish-prerelease.sh re2`
41+
3. Run `./scripts/publish-prerelease.sh prerelease`
4042

41-
Make sure to replace the token with yours. `re2` is the tag that will be used for the pre-release.
43+
You can choose a different tag if you want, but usually `prerelease` is fine.
4244

43-
5. Undo the commit where you deleted the pre.json file.
45+
5. Undo the commit where you updated the config.json file.

apps/supervisor/src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const Env = z.object({
8989
KUBERNETES_CPU_REQUEST_RATIO: z.coerce.number().min(0).max(1).default(0.75), // Ratio of CPU limit, so 0.75 = 75% of CPU limit
9090
KUBERNETES_MEMORY_REQUEST_MIN_GB: z.coerce.number().min(0).default(0),
9191
KUBERNETES_MEMORY_REQUEST_RATIO: z.coerce.number().min(0).max(1).default(1), // Ratio of memory limit, so 1 = 100% of memory limit
92+
KUBERNETES_MEMORY_OVERHEAD_GB: z.coerce.number().min(0).optional(), // Optional memory overhead to add to the limit in GB
9293

9394
// Placement tags settings
9495
PLACEMENT_TAGS_ENABLED: BoolEnv.default(false),

apps/supervisor/src/workloadManager/kubernetes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export class KubernetesWorkloadManager implements WorkloadManager {
2525
private readonly cpuRequestRatio = env.KUBERNETES_CPU_REQUEST_RATIO;
2626
private readonly memoryRequestMinGb = env.KUBERNETES_MEMORY_REQUEST_MIN_GB;
2727
private readonly memoryRequestRatio = env.KUBERNETES_MEMORY_REQUEST_RATIO;
28+
private readonly memoryOverheadGb = env.KUBERNETES_MEMORY_OVERHEAD_GB;
2829

2930
constructor(private opts: WorkloadManagerOptions) {
3031
this.k8s = createK8sApi();
@@ -319,9 +320,13 @@ export class KubernetesWorkloadManager implements WorkloadManager {
319320
}
320321

321322
#getResourceLimitsForMachine(preset: MachinePreset): ResourceQuantities {
323+
const memoryLimit = this.memoryOverheadGb
324+
? preset.memory + this.memoryOverheadGb
325+
: preset.memory;
326+
322327
return {
323328
cpu: `${preset.cpu}`,
324-
memory: `${preset.memory}G`,
329+
memory: `${memoryLimit}G`,
325330
};
326331
}
327332

apps/supervisor/src/workloadServer/index.ts

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
type WorkloadRunAttemptCompleteResponseBody,
1717
WorkloadRunAttemptStartRequestBody,
1818
type WorkloadRunAttemptStartResponseBody,
19-
type WorkloadRunLatestSnapshotResponseBody,
2019
WorkloadRunSnapshotsSinceResponseBody,
2120
type WorkloadServerToClientEvents,
2221
type WorkloadSuspendRunResponseBody,
@@ -126,7 +125,7 @@ export class WorkloadServer extends EventEmitter<WorkloadServerEvents> {
126125
}
127126

128127
private createHttpServer({ host, port }: { host: string; port: number }) {
129-
return new HttpServer({
128+
const httpServer = new HttpServer({
130129
port,
131130
host,
132131
metrics: {
@@ -322,28 +321,6 @@ export class WorkloadServer extends EventEmitter<WorkloadServerEvents> {
322321
},
323322
}
324323
)
325-
.route("/api/v1/workload-actions/runs/:runFriendlyId/snapshots/latest", "GET", {
326-
paramsSchema: WorkloadActionParams.pick({ runFriendlyId: true }),
327-
handler: async ({ req, reply, params }) => {
328-
const latestSnapshotResponse = await this.workerClient.getLatestSnapshot(
329-
params.runFriendlyId,
330-
this.runnerIdFromRequest(req)
331-
);
332-
333-
if (!latestSnapshotResponse.success) {
334-
this.logger.error("Failed to get latest snapshot", {
335-
runId: params.runFriendlyId,
336-
error: latestSnapshotResponse.error,
337-
});
338-
reply.empty(500);
339-
return;
340-
}
341-
342-
reply.json({
343-
execution: latestSnapshotResponse.data.execution,
344-
} satisfies WorkloadRunLatestSnapshotResponseBody);
345-
},
346-
})
347324
.route(
348325
"/api/v1/workload-actions/runs/:runFriendlyId/snapshots/since/:snapshotFriendlyId",
349326
"GET",
@@ -369,23 +346,6 @@ export class WorkloadServer extends EventEmitter<WorkloadServerEvents> {
369346
},
370347
}
371348
)
372-
.route("/api/v1/workload-actions/runs/:runFriendlyId/logs/debug", "POST", {
373-
paramsSchema: WorkloadActionParams.pick({ runFriendlyId: true }),
374-
bodySchema: WorkloadDebugLogRequestBody,
375-
handler: async ({ req, reply, params, body }) => {
376-
reply.empty(204);
377-
378-
if (!env.SEND_RUN_DEBUG_LOGS) {
379-
return;
380-
}
381-
382-
await this.workerClient.sendDebugLog(
383-
params.runFriendlyId,
384-
body,
385-
this.runnerIdFromRequest(req)
386-
);
387-
},
388-
})
389349
.route("/api/v1/workload-actions/deployments/:deploymentId/dequeue", "GET", {
390350
paramsSchema: z.object({
391351
deploymentId: z.string(),
@@ -410,6 +370,31 @@ export class WorkloadServer extends EventEmitter<WorkloadServerEvents> {
410370
reply.json(dequeueResponse.data satisfies WorkloadDequeueFromVersionResponseBody);
411371
},
412372
});
373+
374+
if (env.SEND_RUN_DEBUG_LOGS) {
375+
httpServer.route("/api/v1/workload-actions/runs/:runFriendlyId/logs/debug", "POST", {
376+
paramsSchema: WorkloadActionParams.pick({ runFriendlyId: true }),
377+
bodySchema: WorkloadDebugLogRequestBody,
378+
handler: async ({ req, reply, params, body }) => {
379+
reply.empty(204);
380+
381+
await this.workerClient.sendDebugLog(
382+
params.runFriendlyId,
383+
body,
384+
this.runnerIdFromRequest(req)
385+
);
386+
},
387+
});
388+
} else {
389+
// Lightweight mock route without schemas
390+
httpServer.route("/api/v1/workload-actions/runs/:runFriendlyId/logs/debug", "POST", {
391+
handler: async ({ reply }) => {
392+
reply.empty(204);
393+
},
394+
});
395+
}
396+
397+
return httpServer;
413398
}
414399

415400
private createWebsocketServer() {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export function MoveToTopIcon({ className }: { className?: string }) {
2+
return (
3+
<svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4+
<g clipPath="url(#clip0_17186_103975)">
5+
<path
6+
d="M12 21L12 9"
7+
stroke="currentColor"
8+
strokeWidth="2"
9+
strokeLinecap="round"
10+
strokeLinejoin="round"
11+
/>
12+
<path
13+
d="M3 3L21 3"
14+
stroke="currentColor"
15+
strokeWidth="2"
16+
strokeLinecap="round"
17+
strokeLinejoin="round"
18+
/>
19+
<path
20+
d="M16.5 11.5L12 7L7.5 11.5"
21+
stroke="currentColor"
22+
strokeWidth="2"
23+
strokeLinecap="round"
24+
strokeLinejoin="round"
25+
/>
26+
</g>
27+
<defs>
28+
<clipPath id="clip0_17186_103975">
29+
<rect width="24" height="24" fill="currentColor" />
30+
</clipPath>
31+
</defs>
32+
</svg>
33+
);
34+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
export function MoveUpIcon({ className }: { className?: string }) {
2+
return (
3+
<svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4+
<g clipPath="url(#clip0_17177_110851)">
5+
<path
6+
d="M12 21L12 13"
7+
stroke="currentColor"
8+
strokeWidth="2"
9+
strokeLinecap="round"
10+
strokeLinejoin="round"
11+
/>
12+
<path
13+
d="M3 3L21 3"
14+
stroke="currentColor"
15+
strokeWidth="2"
16+
strokeLinecap="round"
17+
strokeLinejoin="round"
18+
/>
19+
<path
20+
d="M3 7L21 7"
21+
stroke="currentColor"
22+
strokeWidth="2"
23+
strokeLinecap="round"
24+
strokeLinejoin="round"
25+
/>
26+
<path
27+
d="M16.5 15.5L12 11L7.5 15.5"
28+
stroke="currentColor"
29+
strokeWidth="2"
30+
strokeLinecap="round"
31+
strokeLinejoin="round"
32+
/>
33+
</g>
34+
<defs>
35+
<clipPath id="clip0_17177_110851">
36+
<rect width="24" height="24" fill="currentColor" />
37+
</clipPath>
38+
</defs>
39+
</svg>
40+
);
41+
}

apps/webapp/app/components/DefinitionTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function DefinitionTip({
1414
return (
1515
<TooltipProvider>
1616
<Tooltip disableHoverableContent>
17-
<TooltipTrigger>
17+
<TooltipTrigger className="text-left">
1818
<span className="cursor-default underline decoration-charcoal-500 decoration-dashed underline-offset-4 transition hover:decoration-charcoal-400">
1919
{children}
2020
</span>

apps/webapp/app/components/Shortcuts.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ function ShortcutContent() {
147147
</Paragraph>
148148
<ShortcutKey shortcut={{ key: "9" }} variant="medium/bright" />
149149
</Shortcut>
150+
<Shortcut name="Jump to root run">
151+
<ShortcutKey shortcut={{ key: "t" }} variant="medium/bright" />
152+
</Shortcut>
153+
<Shortcut name="Jump to parent run">
154+
<ShortcutKey shortcut={{ key: "p" }} variant="medium/bright" />
155+
</Shortcut>
150156
</div>
151157
<div className="space-y-3">
152158
<Header3>Schedules page</Header3>

0 commit comments

Comments
 (0)