Skip to content

Commit f9a3da4

Browse files
authored
Merge branch 'main' into prevent-tooltip-from-opening-on-reload
2 parents d37dfff + b171fde commit f9a3da4

File tree

238 files changed

+225350
-1400
lines changed

Some content is hidden

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

238 files changed

+225350
-1400
lines changed

.changeset/fast-colts-relax.md

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+
Increase dev worker timeout

.changeset/friendly-walls-repair.md

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+
Add sox and audiowaveform binaries to worker images

.changeset/nervous-planets-sparkle.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
- Improve non-zero exit code error messages
7+
- Detect OOM conditions within worker child processes
8+
- Internal errors can have optional stack traces
9+
- Docker provider can be set to enforce machine presets

.changeset/polite-pots-walk.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Add e2e fixtures corresponding to past issues
6+
Implement e2e suite parallelism
7+
Enhance log level for specific e2e suite messages

.changeset/pre.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"silly-suits-switch",
121121
"silver-doors-juggle",
122122
"six-ligers-exist",
123+
"six-rats-hunt",
123124
"sixty-insects-watch",
124125
"slow-buses-own",
125126
"slow-kiwis-hide",
@@ -144,6 +145,7 @@
144145
"tender-moose-tell",
145146
"tender-oranges-rhyme",
146147
"tender-turkeys-compete",
148+
"thick-carrots-sneeze",
147149
"thin-parents-heal",
148150
"thirty-islands-kiss",
149151
"tidy-balloons-suffer",
@@ -154,6 +156,7 @@
154156
"tricky-bulldogs-heal",
155157
"tricky-keys-attack",
156158
"tricky-ladybugs-unite",
159+
"twelve-knives-notice",
157160
"two-pumas-wait",
158161
"violet-clocks-notice",
159162
"warm-olives-provide",

.changeset/purple-spiders-care.md

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+
Await file watcher cleanup in dev

.changeset/silly-forks-kiss.md

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+
v3: Copy over more of the project's package.json keys into the deployed package.json (support for custom config like zenstack)

.changeset/spicy-frogs-remain.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
- Prevent downgrades during update check and advise to upgrade CLI
6+
- Detect bun and use npm instead
7+
- During init, fail early and advise if not a TypeScript project
8+
- During init, allow specifying custom package manager args
9+
- Add links to dev worker started message
10+
- Fix links in unsupported terminals

.changeset/tall-masks-repeat.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@trigger.dev/core-apps": patch
3+
"trigger.dev": patch
4+
"@trigger.dev/core": patch
5+
---
6+
7+
- Fix artifact detection logs
8+
- Fix OOM detection and error messages
9+
- Add test link to cli deployment completion

.changeset/tame-apricots-clap.md

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+
v3: postInstall config option now replaces the postinstall script found in package.json

.changeset/thick-carrots-sneeze.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@trigger.dev/core": patch
3+
"@trigger.dev/sdk": patch
4+
---
5+
6+
v3: Include presigned urls for downloading large payloads and outputs when using runs.retrieve

.changeset/twelve-knives-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
v3: fix missing init output in task run function when no middleware is defined

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ jobs:
4949
uses: ./.github/workflows/unit-tests.yml
5050
secrets: inherit
5151

52-
e2e:
53-
uses: ./.github/workflows/e2e.yml
54-
with:
55-
package: cli-v3
56-
secrets: inherit
52+
# e2e:
53+
# uses: ./.github/workflows/e2e.yml
54+
# with:
55+
# package: cli-v3
56+
# secrets: inherit
5757

5858
publish:
5959
needs: [typecheck, units]

apps/docker-provider/src/index.ts

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,27 @@ class DockerTaskOperations implements TaskOperations {
109109

110110
const containerName = this.#getRunContainerName(opts.runId);
111111

112+
const runArgs = [
113+
"run",
114+
"--network=host",
115+
"--detach",
116+
`--env=TRIGGER_ENV_ID=${opts.envId}`,
117+
`--env=TRIGGER_RUN_ID=${opts.runId}`,
118+
`--env=OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}`,
119+
`--env=POD_NAME=${containerName}`,
120+
`--env=COORDINATOR_HOST=${COORDINATOR_HOST}`,
121+
`--env=COORDINATOR_PORT=${COORDINATOR_PORT}`,
122+
`--name=${containerName}`,
123+
];
124+
125+
if (process.env.ENFORCE_MACHINE_PRESETS) {
126+
runArgs.push(`--cpus=${opts.machine.cpu}`, `--memory=${opts.machine.memory}G`);
127+
}
128+
129+
runArgs.push(`${opts.image}`);
130+
112131
try {
113-
logger.debug(
114-
await execa("docker", [
115-
"run",
116-
"--network=host",
117-
"--detach",
118-
`--env=TRIGGER_ENV_ID=${opts.envId}`,
119-
`--env=TRIGGER_RUN_ID=${opts.runId}`,
120-
`--env=OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}`,
121-
`--env=POD_NAME=${containerName}`,
122-
`--env=COORDINATOR_HOST=${COORDINATOR_HOST}`,
123-
`--env=COORDINATOR_PORT=${COORDINATOR_PORT}`,
124-
`--name=${containerName}`,
125-
`${opts.image}`,
126-
])
127-
);
132+
logger.debug(await execa("docker", runArgs));
128133
} catch (error) {
129134
if (!isExecaChildProcess(error)) {
130135
throw error;

apps/kubernetes-provider/src/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -529,27 +529,28 @@ provider.listen();
529529

530530
const taskMonitor = new TaskMonitor({
531531
runtimeEnv: RUNTIME_ENV,
532-
onIndexFailure: async (deploymentId, failureInfo) => {
533-
logger.log("Indexing failed", { deploymentId, failureInfo });
532+
onIndexFailure: async (deploymentId, details) => {
533+
logger.log("Indexing failed", { deploymentId, details });
534534

535535
try {
536536
provider.platformSocket.send("INDEXING_FAILED", {
537537
deploymentId,
538538
error: {
539-
name: `Crashed with exit code ${failureInfo.exitCode}`,
540-
message: failureInfo.reason,
541-
stack: failureInfo.logs,
539+
name: `Crashed with exit code ${details.exitCode}`,
540+
message: details.reason,
541+
stack: details.logs,
542542
},
543+
overrideCompletion: details.overrideCompletion,
543544
});
544545
} catch (error) {
545546
logger.error(error);
546547
}
547548
},
548-
onRunFailure: async (runId, failureInfo) => {
549-
logger.log("Run failed:", { runId, failureInfo });
549+
onRunFailure: async (runId, details) => {
550+
logger.log("Run failed:", { runId, details });
550551

551552
try {
552-
provider.platformSocket.send("WORKER_CRASHED", { runId, ...failureInfo });
553+
provider.platformSocket.send("WORKER_CRASHED", { runId, ...details });
553554
} catch (error) {
554555
logger.error(error);
555556
}

apps/kubernetes-provider/src/taskMonitor.ts

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
import * as k8s from "@kubernetes/client-node";
22
import { SimpleLogger } from "@trigger.dev/core-apps";
3+
import { EXIT_CODE_ALREADY_HANDLED, EXIT_CODE_CHILD_NONZERO } from "@trigger.dev/core-apps/process";
34
import { setTimeout } from "timers/promises";
45
import PQueue from "p-queue";
6+
import type { Prettify } from "@trigger.dev/core/v3";
57

6-
type IndexFailureHandler = (
7-
deploymentId: string,
8-
failureInfo: {
9-
exitCode: number;
10-
reason: string;
11-
logs: string;
12-
}
13-
) => Promise<any>;
14-
15-
type RunFailureHandler = (
16-
runId: string,
17-
failureInfo: {
18-
exitCode: number;
19-
reason: string;
20-
logs: string;
21-
}
22-
) => Promise<any>;
8+
type FailureDetails = Prettify<{
9+
exitCode: number;
10+
reason: string;
11+
logs: string;
12+
overrideCompletion: boolean;
13+
}>;
14+
15+
type IndexFailureHandler = (deploymentId: string, details: FailureDetails) => Promise<any>;
16+
17+
type RunFailureHandler = (runId: string, details: FailureDetails) => Promise<any>;
2318

2419
type TaskMonitorOptions = {
2520
runtimeEnv: "local" | "kubernetes";
@@ -144,8 +139,7 @@ export class TaskMonitor {
144139
const containerState = this.#getContainerStateSummary(containerStatus.state);
145140
const exitCode = containerState.exitCode ?? -1;
146141

147-
// We use this special exit code to signal any errors were already handled elsewhere
148-
if (exitCode === 111) {
142+
if (exitCode === EXIT_CODE_ALREADY_HANDLED) {
149143
return;
150144
}
151145

@@ -162,6 +156,7 @@ export class TaskMonitor {
162156

163157
let reason = rawReason || "Unknown error";
164158
let logs = rawLogs || "";
159+
let overrideCompletion = false;
165160

166161
switch (rawReason) {
167162
case "Error":
@@ -181,7 +176,10 @@ export class TaskMonitor {
181176
}
182177
break;
183178
case "OOMKilled":
184-
reason = "Out of memory! Try increasing the memory on this task.";
179+
overrideCompletion = true;
180+
reason = `${
181+
exitCode === EXIT_CODE_CHILD_NONZERO ? "Child process" : "Parent process"
182+
} ran out of memory! Try choosing a machine preset with more memory for this task.`;
185183
break;
186184
default:
187185
break;
@@ -191,7 +189,8 @@ export class TaskMonitor {
191189
exitCode,
192190
reason,
193191
logs,
194-
};
192+
overrideCompletion,
193+
} satisfies FailureDetails;
195194

196195
const app = pod.metadata?.labels?.app;
197196

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function TaskRunsTable({
125125
</TableHeader>
126126
<TableBody>
127127
{total === 0 && !hasFilters ? (
128-
<TableBlankRow colSpan={9}>
128+
<TableBlankRow colSpan={10}>
129129
{!isLoading && <NoRuns title="No runs found" />}
130130
</TableBlankRow>
131131
) : runs.length === 0 ? (

apps/webapp/app/env.server.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ const EnvironmentSchema = z.object({
206206
USAGE_OPEN_METER_BASE_URL: z.string().optional(),
207207
EVENT_LOOP_MONITOR_ENABLED: z.string().default("1"),
208208
MAXIMUM_LIVE_RELOADING_EVENTS: z.coerce.number().int().default(1000),
209+
MAXIMUM_TRACE_SUMMARY_VIEW_COUNT: z.coerce.number().int().default(25_000),
210+
TASK_PAYLOAD_OFFLOAD_THRESHOLD: z.coerce.number().int().default(524_288), // 512KB
211+
TASK_PAYLOAD_MAXIMUM_SIZE: z.coerce.number().int().default(3_145_728), // 3MB
209212
});
210213

211214
export type Environment = z.infer<typeof EnvironmentSchema>;

apps/webapp/app/models/api-key.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export function createPkApiKeyForEnv(envType: RuntimeEnvironment["type"]) {
8484
return `pk_${envSlug(envType)}_${apiKeyId(20)}`;
8585
}
8686

87-
export function envSlug(environmentType: RuntimeEnvironment["type"]) {
87+
export type EnvSlug = "dev" | "stg" | "prod" | "prev";
88+
89+
export function envSlug(environmentType: RuntimeEnvironment["type"]): EnvSlug {
8890
switch (environmentType) {
8991
case "DEVELOPMENT": {
9092
return "dev";
@@ -100,3 +102,7 @@ export function envSlug(environmentType: RuntimeEnvironment["type"]) {
100102
}
101103
}
102104
}
105+
106+
export function isEnvSlug(maybeSlug: string): maybeSlug is EnvSlug {
107+
return ["dev", "stg", "prod", "prev"].includes(maybeSlug);
108+
}

apps/webapp/app/presenters/RunListPresenter.server.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { z } from "zod";
21
import {
32
Direction,
43
FilterableEnvironment,
54
FilterableStatus,
65
filterableStatuses,
76
} from "~/components/runs/RunStatuses";
8-
import { PrismaClient, prisma } from "~/db.server";
97
import { getUsername } from "~/utils/username";
108
import { BasePresenter } from "./v3/basePresenter.server";
119

@@ -29,8 +27,6 @@ const DEFAULT_PAGE_SIZE = 20;
2927
export type RunList = Awaited<ReturnType<RunListPresenter["call"]>>;
3028

3129
export class RunListPresenter extends BasePresenter {
32-
33-
3430
public async call({
3531
userId,
3632
eventId,

0 commit comments

Comments
 (0)