Commit Graph

40 Commits

Author SHA1 Message Date
Eric Allam b1b9321ad2 Job run performance improvements and adding "worker only" mode (#360)
* WIP job run performance improvements

- Added a `perf` tool to better measure job run performance under heavy load
- Removed `runFinished` job (not really needed)
- startQueuedRuns now uses a jobKey with replace
- Fixed an issue with ZodWorker when using jobKey

* Publish improvement docker images

* fixed the improvement docker publishing

* Downgrade back to prisma 4.16.0 because 5.1.x broke docker builds

* Changes to how queued runs work

- Split the worker into two different workers, one dedicated to performRunExecution
- Schedule performRunExecution in a single place, with a queue and using a round robin manually controlled concurrency
- Remove startQueuedRuns
- All runs are queued before they are started
- Setting the worker maxPoolSize to the same as the worker concurrency
- Starting to be able to split the docker image

* Remove queue name from startRun graphile job

* Make the prisma connection pool stuff configurable through env vars

* Hardcode (for now) the max concurrent runs limit

* Rewrite performRunExecution to be more performant

PerformRunExecutionV2:

- Does not create and manage jobRunExecution records
- Does not reimplement retrying, uses graphile worker retrying instead

I’ve kept around PerformRunExecutionV1 so this works when deploying. Definitely needs LOTS of testing

* Fix issues with cached tasks

- Limit the size of the cached tasks sent when executing a run, using the knapsack problem dynamic programming approach
- Actually USE the cached tasks in IO by using the idempotencyKey instead of the task ID
- Remove output from all logs
- Added a stress test job catalog

* Forgot to commit the logger updates

* Never log connectionString

* Login to docker hub to get around rate limits

* Add additional logging to the graphile workers

* Fix the *_ENABLED  env vars

* Allow adding and removing jobs to be done from the webapp

* Don’t set the job to failed if it’s being retried

* Deprecated queue options in the job and removed startPosition. Now using the job/env combo as the job queue name

* Dequeung jobs doesn’t check if the runner is initialized

* Fixed issues with retrying a run getting stuck on a cancelled task, and errors from parsing the results of dequeing a job

* Remove queued round robin thing that isn’t used anymore

* Added slack to job catalog

* Better forwards compat

* Added long delay

* Fixed lock file
2023-08-18 15:25:26 +01:00
Matt Aitken 9f649d2a27 Lock prisma to 5.1.1 2023-08-14 16:52:30 +01:00
Chigala 0a20b6e05a chore: updated prisma from version 4.16.0 to 5.1.0 (#254)
* chore: update prisma from version 4.16.0 to 5.1.0

* fixed the ts-errors due to the prisma update

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-14 16:36:40 +01:00
Eric Allam b957aa1752 Remove deprecated invitation-code route 2023-08-14 09:41:05 +01:00
nicktrn 603ffbc426 docs: add supabase guide (#297)
* docs: add supabase guide

* feat: add support for external connection poolers

* chore: use .env symlink in database package

* chore: remove database .env.example

* docs: finish supabase pooling section

* docs: fix small typo

* docs: replace prisma with app wording

* docs: fix up supabase pooling section

* fix: deleted too much in contributing docs

* docs: change pooling heading

* docs: reduce linux shaming

* docs: include direct connection url in fly.io
2023-08-11 15:51:54 +01:00
Matt Aitken 9ff4c0dbd5 Project-wide Prettier setup (#237)
* Setup project-wide prettier

* Remove old workspace file

* Remove old debugging directives

* New top-level .prettierignore

* Updated Prettier config settings

* Contrubuting guide: Fix for some bad code blocks

* Added more ignores

* Improved the format script command

* printWidth set to 100

* Formatted entire repo (pnpm run format)
2023-08-01 10:21:22 +01:00
Eric Allam 36ec16babe feat: encrypt values in SecretStore using an encryption key (#240)
* feat: encrypt values in SecretStore using an encryption key and `aes-256-gcm`

* Stopped using apiCors in the connectionId API endpoint
2023-08-01 10:11:47 +01:00
Matt Aitken 463cbed7df Merge pull request #226 from Chigala/feature/multiple-eventname-support
Feature/multiple eventname support in eventDispatcher
2023-07-31 16:14:25 +01:00
Eric Allam 3e5945fb9e Stop storing github access tokens for github authenticated users 2023-07-31 15:41:44 +01:00
Eric Allam 7e4d72f959 Made the migration non-destructive and fixed other typechecking issues 2023-07-28 18:19:41 +01:00
Chigala 3e203ea967 Merge branch 'main' into feature/multiple-eventname-support 2023-07-28 17:53:31 +01:00
Chigala 8ac83f1d59 added multiple event name support to the eventDispatcher 2023-07-26 21:18:03 +01:00
Matt Aitken 0a3bbc1caf Merge remote-tracking branch 'origin/main' into react-hooks
# Conflicts:
#	apps/webapp/app/presenters/RunPresenter.server.ts
#	examples/nextjs-example/src/app/api/trigger/route.ts
#	examples/nextjs-example/tsconfig.json
2023-07-26 20:47:07 +01:00
Eric Allam 767e09ee18 New integration: @trigger.dev/supabase (#203)
* WIP supabase integration

* supabase oauth working

* Supabase database triggers

* Specify postgres:14

* Limit refreshOAuthToken jobs to 10 attempts

* Better displaying types and removing onChange for now

* WIP on the supabase db client

* Finishing the supabase-js integration

* Adding changeset

* Added supabase to the integration catalogs, and added an optional icon to Integrations

* Reworking how we handle types for the triggers (wip)

* Update fully over to the new way to define supabase triggers

* Go back to using the type for the event name

* Add back in the icon to the JobListPresenter since it was moved from the ProjectPresenter

* Remove unused import
2023-07-26 18:01:27 +01:00
Matt Aitken 8a66a5c6c7 Migrate: Make the pkApiKey unique and non-null 2023-07-25 17:51:14 +01:00
Akhil c417a7f9ab feat: added isRetry in jobRunExecution 2023-07-16 07:19:37 +00:00
Matt Aitken 420655f231 Database migration: relationship between ScheduleSource and DynamicTrigger 2023-07-12 14:42:35 +01:00
Matt Aitken 0a80e2f5ec Added CANCELED TaskStatus to the server 2023-07-12 09:18:59 +01:00
Matt Aitken 4661d2019c Canceling runs 2023-07-11 19:50:06 +01:00
Eric Allam 61ed1fb202 Added support for output properties on tasks 2023-07-08 22:14:27 +01:00
Eric Allam 7efe14b835 Logging in via github should work even after changing your email address 2023-07-07 16:34:41 +01:00
Eric Allam f01af9c0ec Remove a bunch of unused webapp deps and upgrade packages to zod 3.21.4 2023-07-07 14:47:28 +01:00
Eric Allam 7464006e19 Associated trigger sources and dynamic triggers with their registration job 2023-07-07 13:47:19 +01:00
Eric Allam 6527723a0e Refactor index endpoint to work sequentially so we can add associations between sources and jobs 2023-07-07 11:36:01 +01:00
Eric Allam d189f425e8 Limit access to the cloud product to people who have invite codes 2023-07-05 16:31:41 +01:00
Eric Allam 75ac2c9961 Scheduled triggers are now disabled on dev env by default
Also added pk api key to the environments now
2023-07-04 10:59:05 +01:00
Eric Allam f210532870 @trigger.dev/slack: Added joinConversation task, and automatically try and join a public conversation if the bot is not in it when posting a message 2023-07-03 17:48:14 +01:00
Matt Aitken fa1e6bf5e6 The new fields from the Integration catalog are now in the database 2023-06-30 17:24:40 +01:00
Matt Aitken fcd2d6eea2 Integrations now have a setupStatus and can be missing fields 2023-06-30 11:11:28 +01:00
Eric Allam 24542d4e21 Adding support for trigger source in the run context 2023-06-28 12:07:47 +01:00
Eric Allam e1d942bb3a Add pnpm run db:studio command to open prisma studio 2023-06-27 11:27:31 +01:00
James Ritchie 38ac365953 Added a database .env example file 2023-06-26 16:40:30 +01:00
Eric Allam c5d96db9a8 WIP docker github workflow 2023-06-22 13:11:43 +01:00
Eric Allam b62f00dfd7 Implemented seeding the cloud based on env vars 2023-06-22 12:00:18 +01:00
Eric Allam e4b0b1e305 Add support for background task operations, starting with fetch 2023-06-19 17:22:18 +01:00
Matt Aitken 7fc3ff26bc Rejigged database migrate deploy scripts 2023-06-16 16:30:35 +01:00
James Ritchie a218bce73b Added prisma migrate deploy to package 2023-06-16 15:04:03 +01:00
Eric Allam e7f7c0704a Revamped the integration schema and local only integrations now work in the UI 2023-06-16 14:15:17 +01:00
Matt Aitken 31a9164df1 Added API integration voting functionality 2023-06-16 11:32:38 +01:00
Eric Allam 9f49b7f4c0 Move prisma to an internal database package 2023-06-15 14:18:34 +01:00