rohith_desikan
06/29/2021, 10:27 PMmeltano install
which is connecting to our a Postgres backend like it’s supposed to. But when it tries to install the 3 plug ins inside the container, we get this error:
I was wondering if anyone knows why this happens. It works perfectly outside the container inside a virtualenv but not inside. I have only just started using Meltano, so please let me know if you need more information
Installing 3 plugins...
Installing loader 'target-mysql'...
Loader 'target-mysql' could not be installed: could not create of the virtualenv for 'loaders/target-mysql'
Installing loader 'target-postgres'...
Loader 'target-postgres' could not be installed: could not create of the virtualenv for 'loaders/target-postgres'
Installing extractor 'tap-s3-csv'...
Extractor 'tap-s3-csv' could not be installed: could not create of the virtualenv for 'extractors/tap-s3-csv'
Installed 0/3 plugins
Failed to install plugin(s)
douwe_maan
06/29/2021, 10:29 PMmeltano --version
rohith_desikan
06/29/2021, 10:33 PMdouwe_maan
06/29/2021, 10:35 PMdouwe_maan
06/29/2021, 10:36 PMrohith_desikan
06/29/2021, 10:37 PMrohith_desikan
06/29/2021, 10:39 PMMELTANO_DATABASE_URI
, when I try meltano install
inside the container, I get this:
Installing 3 plugins...
Installing loader 'target-mysql'...
Installing loader 'target-postgres'...
Installing extractor 'tap-s3-csv'...
'coroutine' object has no attribute 'read'
douwe_maan
06/29/2021, 10:41 PMdouwe_maan
06/29/2021, 10:42 PMrohith_desikan
06/29/2021, 10:43 PMdouwe_maan
06/29/2021, 10:43 PMdouwe_maan
06/29/2021, 10:43 PMmeltano/meltano
, or installing Python and Meltano some other way?rohith_desikan
06/29/2021, 10:52 PMFROM ubuntu:20.04
ENV TZ=America
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install required Ubuntu packages
# Install sudo
RUN apt-get update && \
apt-get -y install sudo \
tzdata
# Install python packages
RUN apt-get update && \
apt-get install -y -q \
curl \
gcc \
gnupg \
jq \
libpq-dev \
netcat \
python3 \
python3-distutils \
python3-pip \
vim
RUN sudo apt-get install -y -q \
postgresql \
postgresql-contrib
RUN echo en_US.UTF-8 UTF-8 > /etc/locale.gen
RUN locale-gen en_US.UTF-8
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Symlink python to python3
RUN ln -s /usr/bin/python3 /usr/bin/python
# We copy just the requirements.txt first to leverage Docker cache
COPY requirements.txt /opt/wg/requirements.txt
# Install pip
RUN curl <https://bootstrap.pypa.io/get-pip.py> -o /tmp/get-pip.py && \
python /tmp/get-pip.py && \
pip3 install --upgrade pip && \
pip3 install -r /opt/wg/requirements.txt
RUN rm -f /tmp/get-pip.py
# Set the working directory
WORKDIR /opt/wg
meltano==1.72.0 lives in the requirements.txt
file.
The rest of the Dockerfile looks like below. We have a local Postgres container running, for which I export a MELTANO_DATABASE_URI environment var and the I can see the meltano migrations working as they should.
FROM <ECR_PRIVATE_REPO>
RUN apt-get update && \
apt-get install -y -q \
git
# Set up uvicorn service (FastAPI)
ENV USER=uvicorn
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/home/${USER}" \
--shell "/bin/bash" \
--uid "${UID}" \
"${USER}"
# FOLDER SETUP FOR EXAMPLE (This just copies repo files/folders into the container)
RUN mkdir -p /opt/wg/bin
ADD bin /opt/wg/bin
WORKDIR /opt/wg
douwe_maan
06/29/2021, 10:53 PMrohith_desikan
06/29/2021, 10:56 PMdouwe_maan
06/29/2021, 10:58 PMdouwe_maan
06/29/2021, 10:58 PMpython -m venv <path>
faileddouwe_maan
06/29/2021, 10:59 PMpath
here would be something like .meltano/loaders/target-postgres/venv
. Can you try running that directly and seeing if you get an error?rohith_desikan
06/29/2021, 11:07 PMdouwe_maan
06/29/2021, 11:07 PMpython -m venv .meltano/loaders/target-postgres/venv
directly in the container, instead of going through meltano install
?rohith_desikan
06/29/2021, 11:09 PMThe virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
douwe_maan
06/29/2021, 11:09 PMrohith_desikan
06/29/2021, 11:15 PMInstalling 3 plugins...
Installing loader 'target-mysql'...
Installed loader 'target-mysql'
Installing loader 'target-postgres'...
Installed loader 'target-postgres'
Installing extractor 'tap-s3-csv'...
Installed extractor 'tap-s3-csv'
Installed 3/3 plugins
rohith_desikan
06/29/2021, 11:16 PMdouwe_maan
06/29/2021, 11:16 PMrohith_desikan
06/30/2021, 1:07 AMapt-get install python3-venv
command, meltano version 1.77.0 installs all the plug ins. I no longer get that coroutine error.douwe_maan
06/30/2021, 1:37 PMdouwe_maan
06/30/2021, 1:37 PMrohith_desikan
06/30/2021, 4:01 PMrohith_desikan
07/01/2021, 6:33 PMdouwe_maan
07/01/2021, 6:38 PM