-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run Engine 2.0 (alpha) #1575
Open
nicktrn
wants to merge
434
commits into
main
Choose a base branch
from
run-engine-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+29,953
−4,858
Open
Run Engine 2.0 (alpha) #1575
Changes from 250 commits
Commits
Show all changes
434 commits
Select commit
Hold shift + click to select a range
e4cb7fd
DB migration for BatchTaskRun and worker changes
matt-aitken 7f7644f
Added a todo to triggerTask
matt-aitken 7c0befe
Added some notes to the schema making it clear what we’re using for b…
matt-aitken 33fbc2e
Move the emitted event down
matt-aitken 51c4434
Added a batchTrigger test where a BatchTaskRun is created and passed in
matt-aitken d203c3e
add workers list command
nicktrn 1bf37c9
support a worker group being set as default by multiple projects
nicktrn 5747417
Run test files in sequence
matt-aitken a2dd5e3
Moved types to a separate file
matt-aitken 12f4fbb
WIP improving the consistency of the return types in the run engine
matt-aitken 766c4ac
Latest lockfile
matt-aitken f6208de
Wait for duration explicit return type, including the execution result
matt-aitken 0799938
Recheduling returns the updated TaskRun
matt-aitken 77b7d0f
Added a friendlyId to Waitpoints now we’re going to have a public API…
matt-aitken 04dc85f
A couple more return types
matt-aitken 808a6f9
Organized imports
matt-aitken c71ac30
Added a test for blocking a second parent with the same child run
matt-aitken 6c3c9f0
Modified triggerTaskV2 to work with the new parentRunId/resumeParentO…
matt-aitken 81188eb
Added TaskRun priorityMs column
matt-aitken 5e2f70a
Migration for Waitpoint.friendlyId and TaskRun.priorityMs
matt-aitken e3d729c
save cli config in pretty format
nicktrn f6047d5
fix worker schema import
nicktrn 862339a
cli profile switcher and other goodies
nicktrn 31993c4
add missing node-22 cases
nicktrn a9db8c3
Better description of the priorityMs column
matt-aitken 4f3c51d
Use the priority when enqueuing runs
matt-aitken 683ceb4
Added a test for priorities
matt-aitken 8f87206
create backup before migrating to new config format
nicktrn 4d5f9c0
first eventbus handler to complete successful run spans
nicktrn 5423968
return env vars when starting run attempts
nicktrn 3276d2b
add basic worker events
nicktrn dc3a2c1
unmanaged worker builds
nicktrn b3d42d6
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn 65f471c
bump worker version
nicktrn f084df1
update lockfile after worker bump
nicktrn 9003b18
add v2 run cancellation
nicktrn d11612e
surface master queues in admin view
nicktrn 99a33e8
run engine compatibility flag and deploy scaffold
nicktrn ac7076b
checkpoint event indexes
nicktrn 66edfe2
shared -> managed worker
nicktrn f25a971
add snapshot creation debug task events
nicktrn 26a72dd
add worker instance metadata
nicktrn ffcd387
remove random package.json
nicktrn 9187996
Revert "checkpoint event indexes"
nicktrn da74e88
managed worker wip
nicktrn 768fc9b
deprecate cli logger warn and error methods
nicktrn 66a0ff9
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn d95a750
add run heartbeat route
nicktrn a06e270
update run engine zod version
nicktrn 78a3d35
add workload heartbeats
nicktrn 5da5a61
unify run heartbeat methods
nicktrn bb824df
restore trigger task service router
nicktrn 0a605b6
remove debug log
nicktrn 68a7e33
complete failed run events, fix success output
nicktrn 3058cdd
child event completion on run failure, better logging
nicktrn 3070a9d
fix http client run heartbeat route
nicktrn 5a79e10
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn a73a3eb
update lockfile
nicktrn 515641e
remove rate limit from run engine
nicktrn 3e26ea4
Always display errors before other code blocks in the run overview tab
nicktrn ff20023
add retry delay spans
nicktrn a1b545b
resurrect uncaught exception handler
nicktrn bed6677
run completion handling and retries
nicktrn 8973ccb
fix span presenter v2 engine outputs and errors
nicktrn 6a91584
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn 676496a
bump worker version
nicktrn 0631b22
remove retry span attribute bloat
nicktrn f595ae4
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn f1b4861
bump worker version
nicktrn 7913e39
report invocation usage
nicktrn 1cc0284
bump node-22 image to 22.12.0 require esm
nicktrn cd0347f
use full node 21 image version tag
nicktrn b42db7b
use multi-arch images for bun and node
nicktrn d9db268
remove unmanaged core export and add managed runtime
nicktrn b9c9c75
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn 71f04cf
bump worker version
nicktrn 3fe3c39
Suggested glossary for the RunEngine, TBC
matt-aitken 2635c58
Removed BatchTaskRun changes from this branch, they were done in main
matt-aitken fb6c33d
Set the BatchTaskRun status to completed when all runs are completed
matt-aitken 7653c22
When dequeuing respect passed in maxResources
matt-aitken ff369f3
Ported over the new run props: idempotencyKeyExpiresAt, versions, one…
matt-aitken fcb4e3b
Didn’t hit save… the new props when triggering tasks passed through
matt-aitken fd58ce6
Idempotency expiration + waitpoint edge case
matt-aitken d7a9e2b
WIP on creating checkpoint, parking for now
matt-aitken b95dd63
fix worker routes
nicktrn d434746
upgrade webapp node types to support generic event emitter
nicktrn eb69641
separate event bus handler singleton and run failure alerts
nicktrn 8262320
duration waits
nicktrn 05b7e30
fix execution snapshot debug spans
nicktrn a6d5ec4
task waits
nicktrn d4a638e
fix event bus types
nicktrn 4d41221
temporary fix for react hook run handle type
nicktrn d707a94
disable run notifications for now
nicktrn 3cee74c
convert any typecasts to expect errors to more easily fix later
nicktrn b4739b7
fix webapp types after node types upgrade
nicktrn c9a51f1
updateEnvConcurrencyLimits across marqs and the runqueue
matt-aitken 9da544e
Pass proper values into the run engine
matt-aitken ff79a77
RunQueue settings and removed unused rebalancing workers
matt-aitken 03c9899
Remove rebalancing prop
matt-aitken c84b506
Tidied more things up
matt-aitken 160e219
Update/remove queue limits for MARQS and RunQueue
matt-aitken 086c1bf
taskQueue/concurrencyLimit changes ported back into the RunEngine
matt-aitken e1177f7
Reworked completing waitpoints to improve performance and reduce race…
matt-aitken b57e913
Improved test robustness
matt-aitken ab9e268
Down to a single run lock only when a run is totally unblocked and re…
matt-aitken 872cea3
warm starts, worker notifications, wait fixes
nicktrn 93d2501
Fix for Run Engine poll interval env var
matt-aitken f572c0f
Expect the waitpoint to be completed quickly
matt-aitken fb56932
If a run is locked then it’s too late to expire it
matt-aitken e01288d
Added VALKEY_ env vars and plugged them into the run engine
matt-aitken 4c9e024
Extracted and updated the guard queue function so it can be used when…
matt-aitken f020acf
Merge remote-tracking branch 'origin/main' into run-engine-2
matt-aitken f1e2736
Added logging and universal concurrency changes to trigger task v1
matt-aitken fb433de
Added notes back in
matt-aitken 1238ef7
Bump @trigger.dev/worker to 3.3.7
matt-aitken 2490882
reportInvocationUsage for the runAttemptStarted event
matt-aitken a24644b
improve execution snapshot span debug span start times
nicktrn 3df8158
Unfriendly IDs
nicktrn 677a2d6
update lockfile
nicktrn 62c03bf
Created a shared determineEngineVersion function
matt-aitken 0b37539
disable unfinished commands
nicktrn da41728
save new cli config to different location, misc fixes
nicktrn d3a3951
add basic engine version check via current deploy
nicktrn 476b20f
new run engine will default to node 22 runtime
nicktrn e155aad
block some actions for projects on previous run engine
nicktrn 23e8d37
fix worker group tests
nicktrn fb5b2e7
fix triggerAndWait test
nicktrn f94154a
one typescript version to rule them all
nicktrn 23f3400
redlock type patch
nicktrn 5f07ff2
fix type issues caused by ts-reset
nicktrn 46c79e0
improve cleanup scripts
nicktrn accf9f7
add missing socket.io dep
nicktrn 0b0b7da
fix run notification handler type
nicktrn fa8bfc9
fix worker group test again
nicktrn 958c439
generate prisma client for e2e tests
nicktrn c8f460e
remove worker group tests for now
nicktrn 082644e
prevent image pull rate limits during unit tests
nicktrn 95a7155
increase timeout for queue concurrency limit test
nicktrn 610c95f
generate prisma client for preview release
nicktrn b1604fb
same node types everywhere
nicktrn 079bd5c
Merge branch 'main' into run-engine-2
matt-aitken 14250d5
Updated engine readme, removed legacy system notes
matt-aitken 56979e6
use default machine preset from platform package
nicktrn ae6a473
worker instances plural in schema
nicktrn 482a98d
disable pnpm update notifications
nicktrn d3386e2
return worker group details from connect call
nicktrn 7d382ac
add workers admin route
nicktrn a759bf7
fix heartbeat route return type
nicktrn 927edea
move deployment labels to core apps
nicktrn 3d21147
refactor run controller env schema
nicktrn 4f954b2
Add firstAttemptStartedAt to TaskRun
matt-aitken 3d4068a
RunEngine 2.0 batch trigger support (#1581)
matt-aitken 0642c9c
More changes to blocking to support continuing after idempotent compl…
matt-aitken fdf0bf6
Fix for the wrong type when blocking a run
matt-aitken d6e8743
remove @map
nicktrn 9d24fc1
optimise worker auth query
nicktrn 446a94f
add engine version header to core api client requests
nicktrn ca82d75
remove unique constraint for default group id
nicktrn 3c67350
consolidate migrations
nicktrn f961a75
the first managed worker becomes the global default
nicktrn 3e2687e
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn 45a829e
Debug events off by default, added an admin toggle to show them
matt-aitken a254602
worker group name can't be an empty string
nicktrn bc38276
add exec helper to core
nicktrn 1d6fb48
move machine resources to core
nicktrn a76ef98
add pre-dequeue callback to determine max resources
nicktrn 5cf7c52
optionally skip dequeue
nicktrn 994ac3e
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn 70abb63
bump worker package
nicktrn f319d3a
move worker to core
nicktrn 74dd91f
fix ReadableStream type error
nicktrn 8704e77
Merge remote-tracking branch 'origin/main' into run-engine-2
nicktrn 4f8ce0b
fix another type issue
nicktrn b8cb8dc
update a few more tsconfigs
nicktrn b12b617
add metadata changes introduced in #1563
nicktrn c8b835a
Run Engine 2.0 trigger idempotency (#1613)
matt-aitken e742e8b
Merge remote-tracking branch 'origin/main' into run-engine-2
matt-aitken e942c04
Latest lockfile
matt-aitken 68813bb
Trigger with a machine (old run engine)
matt-aitken a37b528
RE2, allow setting machine when triggering
matt-aitken 46e0698
Fix for new glob patterns
matt-aitken 41cfaa4
add max run count to dequeue from version route
nicktrn 6ff1893
add worker instance name env var and header
nicktrn 35ab2bd
queue consumer pre skip callback
nicktrn 05c0ee9
poll for more runs after final execution errors
nicktrn 6b8bd66
fix dequeue search param schema
nicktrn 8aa07e7
add shortcut to debug switch
nicktrn 9da8029
expose run engine timeouts as env vars
nicktrn 5f95a7b
make warm start durations configurable
nicktrn 54d297f
add optional status to json reply helper
nicktrn 7733a72
fix preSkip hook, add debug logs
nicktrn e936cea
BLOCKED_BY_WAITPOINTS -> SUSPENDED
nicktrn 39fa134
exit controller when run suspended
nicktrn 5002ad8
check if already replied before http reply
nicktrn 3e21ad5
run controller will wait for next run after the current one is suspended
nicktrn acdb65a
cancel run button shortcut
nicktrn b9b1679
minimal event repository environment type
nicktrn b77a8d3
fix update metadata call
nicktrn 87bbeac
run suspension and misc fixes wip
nicktrn d88310a
change debug shortcut to shift + D
nicktrn 76d4cb0
Started work on the Dev supervisor
matt-aitken 40223c0
Formatting
matt-aitken 45d1b12
Fix for bad imports
matt-aitken 57be5d0
Before rebuilding SSE
matt-aitken 88b30d7
Presence updating from the CLI working via SSE
matt-aitken 9bc223a
add worker notification debug logs
nicktrn 06db938
send run:stop when exiting run phase
nicktrn dbfa1bd
skip current snapshot poll on worker notification
nicktrn de05bda
add more logs and route to submit run debug logs
nicktrn e1ad2c1
add worker and runner ids to snapshots
nicktrn 426259a
improve run notification debug logs
nicktrn f85d8ee
add workload debug log route
nicktrn 4744ba0
misc run controller fixes and refactor
nicktrn bd7479b
prevent parallel execution of critical functions
nicktrn d89d5f1
update bun to 1.2.1
nicktrn a8a3b20
WIP with dev dequeuing
matt-aitken 117bc4d
Method to convert friendlyIds to non-friendly, do nothing with actual…
matt-aitken 66d392c
Set the engine on BackgroundWorker, lazily upgrade projects to engine V2
matt-aitken 8317e80
Runs with ttls were getting immediately expired… oops.
matt-aitken da0d4a0
Pass the Waiting for deploy reason through, so we have it on the exec…
matt-aitken b7e3801
Fixed the logic for getting the right background worker for a run
matt-aitken 8144140
Use the correct ID when dequeuing…
matt-aitken 323cfce
determineEngineVersion is now fully functional
matt-aitken adeb113
Rate limiter ignores the dev endpoints
matt-aitken 881986c
Retrieving a batch gives you the runIds
matt-aitken 19693fa
Set a unique version for the RE2 BatchTaskRun
matt-aitken 84c590b
add provisional changeset
nicktrn 8da1e6b
The start of dev run execution is working
matt-aitken 864fa1b
First dev run working
matt-aitken 2580b3a
Moved the dev run controller closer to what Nick did with the managed…
matt-aitken eee6a4d
export exec output type
nicktrn 837ba73
Heartbeat fix: don’t heartbeat if _isHeartbeating == false
matt-aitken d995cf0
Dev runs get notifications, some dev bug fixes
matt-aitken 6a5f228
Improved logging or dequeuing
matt-aitken 684b72b
We need to dequeue runs from the latest version too, for triggerAndWait
matt-aitken f016857
Ported Eric’s validateWorkerManifest with nicer errors
matt-aitken ef970cd
When flattening an idempotency key if part is undefined, return undef…
matt-aitken b7f4959
Dev logging fixes
matt-aitken 5cb706c
Remove sigterm listener
matt-aitken b19498c
Deprecating workers. Don’t specify a BackgroundWorker when dequeuing …
matt-aitken 1d882d7
Deleted some old files. Renamed “managed” to “deploy”
matt-aitken cb24953
When a build finishes, always copy the build dir (otherwise the first…
matt-aitken 87e8e89
Dev master queues should work differently
matt-aitken a0216b9
Deleting old workers
matt-aitken 4e27563
Added debounce function to core
matt-aitken a2f36b6
Improvement to canceling
matt-aitken 6bfc246
WIP on debounce canceling on socket disconnection
matt-aitken d8e4c43
Added environment data to execution snapshots
matt-aitken 6088c27
Dev runs that have stalled get “Canceled” with a reason explaining why
matt-aitken 8ec03c5
Show CLI messaged when a connection to the platform is lost/restored
matt-aitken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium