From d4d25892616acae627425037dd70995494a05d3c Mon Sep 17 00:00:00 2001 From: Jean-Didier Date: Tue, 14 Dec 2021 21:43:04 +0200 Subject: [PATCH 1/2] removing influxdb from persistents storage --- .../database/Dockerfile | 51 ++------------- .../database/Dockerfile.original | 65 +++++++++++++++++++ .../database/Dockerfile_without_influxdb | 24 ------- 3 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 morphemic-persistent-storage/database/Dockerfile.original delete mode 100644 morphemic-persistent-storage/database/Dockerfile_without_influxdb diff --git a/morphemic-persistent-storage/database/Dockerfile b/morphemic-persistent-storage/database/Dockerfile index 5fd5001e..cd945963 100644 --- a/morphemic-persistent-storage/database/Dockerfile +++ b/morphemic-persistent-storage/database/Dockerfile @@ -7,47 +7,6 @@ FROM python:3.7-slim as api-loader COPY inputapi/requirements.txt . RUN pip install --user -r requirements.txt -# --- Stage 2: Combined InfluxDB + Python API Image -FROM python:3.7-alpine3.12 - -# :: InfluxDB standard setup -RUN echo 'hosts: files dns' >> /etc/nsswitch.conf -RUN apk add --no-cache tzdata bash ca-certificates && \ - update-ca-certificates - -ENV INFLUXDB_VERSION 1.8.4 -RUN set -ex && \ - mkdir ~/.gnupg; \ - echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \ - apk add --no-cache --virtual .build-deps wget gnupg tar && \ - for key in \ - 05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \ - do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ - gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ - gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \ - done && \ - wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz.asc && \ - wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ - gpg --batch --verify influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz.asc influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ - mkdir -p /usr/src && \ - tar -C /usr/src -xzf influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ - rm -f /usr/src/influxdb-*/influxdb.conf && \ - chmod +x /usr/src/influxdb-*/* && \ - cp -a /usr/src/influxdb-*/* /usr/bin/ && \ - gpgconf --kill all && \ - rm -rf *.tar.gz* /usr/src /root/.gnupg && \ - apk del .build-deps -COPY influxdb.conf /etc/influxdb/influxdb.conf - -EXPOSE 8086 - -VOLUME /var/lib/influxdb - -COPY entrypoint.sh /entrypoint.sh -COPY init-influxdb.sh /init-influxdb.sh - - # :: Python API setup # Copy compiled dependencies from # the standard user pip directory @@ -56,10 +15,10 @@ COPY --from=api-loader /root/.local /root/.local ENV PATH=/root/.local:$PATH # Copy Python API. -RUN mkdir inputapi -RUN mkdir -p inputapi/log -COPY ./inputapi/src ./inputapi/ +RUN mkdir /app +RUN mkdir -p /app/log +COPY ./inputapi/src /app/ +WORKDIR /app # Execute both in entrypoint.sh. -ENTRYPOINT ["/entrypoint.sh"] -CMD ["influxd"] +CMD ["python","-u","app.py"] diff --git a/morphemic-persistent-storage/database/Dockerfile.original b/morphemic-persistent-storage/database/Dockerfile.original new file mode 100644 index 00000000..5fd5001e --- /dev/null +++ b/morphemic-persistent-storage/database/Dockerfile.original @@ -0,0 +1,65 @@ +# --- Stage 1: API Dependency Loader + +# :: Initial dependency loading image. +FROM python:3.7-slim as api-loader + +# Get package dependencies. +COPY inputapi/requirements.txt . +RUN pip install --user -r requirements.txt + +# --- Stage 2: Combined InfluxDB + Python API Image +FROM python:3.7-alpine3.12 + +# :: InfluxDB standard setup +RUN echo 'hosts: files dns' >> /etc/nsswitch.conf +RUN apk add --no-cache tzdata bash ca-certificates && \ + update-ca-certificates + +ENV INFLUXDB_VERSION 1.8.4 +RUN set -ex && \ + mkdir ~/.gnupg; \ + echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \ + apk add --no-cache --virtual .build-deps wget gnupg tar && \ + for key in \ + 05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \ + do \ + gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ + gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ + gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \ + done && \ + wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz.asc && \ + wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ + gpg --batch --verify influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz.asc influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ + mkdir -p /usr/src && \ + tar -C /usr/src -xzf influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ + rm -f /usr/src/influxdb-*/influxdb.conf && \ + chmod +x /usr/src/influxdb-*/* && \ + cp -a /usr/src/influxdb-*/* /usr/bin/ && \ + gpgconf --kill all && \ + rm -rf *.tar.gz* /usr/src /root/.gnupg && \ + apk del .build-deps +COPY influxdb.conf /etc/influxdb/influxdb.conf + +EXPOSE 8086 + +VOLUME /var/lib/influxdb + +COPY entrypoint.sh /entrypoint.sh +COPY init-influxdb.sh /init-influxdb.sh + + +# :: Python API setup +# Copy compiled dependencies from +# the standard user pip directory +# and update PATH. +COPY --from=api-loader /root/.local /root/.local +ENV PATH=/root/.local:$PATH + +# Copy Python API. +RUN mkdir inputapi +RUN mkdir -p inputapi/log +COPY ./inputapi/src ./inputapi/ + +# Execute both in entrypoint.sh. +ENTRYPOINT ["/entrypoint.sh"] +CMD ["influxd"] diff --git a/morphemic-persistent-storage/database/Dockerfile_without_influxdb b/morphemic-persistent-storage/database/Dockerfile_without_influxdb deleted file mode 100644 index cd945963..00000000 --- a/morphemic-persistent-storage/database/Dockerfile_without_influxdb +++ /dev/null @@ -1,24 +0,0 @@ -# --- Stage 1: API Dependency Loader - -# :: Initial dependency loading image. -FROM python:3.7-slim as api-loader - -# Get package dependencies. -COPY inputapi/requirements.txt . -RUN pip install --user -r requirements.txt - -# :: Python API setup -# Copy compiled dependencies from -# the standard user pip directory -# and update PATH. -COPY --from=api-loader /root/.local /root/.local -ENV PATH=/root/.local:$PATH - -# Copy Python API. -RUN mkdir /app -RUN mkdir -p /app/log -COPY ./inputapi/src /app/ - -WORKDIR /app -# Execute both in entrypoint.sh. -CMD ["python","-u","app.py"] -- GitLab From 53edc34dbe9b3c6fb6cc85b5382572f58e94fd36 Mon Sep 17 00:00:00 2001 From: Jean-Didier Date: Wed, 22 Dec 2021 10:59:53 +0200 Subject: [PATCH 2/2] deletion of the influxdb --- .../database/Dockerfile.original | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 morphemic-persistent-storage/database/Dockerfile.original diff --git a/morphemic-persistent-storage/database/Dockerfile.original b/morphemic-persistent-storage/database/Dockerfile.original deleted file mode 100644 index 5fd5001e..00000000 --- a/morphemic-persistent-storage/database/Dockerfile.original +++ /dev/null @@ -1,65 +0,0 @@ -# --- Stage 1: API Dependency Loader - -# :: Initial dependency loading image. -FROM python:3.7-slim as api-loader - -# Get package dependencies. -COPY inputapi/requirements.txt . -RUN pip install --user -r requirements.txt - -# --- Stage 2: Combined InfluxDB + Python API Image -FROM python:3.7-alpine3.12 - -# :: InfluxDB standard setup -RUN echo 'hosts: files dns' >> /etc/nsswitch.conf -RUN apk add --no-cache tzdata bash ca-certificates && \ - update-ca-certificates - -ENV INFLUXDB_VERSION 1.8.4 -RUN set -ex && \ - mkdir ~/.gnupg; \ - echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf; \ - apk add --no-cache --virtual .build-deps wget gnupg tar && \ - for key in \ - 05CE15085FC09D18E99EFB22684A14CF2582E0C5 ; \ - do \ - gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \ - gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ - gpg --keyserver keyserver.pgp.com --recv-keys "$key" ; \ - done && \ - wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz.asc && \ - wget --no-verbose https://dl.influxdata.com/influxdb/releases/influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ - gpg --batch --verify influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz.asc influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ - mkdir -p /usr/src && \ - tar -C /usr/src -xzf influxdb-${INFLUXDB_VERSION}-static_linux_amd64.tar.gz && \ - rm -f /usr/src/influxdb-*/influxdb.conf && \ - chmod +x /usr/src/influxdb-*/* && \ - cp -a /usr/src/influxdb-*/* /usr/bin/ && \ - gpgconf --kill all && \ - rm -rf *.tar.gz* /usr/src /root/.gnupg && \ - apk del .build-deps -COPY influxdb.conf /etc/influxdb/influxdb.conf - -EXPOSE 8086 - -VOLUME /var/lib/influxdb - -COPY entrypoint.sh /entrypoint.sh -COPY init-influxdb.sh /init-influxdb.sh - - -# :: Python API setup -# Copy compiled dependencies from -# the standard user pip directory -# and update PATH. -COPY --from=api-loader /root/.local /root/.local -ENV PATH=/root/.local:$PATH - -# Copy Python API. -RUN mkdir inputapi -RUN mkdir -p inputapi/log -COPY ./inputapi/src ./inputapi/ - -# Execute both in entrypoint.sh. -ENTRYPOINT ["/entrypoint.sh"] -CMD ["influxd"] -- GitLab