Skip to content

Commit

Permalink
Merge pull request #1 from prefeitura-rio/staging/smdue
Browse files Browse the repository at this point in the history
addind some adm_licenca_urbanismo queries
  • Loading branch information
patriciacatandi authored May 4, 2024
2 parents 53c6dd3 + c6c9b7b commit 0f96722
Show file tree
Hide file tree
Showing 13 changed files with 5,675 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Install Python dependencies for deploying
run: |-
pip install -U pip poetry
pip install -U pip "poetry<1.8.0"
poetry config virtualenvs.create false
poetry install --with dev --with ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd_staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: Install Python dependencies for deploying
run: |-
pip install -U pip poetry
pip install -U pip "poetry<1.8.0"
poetry config virtualenvs.create false
poetry install --with dev --with ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-tree-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Install Python dependencies for deploying
run: |-
pip install -U pip poetry
pip install -U pip "poetry<1.8.0"
poetry config virtualenvs.create false
poetry install --with dev --with ci
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf
with:
dockerfile: Dockerfile
ignore: DL3008

- name: Set up Python
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e
Expand All @@ -23,12 +24,12 @@ jobs:

- name: Set up Poetry and upgrade pip
run: |
pip install -U pip poetry
pip install -U pip "poetry<1.8.0"
- name: Install dependencies
run: |
poetry config virtualenvs.create false && poetry install --with dev --with ci
- name: Lint with black, isort and flake8
run: |
task lint
task lint
40 changes: 36 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,51 @@
# Build arguments
ARG PYTHON_VERSION=3.10-slim
ARG PYTHON_VERSION=3.10-slim-buster

# Get Oracle Instant Client
FROM curlimages/curl:7.81.0 as curl-step
ARG ORACLE_INSTANT_CLIENT_URL=https://download.oracle.com/otn_software/linux/instantclient/215000/instantclient-basic-linux.x64-21.5.0.0.0dbru.zip
RUN curl -sSLo /tmp/instantclient.zip $ORACLE_INSTANT_CLIENT_URL

# Unzip Oracle Instant Client
FROM ubuntu:18.04 as unzip-step
COPY --from=curl-step /tmp/instantclient.zip /tmp/instantclient.zip
RUN apt-get update && \
apt-get install --no-install-recommends -y unzip && \
rm -rf /var/lib/apt/lists/* && \
unzip /tmp/instantclient.zip -d /tmp

# Start Python image
FROM python:${PYTHON_VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install git
# Install a few dependencies
RUN apt-get update && \
apt-get install -y git && \
apt-get install --no-install-recommends -y git curl gnupg2 libaio1 && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
echo "deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/12/prod bookworm main" > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install --no-install-recommends -y git msodbcsql17 openssl unixodbc-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY ./openssl.cnf /etc/ssl/openssl.cnf

# Setting environment with prefect version
ARG PREFECT_VERSION=1.4.1
ENV PREFECT_VERSION $PREFECT_VERSION

# Setup Oracle Instant Client and SQL Server ODBC Driver
WORKDIR /opt/oracle
COPY --from=unzip-step /tmp/instantclient_21_5 /opt/oracle/instantclient_21_5
RUN apt-get update && \
apt-get install --no-install-recommends -y curl gnupg2 libaio1 && \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
echo "deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/debian/12/prod bookworm main" > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install --no-install-recommends -y ffmpeg libsm6 libxext6 msodbcsql17 openssl unixodbc-dev && \
rm -rf /var/lib/apt/lists/* && \
sh -c "echo /opt/oracle/instantclient_21_5 > /etc/ld.so.conf.d/oracle-instantclient.conf" && \
ldconfig

# Setup virtual environment and prefect
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
Expand All @@ -23,4 +55,4 @@ RUN python3 -m pip install --no-cache-dir -U "pip>=21.2.4" "prefect==$PREFECT_VE
# Install requirements
WORKDIR /app
COPY . .
RUN python3 -m pip install --prefer-binary --no-cache-dir -U .
RUN python3 -m pip install --prefer-binary --no-cache-dir -U .
Loading

0 comments on commit 0f96722

Please sign in to comment.