Mitchell Bregman
06/14/2022, 1:58 AM01:13:51 Running with dbt=1.1.0
01:13:51 Partial parse save file not found. Starting full parse.
01:13:52 Found 9 models, 75 tests, 0 snapshots, 0 analyses, 196 macros, 0 operations, 0 seed files, 1 source, 0 exposures, 0 metrics
01:13:52
01:13:52 Encountered an error:
Database Error
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5439"?
Anna Geller
06/14/2022, 11:22 AMMitchell Bregman
06/14/2022, 1:35 PMdbt-redshift
and dbt-postgres
• my flow works in a venv
• i think i need to include some additional steps in my Docker image, but i think this is the culprit. do i need to install postgresql
on top of the drivers?
here is what my Dockerfile looks like
FROM prefecthq/prefect:0.15.12-python3.8 as builder
RUN apt-get update && apt-get install --no-install-recommends --no-upgrade -y \
libpq-dev \
git \
ssh \
curl -y && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip3 install --upgrade pip
RUN pip3 install --no-cache-dir -r requirements.txt
FROM prefecthq/prefect:0.15.12-python3.8
RUN apt-get update && apt-get install --no-install-recommends --no-upgrade -y \
libpq-dev && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
# For DBT pip install, we need psycopg2 not the binary.
# See: <https://github.com/dbt-labs/dbt-core/blob/a2e040f389e64cc78a8e2d262c3ab2802b56044b/plugins/postgres/setup.py#L22>
RUN DBT_PSYCOPG2_NAME=psycopg2 pip3 install dbt-redshift --no-cache-dir --no-binary dbt-postgres
ENV PYTHONPATH="$PYTHONPATH:src/"
WORKDIR /app
COPY src src
COPY creds.yaml .
COPY job_template.yaml .
COPY VERSION .
Matthias
06/14/2022, 6:20 PMprofiles.yaml