Madison Schott
08/12/2021, 10:02 PMNoah Holm
08/13/2021, 12:55 PMMadison Schott
08/13/2021, 1:32 PMMadison Schott
08/13/2021, 1:33 PMNoah Holm
08/13/2021, 1:41 PMMadison Schott
08/13/2021, 1:54 PM# specify a base image
FROM prefecthq/prefect:latest
WORKDIR dbt_snowflake/
COPY . .
# install all dependencies
RUN pip install -U pip
RUN pip install dbt==0.17.2
Madison Schott
08/13/2021, 1:54 PMMadison Schott
08/13/2021, 1:55 PMSTORAGE = Docker(registry_url='xx',
image_name='prefect-flows',
dockerfile='/Users/madisonschott/dbt_snowflake/DockerFile')
Madison Schott
08/13/2021, 1:55 PMMadison Schott
08/13/2021, 1:56 PMuser_profile_dbt_run = dbt_task(helper_script = "cd /Users/madisonschott/dbt_snowflake",
command='dbt run')
Noah Holm
08/13/2021, 2:09 PMdbt_snowflake
the path that you cd into shouldn’t have your local mac’s path. I think you should "cd dbt_snowflake"
You could check locally where your dbt project is within the image with docker run --rm -it <imagename> sh
, that way you should see where you need to cdNoah Holm
08/13/2021, 2:12 PMDBT_REPO_PATH = "/tmp/dbt"
dbt = DbtShellTask(
helper_script=f"cd {DBT_REPO_PATH}",
log_stderr=True,
log_stdout=True,
profiles_dir=DBT_REPO_PATH,
stream_output=True,
checkpoint=False,
)
Then I run it in the flow with dbt(command="dbt run")
Madison Schott
08/13/2021, 2:20 PMdbt_kwargs
do I even need to specify the profiles_dir?Madison Schott
08/13/2021, 2:20 PMNoah Holm
08/13/2021, 2:22 PMNoah Holm
08/13/2021, 2:24 PMJ. Martins
08/13/2021, 2:28 PMMadison Schott
08/13/2021, 2:49 PMfatal: Not a dbt project (or any of the parent directories). Missing dbt_project.yml file
Madison Schott
08/13/2021, 2:50 PMMadison Schott
08/13/2021, 3:06 PMJ. Martins
08/13/2021, 3:06 PMMadison Schott
08/13/2021, 3:07 PMMadison Schott
08/13/2021, 3:07 PMMadison Schott
08/13/2021, 3:09 PMEncountered an error while reading the project:
ERROR: Runtime Error
Could not find profile named 'winc_dev'
J. Martins
08/13/2021, 3:09 PMMadison Schott
08/13/2021, 3:09 PMJ. Martins
08/13/2021, 3:10 PMJ. Martins
08/13/2021, 3:15 PMMadison Schott
08/13/2021, 3:16 PM