-
Notifications
You must be signed in to change notification settings - Fork 978
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What are you changing in this pull request and why? Docs for beta launch of Trigger on merge: - new **Merge jobs** page - update [Deployments landing](https://docs.getdbt.com/docs/deploy/deployments) page - update [Jobs landing](https://docs.getdbt.com/docs/deploy/jobs) page - new section **Treatment of merge jobs** on [Job scheduler](https://docs.getdbt.com/docs/deploy/job-scheduler) page - On [CI jobs](https://docs.getdbt.com/docs/deploy/ci-jobs) page: updated UI labels to match sentence casing; refactored old examples section a bit since the page is getting long - new release note ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] For [docs versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning), review how to [version a whole page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version) and [version a block of content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content). - [x] Needs PM review Adding or removing sections: - [x] Update link URLs if needed -- checked, not needed, not referenced elsewhere - [x] Add an entry for deleted sections in `website/vercel.json` if possible -- checked, not needed, not referenced elsewhere - [x] Run link testing locally with `npm run build` to update the links that point to deleted pages - [x] Check if screenshot files need to be deleted -- removed when screenshot is not referenced elsewhere
- Loading branch information
Showing
10 changed files
with
97 additions
and
41 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
website/docs/docs/dbt-versions/release-notes/70-Apr-2024/merge-jobs.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: "New: Merge jobs" | ||
description: "April 2024: Native support now available in dbt Cloud to trigger dbt job runs when Git pull requests merge." | ||
sidebar_label: "New: Merge jobs" | ||
sidebar_position: 07 | ||
tags: [Apr-2024] | ||
date: 2024-04-17 | ||
--- | ||
|
||
# New: Merge jobs <Lifecycle status="beta" /> | ||
|
||
You can now set up a continuous deployment (CD) workflow for your projects natively in dbt Cloud. You can now access a beta release of [Merge jobs](/docs/deploy/merge-jobs), which is a new [job type](/docs/deploy/jobs), that enables you to trigger dbt job runs as soon as changes (via Git pull requests) merge into production. | ||
|
||
<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/example-create-merge-job.png" width="90%" title="Example of creating a merge job"/> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
--- | ||
title: "Jobs in dbt Cloud" | ||
sidebar_label: "About Jobs" | ||
description: "Learn about deploy jobs and continuous integration (CI) jobs in dbt Cloud and what their differences are." | ||
description: "Learn about the different job types in dbt Cloud and what their differences are." | ||
tags: [scheduler] | ||
pagination_next: "docs/deploy/deploy-jobs" | ||
--- | ||
|
||
In dbt Cloud, there are two types of jobs: | ||
These are the available job types in dbt Cloud: | ||
- [Deploy jobs](/docs/deploy/deploy-jobs) — To create and set up triggers for building production data assets | ||
- [Continuous integration (CI) jobs](/docs/deploy/continuous-integration) — To create and set up triggers for checking code changes | ||
- [Merge jobs](/docs/deploy/merge-jobs) — To create and set up triggers for merged pull requests | ||
|
||
Below is a comparison table that describes how deploy jobs and CI jobs behave: | ||
Below is a comparison table that describes the behaviors of the different job types: | ||
|
||
| | Deploy Jobs | CI Jobs | | ||
| --- | --- | --- | | ||
| Purpose | Builds production data assets. | Builds and tests new code before merging changes into production. | | ||
| Trigger types | Triggered by a schedule or by API. | Triggered by a commit to a PR or by API. | | ||
| Destination | Builds into a production database and schema. | Builds into a staging database and ephemeral schema, lived for the lifetime of the PR. | | ||
| Execution mode | Runs execute sequentially, so as to not have collisions on the underlying DAG. | Runs execute in parallel to promote team velocity. | | ||
| Efficiency run savings | Detects over-scheduled jobs and cancels unnecessary runs to avoid queue clog. | Cancels existing runs when a newer commit is pushed to avoid redundant work. | | ||
| State comparison | Only sometimes needs to detect state. | Almost always needs to compare state against the production environment to build on modified code and its dependents. | | ||
| Job run duration | Limit is 24 hours. | Limit is 24 hours. | | ||
| | **Deploy jobs** | **CI jobs** | **Merge jobs** | | ||
| --- | --- | --- | --- | | ||
| Purpose | Builds production data assets. | Builds and tests new code before merging changes into production. | Build merged changes into production. | | ||
| Trigger types | Triggered by a schedule or by API. | Triggered by a commit to a PR or by API. | Triggered by a merge request or by API. | | ||
| Destination | Builds into a production database and schema. | Builds into a staging database and ephemeral schema, lived for the lifetime of the PR. | Builds into a production database and schema. | | ||
| Execution mode | Runs execute sequentially, so as to not have collisions on the underlying DAG. | Runs execute in parallel to promote team velocity. | Runs execute sequentially, so as to not have collisions on the underlying DAG. | | ||
| Efficiency run savings | Detects over-scheduled jobs and cancels unnecessary runs to avoid queue clog. | Cancels existing runs when a newer commit is pushed to avoid redundant work. | N/A | | ||
| State comparison | Only sometimes needs to detect state. | Almost always needs to compare state against the production environment to build on modified code and its dependents. | Does not need to detect state. | | ||
| Job run duration | Limit is 24 hours. | Limit is 24 hours. | Limit is 24 hours. | |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: "Merge jobs in dbt Cloud" | ||
sidebar_label: "Merge jobs" | ||
description: "Learn how to trigger a dbt job run when a Git pull request merges." | ||
--- | ||
|
||
# Merge jobs in dbt Cloud <Lifecycle status="beta" /> | ||
|
||
You can set up a merge job to implement a continuous development (CD) workflow in dbt Cloud. The merge job triggers a dbt job to run when someone merges Git pull requests into production. This creates a seamless development experience where changes made in code will automatically update production data. | ||
|
||
By using CD in dbt Cloud, you can take advantage of deferral to build only the edited model and any downstream changes. With merge jobs, state will be updated almost instantly, always giving the most up-to-date state information in [dbt Explorer](/docs/collaborate/explore-projects). | ||
|
||
## Prerequisites | ||
- You have a dbt Cloud account. | ||
- You have access to the beta release for this functionality. | ||
|
||
## Set up job trigger on Git merge {#set-up-merge-jobs} | ||
|
||
1. On your deployment environment page, click **Create Job** > **Merge Job**. | ||
1. Options in the **Job settings** section: | ||
- **Job name** — Specify the name for the merge job. | ||
- **Description** — Provide a descripion about the job. | ||
- **Environment** — By default, it’s set to the environment you created the job from. | ||
1. In the **Git trigger** section, the **Run on merge** option is enabled by default. Every time a PR merges (to the main branch) in your Git repo, this job will get triggered to run. | ||
1. Options in the **Execution settings** section: | ||
- **Commands** — By default, it includes the `dbt build --select state:modified+` command. This informs dbt Cloud to build only new or changed models and their downstream dependents. Importantly, state comparison can only happen when there is a deferred environment selected to compare state to. Click **Add command** to add more [commands](/docs/deploy/job-commands) that you want to be invoked when this job runs. | ||
- **Compare changes against an environment (Deferral)** — By default, it's set to the environment you created the job from. This option allows dbt Cloud to check the state of the code in the PR against the code running in the deferred environment, so as to only check the modified code, instead of building the full table or the entire DAG. | ||
1. (optional) Options in the **Advanced settings** section: | ||
- **Environment variables** — Define [environment variables](/docs/build/environment-variables) to customize the behavior of your project when this job runs. | ||
- **Target name** — Define the [target name](/docs/build/custom-target-names). Similar to **Environment Variables**, this option lets you customize the behavior of the project. | ||
- **Run timeout** — Cancel this job if the run time exceeds the timeout value. | ||
- **dbt version** — By default, it’s set to inherit the [dbt version](/docs/dbt-versions/core) from the environment. dbt Labs strongly recommends that you don't change the default setting. This option to change the version at the job level is useful only when you upgrade a project to the next dbt version; otherwise, mismatched versions between the environment and job can lead to confusing behavior. | ||
- **Threads** — By default, it’s set to 4 [threads](/docs/core/connect-data-platform/connection-profiles#understanding-threads). Increase the thread count to increase model execution concurrency. | ||
- **Run source freshness** — Enable this option to invoke the `dbt source freshness` command before running this job. Refer to [Source freshness](/docs/deploy/source-freshness) for more details. | ||
|
||
## Example | ||
|
||
<Lightbox src="/img/docs/dbt-cloud/using-dbt-cloud/example-create-merge-job.png" width="90%" title="Example of creating a merge job"/> |
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
Binary file removed
BIN
-156 KB
website/static/img/docs/dbt-cloud/using-dbt-cloud/Enabling-CI/ADO CI Check.png
Binary file not shown.
Binary file removed
BIN
-96.7 KB
website/static/img/docs/dbt-cloud/using-dbt-cloud/GitLab-Pipeline.png
Binary file not shown.
Binary file added
BIN
+122 KB
website/static/img/docs/dbt-cloud/using-dbt-cloud/example-create-merge-job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.