Skip to content

Commit 03d00be

Browse files
committed
Merge branch 'main' into v3/fix-abort-controller
2 parents 1b75bc1 + f89d93b commit 03d00be

19 files changed

+143
-48
lines changed

.changeset/polite-tables-exercise.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/github-actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
TRIGGER_API_URL: ${{ secrets.TRIGGER_API_URL }}
182182
# deploy with additional flags
183183
run: |
184-
npx trigger.dev@beta deploy --self-hosted --push
184+
npx trigger.dev@latest deploy --self-hosted --push
185185
```
186186

187187
</CodeGroup>

docs/open-source-self-hosting.mdx

Lines changed: 69 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ title: "Self-hosting"
33
description: "You can self-host Trigger.dev on your own infrastructure."
44
---
55

6-
<Warning>Self-hosting does not support the latest CLI yet, you will have to continue using the `beta` tag for now.</Warning>
7-
86
## Overview
97

108
<Frame>
@@ -85,7 +83,6 @@ sudo apt-get install -y \
8583
```bash
8684
git clone https://github.com/triggerdotdev/docker
8785
cd docker
88-
git checkout v3
8986
```
9087

9188
2. Run the start script and follow the prompts
@@ -94,7 +91,7 @@ git checkout v3
9491
./start.sh # hint: you can append -d to run in detached mode
9592
```
9693

97-
### Manual setup
94+
#### Manual
9895

9996
Alternatively, you can follow these manual steps after cloning the docker repo:
10097

@@ -176,7 +173,7 @@ docker login -u <your_dockerhub_username>
176173
5. You can now deploy v3 projects using the CLI with these flags:
177174

178175
```
179-
npx trigger.dev@beta deploy --self-hosted --push
176+
npx trigger.dev@latest deploy --self-hosted --push
180177
```
181178

182179
## Part 2: Split services
@@ -286,12 +283,60 @@ echo "FORCE_CHECKPOINT_SIMULATION=0" >> .env
286283
./stop.sh worker && ./start.sh worker
287284
```
288285

289-
## Telemetry
286+
## Updating
290287

291-
By default, the Trigger.dev webapp sends telemetry data to our servers. This data is used to improve the product and is not shared with third parties. If you would like to opt-out of this, you can set the `TRIGGER_TELEMETRY_DISABLED` environment variable in your `.env` file. The value doesn't matter, it just can't be empty. For example:
288+
Once you have everything set up, you will periodically want to update your Docker images. You can easily do this by running the update script and restarting your services:
292289

293290
```bash
294-
TRIGGER_TELEMETRY_DISABLED=1
291+
./update.sh
292+
./stop.sh && ./start.sh
293+
```
294+
295+
Sometimes, we will make more extensive changes that require pulling updated compose files, scripts, etc from our docker repo:
296+
297+
```bash
298+
git pull
299+
./stop.sh && ./start.sh
300+
```
301+
302+
Occasionally, you may also have to update your `.env` file, but we will try to keep these changes to a minimum. Check the `.env.example` file for new variables.
303+
304+
### From beta
305+
306+
If you're coming from the beta CLI package images, you will need to:
307+
- **Stash you changes.** If you made any changes, stash them with `git stash`.
308+
- **Switch branches.** We moved back to main. Run `git checkout main` in your docker repo.
309+
- **Pull in updates.** We've added a new container for [Electric](https://github.com/electric-sql/electric) and made some other improvements. Run `git pull` to get the latest updates.
310+
- **Apply your changes.** If you stashed your changes, apply them with `git stash pop`.
311+
- **Restart all services.** Run `./stop.sh && ./start.sh` and you're good to go.
312+
313+
In summary, run this wherever you cloned the docker repo:
314+
315+
```bash
316+
# if you made changes
317+
git stash
318+
319+
# switch to the main branch and pull the latest changes
320+
git checkout main
321+
git pull
322+
323+
# if you stashed your changes
324+
git stash pop
325+
326+
# restart your services
327+
./stop.sh && ./start.sh
328+
```
329+
330+
## Version locking
331+
332+
There are several reasons to lock the version of your Docker images:
333+
- **Backwards compatibility.** We try our best to maintain compatibility with older CLI versions, but it's not always possible. If you don't want to update your CLI, you can lock your Docker images to that specific version.
334+
- **Ensuring full feature support.** Sometimes, new CLI releases will also require new or updated platform features. Running unlocked images can make any issues difficult to debug. Using a specific tag can help here as well.
335+
336+
By default, the images will point at the latest versioned release via the `v3` tag. You can override this by specifying a different tag in your `.env` file. For example:
337+
338+
```bash
339+
TRIGGER_IMAGE_TAG=v3.0.4
295340
```
296341

297342
## CLI usage
@@ -303,7 +348,7 @@ This section highlights some of the CLI commands and options that are useful whe
303348
To avoid being redirected to the [Trigger.dev Cloud](https://cloud.trigger.dev) login page when using the CLI, you can specify the URL of your self-hosted instance with the `--api-url` or `-a` flag. For example:
304349

305350
```bash
306-
npx trigger.dev@beta login -a http://trigger.example.com
351+
npx trigger.dev@latest login -a http://trigger.example.com
307352
```
308353

309354
Once you've logged in, the CLI will remember your login details and you won't need to specify the URL again with other commands.
@@ -313,38 +358,38 @@ Once you've logged in, the CLI will remember your login details and you won't ne
313358
You can specify a custom profile when logging in. This allows you to easily use the CLI with our cloud product and your self-hosted instance at the same time. For example:
314359

315360
```
316-
npx trigger.dev@beta login -a http://trigger.example.com --profile my-profile
361+
npx trigger.dev@latest login -a http://trigger.example.com --profile my-profile
317362
```
318363

319364
You can then use this profile with other commands:
320365

321366
```
322-
npx trigger.dev@beta dev --profile my-profile
367+
npx trigger.dev@latest dev --profile my-profile
323368
```
324369

325370
To list all your profiles, use the `list-profiles` command:
326371

327372
```
328-
npx trigger.dev@beta list-profiles
373+
npx trigger.dev@latest list-profiles
329374
```
330375

331376
#### Verify login
332377

333378
It can be useful to check you have successfully logged in to the correct instance. You can do this with the `whoami` command, which will also show the API URL:
334379

335380
```bash
336-
npx trigger.dev@beta whoami
381+
npx trigger.dev@latest whoami
337382

338383
# with a custom profile
339-
npx trigger.dev@beta whoami --profile my-profile
384+
npx trigger.dev@latest whoami --profile my-profile
340385
```
341386

342387
### Deploy
343388

344389
On [Trigger.dev Cloud](https://cloud.trigger.dev), we build deployments remotely and push those images for you. When self-hosting you will have to do that locally yourself. This can be done with the `--self-hosted` and `--push` flags. For example:
345390

346391
```
347-
npx trigger.dev@beta deploy --self-hosted --push
392+
npx trigger.dev@latest deploy --self-hosted --push
348393
```
349394

350395
### CI / GitHub Actions
@@ -353,3 +398,12 @@ When running the CLI in a CI environment, your login profiles won't be available
353398
variables to point at your self-hosted instance and authenticate.
354399

355400
For more detailed instructions, see the [GitHub Actions guide](/github-actions).
401+
402+
403+
## Telemetry
404+
405+
By default, the Trigger.dev webapp sends telemetry data to our servers. This data is used to improve the product and is not shared with third parties. If you would like to opt-out of this, you can set the `TRIGGER_TELEMETRY_DISABLED` environment variable in your `.env` file. The value doesn't matter, it just can't be empty. For example:
406+
407+
```bash
408+
TRIGGER_TELEMETRY_DISABLED=1
409+
```

docs/snippets/cli-commands-deploy.mdx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,33 +81,37 @@ These options are available on most commands.
8181

8282
These options are typically used when [self-hosting](/open-source-self-hosting) or for local development.
8383

84-
<ParamField body="Skip deploying the image" type="--skip-deploy | -D">
85-
Load the built image into your local docker.
86-
</ParamField>
87-
8884
<ParamField body="Self-hosted (builds locally)" type="--self-hosted">
8985
Builds and loads the image using your local docker. Use the `--registry` option to specify the
9086
registry to push the image to when using `--self-hosted`, or just use `--push` to push to the
9187
default registry.
9288
</ParamField>
9389

90+
<ParamField body="Skip deploying the image" type="--skip-deploy | -D">
91+
Load the built image into your local docker.
92+
</ParamField>
93+
9494
<ParamField body="Load image" type="--load-image">
9595
Loads the image into your local docker after building it.
9696
</ParamField>
9797

9898
<ParamField body="Registry" type="--registry">
99-
Specify the registry to push the image to when using `--self-hosted`.
99+
Specify the registry to push the image to when using `--self-hosted`. Will automatically enable `--push`.
100100
</ParamField>
101101

102102
<ParamField body="Push image" type="--push">
103-
When using the --self-hosted flag, push the image to the registry.
103+
When using the `--self-hosted` flag, push the image to the registry.
104104
</ParamField>
105105

106106
<ParamField body="Namespace" type="--namepsace">
107107
The namespace to use when pushing the image to the registry. For example, if pushing to Docker
108108
Hub, the namespace is your Docker Hub username.
109109
</ParamField>
110110

111+
<ParamField body="Network" type="--network">
112+
The networking mode for RUN instructions when using `--self-hosted`.
113+
</ParamField>
114+
111115
## Examples
112116

113117
### Push to Docker Hub (self-hosted)
@@ -118,7 +122,6 @@ An example of deploying to Docker Hub when using a self-hosted setup:
118122
npx trigger.dev@latest deploy \
119123
--self-hosted \
120124
--load-image \
121-
--push \
122125
--registry docker.io \
123126
--namespace mydockerhubusername
124127
```

docs/upgrading-beta.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ You can now specify a custom registry and namespace when deploying via a self-ho
412412
npx trigger.dev@latest deploy \
413413
--self-hosted \
414414
--load-image \
415-
--push \
416415
--registry docker.io \
417416
--namespace mydockerhubusername
418417
```

packages/build/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @trigger.dev/build
22

3+
## 3.0.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [4adc773c7]
8+
- @trigger.dev/[email protected]
9+
310
## 3.0.3
411

512
### Patch Changes

packages/build/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trigger.dev/build",
3-
"version": "3.0.3",
3+
"version": "3.0.4",
44
"description": "trigger.dev build extensions",
55
"license": "MIT",
66
"publishConfig": {
@@ -61,7 +61,7 @@
6161
"check-exports": "attw --pack ."
6262
},
6363
"dependencies": {
64-
"@trigger.dev/core": "workspace:3.0.3",
64+
"@trigger.dev/core": "workspace:3.0.4",
6565
"pkg-types": "^1.1.3",
6666
"tinyglobby": "^0.2.2",
6767
"tsconfck": "3.1.3"

packages/cli-v3/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# trigger.dev
22

3+
## 3.0.4
4+
5+
### Patch Changes
6+
7+
- 8d1e41693: - Improve index error logging
8+
- Add network flag for self-hosted deploys
9+
- Fix checksum flag on some docker versions
10+
- Add Containerfile debug logs
11+
- Updated dependencies [4adc773c7]
12+
- @trigger.dev/[email protected]
13+
- @trigger.dev/[email protected]
14+
315
## 3.0.3
416

517
### Patch Changes

packages/cli-v3/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trigger.dev",
3-
"version": "3.0.3",
3+
"version": "3.0.4",
44
"description": "A Command-Line Interface for Trigger.dev (v3) projects",
55
"type": "module",
66
"license": "MIT",
@@ -87,8 +87,8 @@
8787
"@opentelemetry/sdk-trace-base": "1.25.1",
8888
"@opentelemetry/sdk-trace-node": "1.25.1",
8989
"@opentelemetry/semantic-conventions": "1.25.1",
90-
"@trigger.dev/build": "workspace:3.0.3",
91-
"@trigger.dev/core": "workspace:3.0.3",
90+
"@trigger.dev/build": "workspace:3.0.4",
91+
"@trigger.dev/core": "workspace:3.0.4",
9292
"c12": "^1.11.1",
9393
"chalk": "^5.2.0",
9494
"cli-table3": "^0.6.3",

packages/cli-v3/src/build/buildWorker.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,5 +223,10 @@ async function writeContainerfile(outputPath: string, buildManifest: BuildManife
223223
indexScript: buildManifest.indexControllerEntryPoint,
224224
});
225225

226-
await writeFile(join(outputPath, "Containerfile"), containerfile);
226+
const containerfilePath = join(outputPath, "Containerfile");
227+
228+
logger.debug("Writing Containerfile", { containerfilePath });
229+
logger.debug(containerfile);
230+
231+
await writeFile(containerfilePath, containerfile);
227232
}

packages/cli-v3/src/commands/deploy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const DeployCommandOptions = CommonCommandOptions.extend({
5555
skipUpdateCheck: z.boolean().default(false),
5656
noCache: z.boolean().default(false),
5757
envFile: z.string().optional(),
58+
network: z.enum(["default", "none", "host"]).optional(),
5859
});
5960

6061
type DeployCommandOptions = z.infer<typeof DeployCommandOptions>;
@@ -144,6 +145,7 @@ export function configureDeployCommand(program: Command) {
144145
"If provided, will save logs even for successful builds"
145146
).hideHelp()
146147
)
148+
.option("--network <mode>", "The networking mode for RUN instructions when using --self-hosted")
147149
.action(async (path, options) => {
148150
await handleTelemetry(async () => {
149151
await printStandloneInitialBanner(true);
@@ -349,6 +351,7 @@ async function _deployCommand(dir: string, options: DeployCommandOptions) {
349351
authAccessToken: authorization.auth.accessToken,
350352
compilationPath: destination.path,
351353
buildEnvVars: buildManifest.build.env,
354+
network: options.network,
352355
});
353356

354357
logger.debug("Build result", buildResult);

packages/cli-v3/src/commands/init.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ async function _initCommand(dir: string, options: InitCommandOptions) {
194194
log.info("Next steps:");
195195
log.info(
196196
` 1. To start developing, run ${chalk.green(
197-
`npx trigger.dev@${options.tag} dev${
198-
options.apiUrl === CLOUD_API_URL ? "" : ` -a ${options.apiUrl}`
199-
}`
197+
`npx trigger.dev@${options.tag} dev${options.profile ? "" : ` --profile ${options.profile}`}`
200198
)} in your project directory`
201199
);
202200
log.info(` 2. Visit your ${projectDashboard} to view your newly created tasks.`);

0 commit comments

Comments
 (0)