mwhitaker / dbt-action

Run and schedule dbt commands using Github Actions
MIT License
66 stars 43 forks source link

dbt version upgrade #53

Open jcvegan opened 1 year ago

jcvegan commented 1 year ago

Hi, is there a plan to upgrade the dbt cli to version 1.5.0?

acjay commented 1 year ago

Alternatively, might it be possible to take the desired version number as a parameter?

jcvegan commented 1 year ago

Yes! That would be even better

mwhitaker commented 1 year ago

Hi folks,

Upgrading to a new version of dbt is a manual process for me. Unfortunately, dbt doesn't release a Docker image that could be used directly, so I am building it myself and host it on Dockerhub. Once the dbt image is built I can use it in the Github Action Dockerfile. Not sure if there is a sensible way to automate this.

Anyway, I'll get the latest version updated the v1.5 shortly.

Thanks for the comments and suggestions!

mwhitaker commented 1 year ago

Would you mind testing the v1.5 before I merge that to main?

jobs:
  action:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: dbt-run
        uses: mwhitaker/dbt-action@v1.5
        with:
          dbt_command: "dbt run --profiles-dir ."
          dbt_project_folder: "dbt_project"
leo-schick commented 9 months ago

@mwhitaker when do you plan to upgrade to dbt core 1.7.3 / 1.6.9?

mwhitaker commented 9 months ago

60

working on this now

mroy-seedbox commented 3 months ago

Version 1.7.15 would be awesome, as it moves the profile configs to project flags instead.

Right now the action crashes when project flags are present. 😞

16:16:24  Running with dbt=1.7.3
16:16:25  Encountered an error:
Runtime Error
  at path []: Additional properties are not allowed ('flags' was unexpected)
dylanvanw commented 3 months ago

Not sure if this would satisfy your requirements but a way to automate the dbt version upgrade can be by using the docker image provided by dbt-labs: docker pull ghcr.io/dbt-labs/:

This is how I use it in my own Dockerfiles as example:

FROM --platform=linux/amd64 ghcr.io/dbt-labs/dbt-bigquery:1.8.1
mwhitaker commented 3 months ago

Thank you for these suggestions. I’ll check it out to see if I can make the version upgrade smoother. It’s always possible that things have changed, but I have for some reason I always had to build the whole image with all connectors manually.

On Tue, Jun 18, 2024 at 13:35 Dylan @.***> wrote:

Not sure if this would satisfy your requirements but a way to automate the dbt version upgrade can be by using the docker image provided by dbt-labs: docker pull ghcr.io/dbt-labs/: https://docs.getdbt.com/docs/core/docker-install

This is how I use it in my own Dockerfiles:

FROM --platform=linux/amd64 ghcr.io/dbt-labs/dbt-bigquery:1.8.1

— Reply to this email directly, view it on GitHub https://github.com/mwhitaker/dbt-action/issues/53#issuecomment-2175995336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6LXTYNUDM4JKAA5AQBUH3ZIASSJAVCNFSM6AAAAAAZN3ERXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZVHE4TKMZTGY . You are receiving this because you were mentioned.Message ID: @.***>

bzillins commented 2 months ago

@mwhitaker I recently hacked a 1.8.3 action together in order to utilize the recently released dbt unit test functionality and it went very smoothly after your changes from PR 60

A quick search didn't show any docker images with "all" of the connectors present like yours so I took the same path of building an image.

Thank you for putting this together and sorry for hacking up your Dockerfile so badly!

mroy-seedbox commented 1 month ago

Workaround: we replaced this action with a local action instead (see documentation here).

First, we had to create the custom action in .github/actions/dbt-action/action.yml. We copied the action in this repo, and replaced the runs config with this (see documentation here):

runs:
  using: "docker"
  image: "ghcr.io/dbt-labs/dbt-snowflake:1.7.5"
  entrypoint: ./.github/actions/dbt-action/entrypoint.sh
  args:
    - ${{ inputs.dbt_command }}

And we also copied entrypoint.sh into .github/actions/dbt-action/entrypoint.sh (as seen above).

Then we just had to replace uses: mwhitaker/dbt-action@master with uses: ./.github/actions/dbt-action.

Bonus: it also performs a lot faster since it doesn't need to build the container from scratch (from the Dockerfile).

mroy-seedbox commented 1 month ago

@mwhitaker: I think it might be possible for your action to take the Docker image as a parameter, which would greatly simplify things for everyone.

Something like image: "${{ inputs.docker_image }}".

albertotb commented 1 month ago

Same here. It would be very helpful to be able to upgrade to dbt>1.8