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

Install MSSQL Dependencies by Default [#635] #664

Merged
merged 3 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to change these conditionals to false

Copy link
Contributor Author

@pattisdr pattisdr Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, I am saying if $SKIP_MSSQL_INSTALLATION is not equal to true, here, so if nothing is passed in, MSSQL is installed by default. It seemed cleaner to do it this way so by default no variable needs to be set at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies, I missed the !



# 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