Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Install MSSQL Dependencies by Default [#635] (#664)
Browse files Browse the repository at this point in the history
* Have MSSQL dependencies be installed by default in the dockerfile by flipping the variable's meaning to SKIP_MSSQL_INSTALLATION.

* Update changelog.
  • Loading branch information
pattisdr committed Jun 17, 2022
1 parent 424caab commit 62c3060
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The types of changes are:
* Bumped Python to version 3.9.13 in the `Dockerfile` [#630](https://github.com/ethyca/fidesops/pull/630)
* Matched the path to the migrations in the mypy settings with the new location [#634](https://github.com/ethyca/fidesops/pull/634)
* Sort ConnectionConfig by name ascending [#668](https://github.com/ethyca/fidesops/pull/672)
* Install MSSQL By Default [#664] (https://github.com/ethyca/fidesops/pull/664)

### Developer Experience

Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN npm run export

FROM --platform=linux/amd64 python:3.9.13-slim-buster as backend

ARG MSSQL_REQUIRED
ARG SKIP_MSSQL_INSTALLATION

# Install auxiliary software
RUN apt-get update && \
Expand All @@ -24,16 +24,16 @@ RUN apt-get update && \
gcc


RUN echo "ENVIRONMENT VAR: $MSSQL_REQUIRED"
RUN echo "ENVIRONMENT VAR: SKIP_MSSQL_INSTALLATION $SKIP_MSSQL_INSTALLATION"

# SQL Server (MS SQL)
# https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15
RUN if [ "$MSSQL_REQUIRED" = "true" ] ; then apt-get install apt-transport-https ; fi
RUN if [ "$MSSQL_REQUIRED" = "true" ] ; then curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - ; fi
RUN if [ "$MSSQL_REQUIRED" = "true" ] ; then curl https://packages.microsoft.com/config/debian/10/prod.list | tee /etc/apt/sources.list.d/msprod.list ; fi
RUN if [ "$MSSQL_REQUIRED" = "true" ] ; then apt-get update ; fi
RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then apt-get install apt-transport-https ; fi
RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - ; fi
RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then curl https://packages.microsoft.com/config/debian/10/prod.list | tee /etc/apt/sources.list.d/msprod.list ; fi
RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then apt-get update ; fi
ENV ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive
RUN if [ "$MSSQL_REQUIRED" = "true" ] ; then apt-get -y install \
RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then apt-get -y install \
unixodbc-dev \
msodbcsql17 \
mssql-tools ; fi
Expand All @@ -45,7 +45,7 @@ RUN pip install -U pip \
&& pip install snowflake-connector-python --no-use-pep517 \
&& pip install -r requirements.txt -r dev-requirements.txt

RUN if [ "$MSSQL_REQUIRED" = "true" ] ; then pip install -U pip -r mssql-requirements.txt ; fi
RUN if [ "$SKIP_MSSQL_INSTALLATION" != "true" ] ; then pip install -U pip -r mssql-requirements.txt ; fi


# Copy in the application files and install it locally
Expand Down
4 changes: 2 additions & 2 deletions run_infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def run_infrastructure(
path: str = get_path_for_datastores(datastores)

_run_cmd_or_err(f'echo "infrastructure path: {path}"')
if "mssql" in datastores:
if "mssql" not in datastores:
_run_cmd_or_err(
f'docker-compose {path} build --build-arg MSSQL_REQUIRED="true"'
f'docker-compose {path} build --build-arg SKIP_MSSQL_INSTALLATION="true"'
)
_run_cmd_or_err(f"docker-compose {path} up -d")
_run_cmd_or_err(f'echo "sleeping for: {DOCKER_WAIT} while infrastructure loads"')
Expand Down

0 comments on commit 62c3060

Please sign in to comment.