1. DBT
  2. Serve DBT docs in production

Generating docs

Before enabling DBT docs in production, we need to make sure the static files for the docs are generated.

  1. Configure the DBT super project.
    • Your DBT projects should be in the /path/to/<mage_project>/dbt directory.
      • The /dbt directory will serve as a “super-project” for all of your DBT projects in your Mage project.
    • Make sure the /.../<mage_project>/dbt directory has the files dbt_project.yml, profiles.yml, and packages.yml. These files are needed for DBT to create docs for all the projects within this directory.
      1. dbt_project.yml
        name: 'base'
        version: '1.0.0'
        config-version: 2
        profile: 'base'
        target-path: "target"
        clean-targets:
          - "target"
          - "dbt_packages"
        
      2. profiles.yml: The config in this file is not necessary, but it needs to compile.
        base:
          target: dev
          outputs:
            dev:
              <output_config>
        
      3. packages.yml: Add all projects that you want to be included in the documentation.
        packages:
          - local: ./project1
          - local: ./project2
        
  2. Generate the DBT docs
      dbt deps
      dbt docs generate
    

Terraform

GCP

In the mage-ai-terraform-templates repository, the terraform templates for GCP have commented out resources at the end of the following files for enabling the DBT docs service.

Once you uncomment those resources, you should see an output docs_service_ip at the end of terraform apply with the IP to access the DBT docs in the cloud.

Outputs:
docs_service_ip = "<dbt_docs_ip>"
service_ip = "<mage_ip>"

AWS

Coming soon…