Skip to content

Commit

Permalink
update to dbt v1.5 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhitaker authored Jun 28, 2023
1 parent 6c07593 commit 4d14223
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
74 changes: 36 additions & 38 deletions Docker_build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
ARG build_for=linux/amd64

##
# base image (abstract)
# base image (abstract). Note that 3.11 does not build
##
FROM --platform=$build_for python:3.9.9-slim-bullseye as base

# N.B. The refs updated automagically every release via bumpversion
# N.B. dbt-postgres is currently found in the core codebase so a value of dbt-core@<some_version> is correct

ARG dbt_core_ref=dbt-core@v1.4.6
ARG dbt_postgres_ref=dbt-core@v1.4.6
ARG dbt_redshift_ref=dbt-redshift@v1.4.0
ARG dbt_bigquery_ref=dbt-bigquery@v1.4.3
ARG dbt_snowflake_ref=dbt-snowflake@v1.4.2
ARG dbt_spark_ref=dbt-spark@v1.4.1
ARG dbt_core_ref=dbt-core@v1.5.0
ARG dbt_postgres_ref=dbt-core@v1.5.0
ARG dbt_redshift_ref=dbt-redshift@v1.5.0
ARG dbt_bigquery_ref=dbt-bigquery@v1.5.0
ARG dbt_snowflake_ref=dbt-snowflake@v1.5.0
ARG dbt_spark_ref=dbt-spark@v1.5.0
# special case args
ARG dbt_spark_version=all
ARG dbt_third_party
Expand All @@ -28,18 +28,18 @@ ARG dbt_third_party
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
git \
ssh-client \
software-properties-common \
make \
build-essential \
ca-certificates \
libpq-dev \
git \
ssh-client \
software-properties-common \
make \
build-essential \
ca-certificates \
libpq-dev \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*

# Env vars
ENV PYTHONIOENCODING=utf-8
Expand Down Expand Up @@ -93,16 +93,15 @@ FROM base as dbt-spark
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
python-dev \
libsasl2-dev \
libsasl2-modules \
gcc \
unixodbc-dev \
python-dev \
libsasl2-dev \
gcc \
unixodbc-dev \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
RUN python -m pip install --no-cache-dir "git+https://github.com/dbt-labs/${dbt_spark_ref}#egg=dbt-spark[${dbt_spark_version}]"


Expand All @@ -119,18 +118,17 @@ FROM base as dbt-all
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y --no-install-recommends \
python-dev \
libsasl2-dev \
libsasl2-modules \
gcc \
unixodbc-dev \
python-dev \
libsasl2-dev \
gcc \
unixodbc-dev \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_redshift_ref}#egg=dbt-redshift"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_bigquery_ref}#egg=dbt-bigquery"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_snowflake_ref}#egg=dbt-snowflake"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_spark_ref}#egg=dbt-spark[${dbt_spark_version}]"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_postgres_ref}#egg=dbt-postgres&subdirectory=plugins/postgres"
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_redshift_ref}#egg=dbt-redshift"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_bigquery_ref}#egg=dbt-bigquery"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_snowflake_ref}#egg=dbt-snowflake"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_spark_ref}#egg=dbt-spark[${dbt_spark_version}]"
RUN python -m pip install --no-cache "git+https://github.com/dbt-labs/${dbt_postgres_ref}#egg=dbt-postgres&subdirectory=plugins/postgres"
6 changes: 4 additions & 2 deletions Docker_build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

update the references in the Dockerfile to current ones.

`docker build --tag mwhitaker/dbt_all:v1.4.6 --target dbt-all .`
using the dbt [Dockerfile](https://github.com/dbt-labs/dbt-core/blob/main/docker/Dockerfile) as a template.

`docker push mwhitaker/dbt_all:v1.4.6`
`docker build --tag mwhitaker/dbt_all:v1.5.0 --target dbt-all .`

`docker push mwhitaker/dbt_all:v1.5.0`
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG DBT_VERSION=v1.4.6
ARG DBT_VERSION=v1.5.0
FROM mwhitaker/dbt_all:${DBT_VERSION}

COPY entrypoint.sh /entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
A GitHub Action to run [dbt](https://www.getdbt.com) commands in a Docker container. It uses the official images provided by [Fishtown Analytics](https://hub.docker.com/r/fishtownanalytics/dbt/tags). You can use [dbt commands](https://docs.getdbt.com/reference/dbt-commands) such as `run`, `test` and `debug`. This action captures the dbt console output for use in subsequent steps.

### dbt version
The current version of dbt is **1.4.6**. Please note that from dbt v1.0.0. you may have to change your dbt project structure compared to v0.x.x. See the [migration](https://docs.getdbt.com/docs/guides/migration-guide/upgrading-to-1-0-0) docs.
The current version of dbt is **1.5.0**. Please note that from dbt v1.0.0. you may have to change your dbt project structure compared to v0.x.x. See the [migration](https://docs.getdbt.com/docs/guides/migration-guide/upgrading-to-1-0-0) docs.

dbt updates their [docker images](https://hub.docker.com/r/fishtownanalytics/dbt/tags?page=1&ordering=last_updated) on a frequent basis and the main branch of this Github Action should be close to the last stable tag. If you need to use an earlier version of dbt, you can call this action with a specific [release](https://github.com/mwhitaker/dbt-action/releases), eg `mwhitaker/[email protected]` or `mwhitaker/dbt-action@v0.19.1`.
dbt updates their [docker images](https://hub.docker.com/r/fishtownanalytics/dbt/tags?page=1&ordering=last_updated) on a frequent basis and the main branch of this Github Action should be close to the last stable tag. If you need to use an earlier version of dbt, you can call this action with a specific [release](https://github.com/mwhitaker/dbt-action/releases), eg `mwhitaker/[email protected]` or `mwhitaker/dbt-action@v1.5.0`.

## Usage

Expand Down

0 comments on commit 4d14223

Please sign in to comment.