Skip to content

v3 docs #929

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

Merged
merged 43 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5e38e7d
Started building out the docs navigation
matt-aitken Mar 7, 2024
77dafc9
Drafted out a lot of the docs pages. With just titles and description…
matt-aitken Mar 7, 2024
34f5911
A ton more scaffolded pages with titles, descriptions, coming soon/in…
matt-aitken Mar 7, 2024
f1a6518
Created the remaining page stubs
matt-aitken Mar 7, 2024
4f2b558
Introduction page improvements
matt-aitken Mar 7, 2024
8d4efad
Lots of docs changes, mostly the task overview page
matt-aitken Mar 11, 2024
24f31dc
Merge remote-tracking branch 'origin/main' into features/v3-docs
matt-aitken Mar 11, 2024
83a688f
Moved some bits around
matt-aitken Mar 11, 2024
06cb0cd
Task overview fleshed out
matt-aitken Mar 11, 2024
3ebecb9
Triggering docs page
matt-aitken Mar 12, 2024
b0bbe7b
Regular task page
matt-aitken Mar 12, 2024
52cb424
CLi dev docs
matt-aitken Mar 12, 2024
24027ec
Docs for debugging locally
matt-aitken Mar 12, 2024
5f9a305
Environment variables docs
matt-aitken Mar 12, 2024
292c563
Added env var images
matt-aitken Mar 12, 2024
1c2d436
Deployment guides
matt-aitken Mar 12, 2024
f98b950
Updated the title of “Integrations” to “Deployment integrations” to m…
matt-aitken Mar 12, 2024
8ba5787
Lots more docs pages
matt-aitken Mar 12, 2024
e1f3c6c
Changed the language to JavaScript
matt-aitken Mar 13, 2024
05e5dbe
Fixed typos about queues and added a simple code sample
matt-aitken Mar 13, 2024
731d26b
Moved the local debugger docs into the CLI dev page
matt-aitken Mar 13, 2024
b8b1067
Added the CLI deploy options
matt-aitken Mar 13, 2024
02fa06a
Delete the local debugger page
matt-aitken Mar 13, 2024
5f6d14a
Updated the logging page with structured logging
matt-aitken Mar 13, 2024
7698896
Added the new CLI deploy options
matt-aitken Mar 13, 2024
1425f1b
Change to h4 for one of the options
matt-aitken Mar 13, 2024
9e060a1
Errors page
matt-aitken Mar 13, 2024
7fa109f
WIP on retrying
matt-aitken Mar 13, 2024
f74e2dc
Merge remote-tracking branch 'origin/main' into features/v3-docs
matt-aitken Mar 13, 2024
1927d15
Retrying guide
matt-aitken Mar 13, 2024
f480fd5
Wait docs pages
matt-aitken Mar 13, 2024
6cfe890
Queuing docs simplified, partial written
matt-aitken Mar 13, 2024
19aa9ab
Queuing and concurrency docs
matt-aitken Mar 13, 2024
bf74ffb
Run tests docs
matt-aitken Mar 14, 2024
c0f9266
New combined error and retrying page
matt-aitken Mar 14, 2024
29ba00a
Merge remote-tracking branch 'origin/main' into features/v3-docs
matt-aitken Mar 14, 2024
1291996
Errors and retrying page updated
matt-aitken Mar 14, 2024
3f603fa
More docs
matt-aitken Mar 14, 2024
60dd802
Added a possible configurations coming soon table
matt-aitken Mar 14, 2024
fed684e
Created a limits page
matt-aitken Mar 14, 2024
d6d8097
Added warnings about how you need to get early access
matt-aitken Mar 22, 2024
71befc8
Merge remote-tracking branch 'origin/main' into features/v3-docs
matt-aitken Mar 22, 2024
b838f75
Minor fixes for the docs
matt-aitken Mar 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/instrumentation_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: OpenTelemetry Auto-Instrumentation Request
description: Suggest an SDK that you'd like to be auto-instrumented in the Run log view
title: "auto-instrumentation: "
labels: ["🌟 enhancement"]
body:
- type: textarea
attributes:
label: What API or SDK would you to have automatic spans for?
description: A clear description of which API or SDK you'd like, and links to it.
validations:
required: true
- type: textarea
attributes:
label: Is there an existing OpenTelemetry auto-instrumentation package?
description: You can search for existing ones – https://opentelemetry.io/ecosystem/registry/?component=instrumentation&language=js
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Add any other information related to the feature here. If your feature request is related to any issues or discussions, link them here.
1 change: 1 addition & 0 deletions docs/_snippets/coming-soon-slim.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<Warning>This feature will become available during the Developer Preview.</Warning>
3 changes: 3 additions & 0 deletions docs/_snippets/coming-soon.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Warning>This feature will become available during the Developer Preview.</Warning>

To get the latest updates on the Developer Preview, [join our Discord community](https://trigger.dev/discord) or follow us on [Twitter](https://twitter.com/triggerdotdev).
1 change: 1 addition & 0 deletions docs/_snippets/incomplete-docs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<Note>This documentation is coming soon.</Note>
34 changes: 34 additions & 0 deletions docs/_snippets/v3/code/openai-retry.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
```ts /trigger/openai.ts
import { task } from "@trigger.dev/sdk/v3";
import OpenAI from "openai";

const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});

export const openaiTask = task({
id: "openai-task",
//specifying retry options overrides the defaults defined in your trigger.config file
retry: {
maxAttempts: 10,
factor: 1.8,
minTimeoutInMs: 500,
maxTimeoutInMs: 30_000,
randomize: false,
},
run: async (payload: { prompt: string }) => {
//if this fails, it will throw an error and retry
const chatCompletion = await openai.chat.completions.create({
messages: [{ role: "user", content: payload.prompt }],
model: "gpt-3.5-turbo",
});

if (chatCompletion.choices[0]?.message.content === undefined) {
//sometimes OpenAI returns an empty response, let's retry by throwing an error
throw new Error("OpenAI call failed");
}

return chatCompletion.choices[0].message.content;
},
});
```
4 changes: 4 additions & 0 deletions docs/_snippets/v3/paused-execution-free.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Note>
In the Trigger.dev Cloud we automatically pause execution of tasks when they are waiting for
longer than a few seconds. You are not charged when execution is paused.
</Note>
5 changes: 1 addition & 4 deletions docs/documentation/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ Trigger.dev is an open source framework for creating long-running Jobs directly

You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [Self-host Trigger.dev](/documentation/guides/self-hosting) on your own infrastructure.

<Note>
Trigger.dev v2 currently only supports serverless. We will be adding [support for long-running
servers](https://github.com/triggerdotdev/trigger.dev/issues/244) soon.
</Note>
<Note>Trigger.dev v2 currently only supports serverless.</Note>

<CardGroup>
<Card title="Quick start guides" icon="person-running-fast" href="quickstarts/introduction">
Expand Down
Binary file added docs/images/v3/environment-variables-actions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/environment-variables-page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/environment-variables-panel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/run-in-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/run-log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/test-select-environment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/test-select-task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/v3/test-set-payload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
155 changes: 155 additions & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
{
"name": "Examples",
"url": "https://trigger.dev/apis"
},
{
"name": "v3 Developer Preview",
"url": "v3"
}
],
"redirects": [
Expand Down Expand Up @@ -427,6 +431,157 @@
{
"group": "Overview",
"pages": ["examples/introduction"]
},
{
"group": "",
"pages": ["v3/introduction"]
},
{
"group": "Getting Started",
"pages": [
"v3/quick-start",
"v3/upgrading-from-v2",
"v3/changelog",
"v3/feature-matrix",
"v3/limits"
]
},
{
"group": "Fundamentals",
"pages": [
"v3/trigger-folder",
"v3/tasks-overview",
"v3/triggering",
{
"group": "Task types",
"pages": ["v3/tasks-regular", "v3/tasks-scheduled", "v3/tasks-zod", "v3/tasks-webhooks"]
}
]
},
{
"group": "Development",
"pages": ["v3/cli-dev", "v3/run-tests"]
},
{
"group": "Deployment",
"pages": [
"v3/deploy-environment-variables",
"v3/cli-deploy",
"v3/github-actions",
{
"group": "Deployment integrations",
"pages": ["v3/vercel-integration"]
}
]
},
{
"group": "Writing tasks",
"pages": [
"v3/writing-tasks-introduction",
"v3/logging",
"v3/errors-retrying",
{
"group": "Wait",
"pages": [
"v3/wait",
"v3/wait-for",
"v3/wait-until",
"v3/wait-for-event",
"v3/wait-for-request"
]
},
"v3/queue-concurrency",
"v3/versioning",
"v3/machines",
"v3/idempotency",
"v3/reattempting-replaying",
"v3/trigger-filters",
"v3/notifications",
"v3/rollbacks",
"v3/using-apis",
"v3/middleware",
"v3/automated-tests"
]
},
{
"group": "Dashboard",
"pages": [
"v3/dashboard-overview",
"v3/dashboard-runs",
"v3/dashboard-tests",
"v3/dashboard-environment-variables"
]
},
{
"group": "API reference",
"pages": [
{
"group": "Functions",
"pages": [
"v3/reference-task",
"v3/reference-cron-task",
"v3/reference-cron-dynamic",
"v3/reference-interval-task",
"v3/reference-interval-dynamic",
"v3/reference-zod-task",
"v3/reference-zod-catalog",
"v3/reference-task-trigger",
"v3/reference-task-trigger-and-wait",
"v3/reference-task-batch-trigger",
"v3/reference-task-batch-trigger-and-wait",
"v3/reference-wait-for",
"v3/reference-wait-until",
"v3/reference-wait-for-event",
"v3/reference-wait-for-request",
"v3/reference-retry-on-throw",
"v3/reference-retry-fetch",
"v3/reference-retry-intercept-fetch",
"v3/reference-notification-catalog",
"v3/reference-notify",
"v3/reference-queue"
]
},
{
"group": "Objects",
"pages": ["v3/reference-context"]
},
{
"group": "CLI",
"pages": [
"v3/reference-cli-init",
"v3/reference-cli-dev",
"v3/reference-cli-deploy",
"v3/reference-cli-login",
"v3/reference-cli-logout",
"v3/reference-cli-update",
"v3/reference-cli-build",
"v3/reference-cli-who-am-i"
]
},
"v3/reference-trigger-config"
]
},
{
"group": "Architecture",
"pages": [
"v3/architecture-how-it-works",
"v3/architecture-multi-tenant-queue",
"v3/architecture-reliability"
]
},
{
"group": "Open source",
"pages": ["v3/github-repo", "v3/open-source-self-hosting", "v3/open-source-contributing"]
},
{
"group": "Help",
"pages": [
"v3/help-faqs",
"v3/community",
"v3/help-email",
"v3/help-slack",
"v3/help-uptime-status"
]
}
],
"footerSocials": {
Expand Down
7 changes: 7 additions & 0 deletions docs/v3/architecture-how-it-works.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Architecture: How it works"
sidebarTitle: "How it works"
description: "An overview of how Trigger.dev v3 works under the hood."
---

<Snippet file="incomplete-docs.mdx" />
7 changes: 7 additions & 0 deletions docs/v3/architecture-multi-tenant-queue.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Architecture: Multi-tenant queue"
sidebarTitle: "Multi-tenant queue"
description: "We built a reliable and fair multi-tenant queue that controls triggering all tasks."
---

<Snippet file="incomplete-docs.mdx" />
7 changes: 7 additions & 0 deletions docs/v3/architecture-reliability.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Architecture: Reliability"
sidebarTitle: "Reliability"
description: "How reliability is achieved with Trigger.dev."
---

<Snippet file="incomplete-docs.mdx" />
6 changes: 6 additions & 0 deletions docs/v3/automated-tests.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Automated tests"
description: "Write automated tests of your tasks."
---

<Snippet file="coming-soon.mdx" />
6 changes: 6 additions & 0 deletions docs/v3/changelog.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Changelog"
url: "https://trigger.dev/changelog"
---

Our [changelog](https://trigger.dev/changelog) is the best way to stay up to date with the latest changes to Trigger.
88 changes: 88 additions & 0 deletions docs/v3/cli-deploy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
title: "CLI deploy command"
description: "The `trigger.dev deploy` command can be used to manually deploy."
---

You run the command like this:

<CodeGroup>

```bash npm
npx trigger.dev@v3 deploy
```

```bash pnpm
pnpm dlx trigger.dev@v3 deploy
```

```bash yarn
yarn dlx trigger.dev@v3 deploy
```

</CodeGroup>

It performs a few steps to deploy:

1. Typechecks the code.
2. Compiles and bundles the code.
3. Checks that [environment variables](/v3/deploy-environment-variables) are set.
4. Deploys the code to the cloud.
5. Registers the tasks as a new version in the environment (prod by default).

## Options

### Environment `--env` or `-e`

Defaults to `prod` but you can specify `staging`.

### Skip typecheck `--skip-typecheck` or `-T`

Skips the pre-build typecheck step.

### Build platform `--build-platform`

The platform to build the deployment image for. Defaults to `linux/amd64`.

### Log level `--log-level` or `-l`

The log level to use (debug, info, log, warn, error, none). Defaults to `log`.

### Set config filename `--config` or `-c`

The name of the config file, found where the command is run from. Defaults to `trigger.config.ts`.

### Set the projectRef `--project-ref` or `-p`

The project ref. Required if there is no config file.

### Self-hosted options

These options are usually only relevant to self-hosters or for local development.

#### Skip deploying the image `--skip-deploy` or `-D`

Load the built image into your local docker.

#### Self-hosted (builds locally) `--self-hosted`

Builds and loads the image using your local docker. Use the `--registry` option to specify the registry to push the image to when using `--self-hosted`, or just use `--push-image` to push to the default registry.

#### Registry `--registry`

<Snippet file="coming-soon-slim.mdx" />

The registry to push the image to when using --self-hosted.

#### Push image `--push-image`

<Snippet file="coming-soon-slim.mdx" />

When using the --self-hosted flag, push the image to the default registry. (defaults to false when not using --registry)

#### Tag the image `--tag`

<Snippet file="coming-soon-slim.mdx" />

Specify the tag to use when pushing the image to the registry.

{/* todo add options, remove the reference docs */}
Loading