Skip to content

Container image providing Data Build Tools (dbt) with dbt-oracle and Oracle Instant Client (thick mode) pre-installed.

License

Notifications You must be signed in to change notification settings

it-at-m/dbt-oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Stargazers Issues MIT License GitHub Workflow Status

Container image providing Data Build Tools (dbt) with dbt-oracle and Oracle Instant Client (thick mode) pre-installed.

dbt-oracle

This repository is for building and distributing a dbt image for working with Oracle databases.

The image is based on the original dbt-core image with a post-installed dbt-oracle adapter.

The image is also enhanced with the official Oracle Instant Client to allow dbt-oracle to be used in Oracle thick mode.

Thick installation of dbt-oracle

dbt-oracle uses the Python Oracle Driver when connecting to an Oracle database.

The Python Oracle driver can be run in a thin and a thick variant (see).

The thick variant provides extended Oracle features. Among other things, only the thick variant allows the use of Oracle native encryption.

This variant is enforced by setting the needed environment variable:

export ORA_PYTHON_DRIVER_TYPE=thick

How to use the image

The image is originally designed to be used as a container image in a CI/CD pipeline that wants to run a DBT project against an Oracle database.

GitHub actions

run-dbt:
    runs-on: ubuntu-latest
    container:
      image: docker.io/itatm/dbt-oracle:latest
    
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Run project
        run: cd src/test/dbt_test && dbt debug --profiles-dir=.

GitLab CI/CD

run-dbt:
  stage: dbt
  image: docker.io/itatm/dbt-oracle:latest
  script:
    - 'cd src/test/dbt_test && dbt debug --profiles-dir=.'

Example with profiles.yml as GitLab-CICD-File-Variable

run-dbt:
  stage: dbt
  image: docker.io/itatm/dbt-oracle:latest
  script:
    - 'export DBT_PROFILES_FOLDER=$(dirname $DBT_PROFILES_YML)'
    - 'mv $DBT_PROFILES_YML $DBT_PROFILES_FOLDER/profiles.yml'
    - 'cd src/test/dbt_test && dbt debug --profiles-dir=$DBT_PROFILES_FOLDER'

Version management

The image is always based on the latest dbt-core image from dbt-labs available at build time.

Specific version tags of this image represent a specific dbt-oracle version that is pinned to this image. For example, version 1.3.1 of this image will be built with version 1.3.1 of dbt-oracle. The required dependencies (i.e. dbt-core, oracledb...) are managed by pip and depend on the dbt-oracle version used.

The Oracle Instant Client version is always the latest version available at build time of the image.

There is a nightly build that always uses the latest version of dbt-oracle and Oracle Instant Client available.

Before being released to GHCR and DockerHub, all images are tested against an oraclexe database using a simple dbt debug.

About

Container image providing Data Build Tools (dbt) with dbt-oracle and Oracle Instant Client (thick mode) pre-installed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages