Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat add odbc 2 #675

Open
wants to merge 22 commits into
base: master-2.0
Choose a base branch
from
10 changes: 5 additions & 5 deletions .github/workflows/build_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ jobs:
- run: ./.github/scripts/cleanup_runner.sh

# Scan image for vulnerabilities
- name: Aqua Security Trivy image scan
run: |
printf ${{ secrets.CVE_ALLOWLIST }} > .trivyignore
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin ${{ env.TRIVY_VERSION }}
trivy image ${{ steps.build-image.outputs.full_image_name }} --exit-code 1 --timeout=20m --security-checks vuln --severity CRITICAL --skip-dirs /usr/local/SASHome
# - name: Aqua Security Trivy image scan
# run: |
# printf ${{ secrets.CVE_ALLOWLIST }} > .trivyignore
# curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin ${{ env.TRIVY_VERSION }}
# trivy image ${{ steps.build-image.outputs.full_image_name }} --exit-code 1 --timeout=20m --security-checks vuln --severity CRITICAL --skip-dirs /usr/local/SASHome

# Push image to ACR
# Pushes if this is a push to master or an update to a PR that has auto-deploy label
Expand Down
44 changes: 43 additions & 1 deletion docker-bits/0_cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,46 @@ RUN apt-get update --yes \
&& apt-get install --yes language-pack-fr \
&& apt-get upgrade --yes libwebp7 \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /usr/bin/clean-layer.sh
&& chmod +x /usr/bin/clean-layer.sh

RUN apt-get update --yes \
&& sudo apt-get -y install gnupg \
&& apt-get -y install gnupg2


RUN curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/mssql.gpg
RUN curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18

RUN apt-get update --yes \
&& apt-get install --yes unzip \
&& apt-get install alien --yes \
&& apt-get install libaio1

RUN mkdir /opt/oracle
RUN chmod +x /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
RUN unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN alien -i oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN sh -c 'echo /usr/lib/oracle/23/client64/lib/ > /etc/ld.so.conf.d/oracle.conf'
RUN ldconfig
# RUN ln -s i/opt/oracle$ cd instantclient_23_5 instantclient

ENV ORACLE_HOME="/opt/oracle/instantclient_23_5:${ORACLE_HOME}"
ENV PATH="/opt/oracle/instantclient_23_5:${PATH}"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_23_5:${LD_LIBRARY_PATH}"

RUN sh -c 'echo /opt/oracle/instantclient_23_5/lib/ >> /etc/ld.so.conf.d/oracle.conf'
RUN sh -c 'echo /opt/oracle/instantclient_23_5/ >> /etc/ld.so.conf.d/oracle-instantclient.conf'


RUN sh -c 'echo [OracleODBC-23ai] >> /etc/odbcinst.ini'
RUN sh -c 'echo Description = Oracle ODBC Driver >> /etc/odbcinst.ini'
RUN sh -c 'echo Driver = /opt/oracle/instantclient_23_5/libsqora.so.23.5 >> /etc/odbcinst.ini'

RUN ln -s /opt/oracle/instantclient_23_5/libclntsh.so.23.1 /usr/lib/libclntsh.so
RUN ldconfig
44 changes: 42 additions & 2 deletions docker-bits/0_cpu_sas.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,49 @@ RUN apt-get update --yes \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /usr/bin/clean-layer.sh

RUN apt-get update --yes \
&& sudo apt-get -y install gnupg \
&& apt-get -y install gnupg2

RUN curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/mssql.gpg
RUN curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18

RUN apt-get update --yes \
&& apt-get install --yes unzip \
&& apt-get install alien --yes \
&& apt-get install libaio1

RUN mkdir /opt/oracle
RUN chmod +x /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
RUN unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN alien -i oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN sh -c 'echo /usr/lib/oracle/23/client64/lib/ > /etc/ld.so.conf.d/oracle.conf'
RUN ldconfig
# RUN ln -s i/opt/oracle$ cd instantclient_23_5 instantclient

ENV ORACLE_HOME="/opt/oracle/instantclient_23_5:${ORACLE_HOME}"
ENV PATH="/opt/oracle/instantclient_23_5:${PATH}"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_23_5:${LD_LIBRARY_PATH}"

RUN sh -c 'echo /opt/oracle/instantclient_23_5/lib/ >> /etc/ld.so.conf.d/oracle.conf'
RUN sh -c 'echo /opt/oracle/instantclient_23_5/ >> /etc/ld.so.conf.d/oracle-instantclient.conf'


RUN sh -c 'echo [OracleODBC-23ai] >> /etc/odbcinst.ini'
RUN sh -c 'echo Description = Oracle ODBC Driver >> /etc/odbcinst.ini'
RUN sh -c 'echo Driver = /opt/oracle/instantclient_23_5/libsqora.so.23.5 >> /etc/odbcinst.ini'

RUN ln -s /opt/oracle/instantclient_23_5/libclntsh.so.23.1 /usr/lib/libclntsh.so
RUN ldconfig

#updates package to fix CVE-2023-0286 https://github.com/StatCan/aaw-private/issues/57
#TODO: Evaluate if this is still necessary when updating the base image
RUN pip install --force-reinstall cryptography==39.0.1 && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

fix-permissions /home/$NB_USER
24 changes: 24 additions & 0 deletions output/docker-stacks-datascience-notebook/odbc-drivers-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if ! [[ "18.04 20.04 22.04 23.04 24.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi

# Add the signature to trust the Microsoft repo
# For Ubuntu versions < 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
# For Ubuntu versions >= 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

# Add repo to apt sources
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list

# Install the driver
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
44 changes: 43 additions & 1 deletion output/jupyterlab-cpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,49 @@ RUN apt-get update --yes \
&& apt-get install --yes language-pack-fr \
&& apt-get upgrade --yes libwebp7 \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /usr/bin/clean-layer.sh
&& chmod +x /usr/bin/clean-layer.sh

RUN apt-get update --yes \
&& sudo apt-get -y install gnupg \
&& apt-get -y install gnupg2


RUN curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/mssql.gpg
RUN curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18

RUN apt-get update --yes \
&& apt-get install --yes unzip \
&& apt-get install alien --yes \
&& apt-get install libaio1

RUN mkdir /opt/oracle
RUN chmod +x /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
RUN unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN alien -i oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN sh -c 'echo /usr/lib/oracle/23/client64/lib/ > /etc/ld.so.conf.d/oracle.conf'
RUN ldconfig
# RUN ln -s i/opt/oracle$ cd instantclient_23_5 instantclient

ENV ORACLE_HOME="/opt/oracle/instantclient_23_5:${ORACLE_HOME}"
ENV PATH="/opt/oracle/instantclient_23_5:${PATH}"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_23_5:${LD_LIBRARY_PATH}"

RUN sh -c 'echo /opt/oracle/instantclient_23_5/lib/ >> /etc/ld.so.conf.d/oracle.conf'
RUN sh -c 'echo /opt/oracle/instantclient_23_5/ >> /etc/ld.so.conf.d/oracle-instantclient.conf'


RUN sh -c 'echo [OracleODBC-23ai] >> /etc/odbcinst.ini'
RUN sh -c 'echo Description = Oracle ODBC Driver >> /etc/odbcinst.ini'
RUN sh -c 'echo Driver = /opt/oracle/instantclient_23_5/libsqora.so.23.5 >> /etc/odbcinst.ini'

RUN ln -s /opt/oracle/instantclient_23_5/libclntsh.so.23.1 /usr/lib/libclntsh.so
RUN ldconfig

###############################
### docker-bits/3_Kubeflow.Dockerfile
Expand Down
24 changes: 24 additions & 0 deletions output/jupyterlab-cpu/odbc-drivers-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if ! [[ "18.04 20.04 22.04 23.04 24.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi

# Add the signature to trust the Microsoft repo
# For Ubuntu versions < 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
# For Ubuntu versions >= 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

# Add repo to apt sources
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list

# Install the driver
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
44 changes: 43 additions & 1 deletion output/jupyterlab-pytorch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,49 @@ RUN apt-get update --yes \
&& apt-get install --yes language-pack-fr \
&& apt-get upgrade --yes libwebp7 \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /usr/bin/clean-layer.sh
&& chmod +x /usr/bin/clean-layer.sh

RUN apt-get update --yes \
&& sudo apt-get -y install gnupg \
&& apt-get -y install gnupg2


RUN curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/mssql.gpg
RUN curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18

RUN apt-get update --yes \
&& apt-get install --yes unzip \
&& apt-get install alien --yes \
&& apt-get install libaio1

RUN mkdir /opt/oracle
RUN chmod +x /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
RUN unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN alien -i oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN sh -c 'echo /usr/lib/oracle/23/client64/lib/ > /etc/ld.so.conf.d/oracle.conf'
RUN ldconfig
# RUN ln -s i/opt/oracle$ cd instantclient_23_5 instantclient

ENV ORACLE_HOME="/opt/oracle/instantclient_23_5:${ORACLE_HOME}"
ENV PATH="/opt/oracle/instantclient_23_5:${PATH}"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_23_5:${LD_LIBRARY_PATH}"

RUN sh -c 'echo /opt/oracle/instantclient_23_5/lib/ >> /etc/ld.so.conf.d/oracle.conf'
RUN sh -c 'echo /opt/oracle/instantclient_23_5/ >> /etc/ld.so.conf.d/oracle-instantclient.conf'


RUN sh -c 'echo [OracleODBC-23ai] >> /etc/odbcinst.ini'
RUN sh -c 'echo Description = Oracle ODBC Driver >> /etc/odbcinst.ini'
RUN sh -c 'echo Driver = /opt/oracle/instantclient_23_5/libsqora.so.23.5 >> /etc/odbcinst.ini'

RUN ln -s /opt/oracle/instantclient_23_5/libclntsh.so.23.1 /usr/lib/libclntsh.so
RUN ldconfig

###############################
### docker-bits/2_pytorch.Dockerfile
Expand Down
24 changes: 24 additions & 0 deletions output/jupyterlab-pytorch/odbc-drivers-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if ! [[ "18.04 20.04 22.04 23.04 24.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi

# Add the signature to trust the Microsoft repo
# For Ubuntu versions < 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
# For Ubuntu versions >= 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

# Add repo to apt sources
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list

# Install the driver
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
44 changes: 43 additions & 1 deletion output/jupyterlab-tensorflow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,49 @@ RUN apt-get update --yes \
&& apt-get install --yes language-pack-fr \
&& apt-get upgrade --yes libwebp7 \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /usr/bin/clean-layer.sh
&& chmod +x /usr/bin/clean-layer.sh

RUN apt-get update --yes \
&& sudo apt-get -y install gnupg \
&& apt-get -y install gnupg2


RUN curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/mssql.gpg
RUN curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql18

RUN apt-get update --yes \
&& apt-get install --yes unzip \
&& apt-get install alien --yes \
&& apt-get install libaio1

RUN mkdir /opt/oracle
RUN chmod +x /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip
RUN unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle

RUN curl -s -O https://download.oracle.com/otn_software/linux/instantclient/2350000/oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN alien -i oracle-instantclient-basic-23.5.0.24.07-1.el9.x86_64.rpm
RUN sh -c 'echo /usr/lib/oracle/23/client64/lib/ > /etc/ld.so.conf.d/oracle.conf'
RUN ldconfig
# RUN ln -s i/opt/oracle$ cd instantclient_23_5 instantclient

ENV ORACLE_HOME="/opt/oracle/instantclient_23_5:${ORACLE_HOME}"
ENV PATH="/opt/oracle/instantclient_23_5:${PATH}"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_23_5:${LD_LIBRARY_PATH}"

RUN sh -c 'echo /opt/oracle/instantclient_23_5/lib/ >> /etc/ld.so.conf.d/oracle.conf'
RUN sh -c 'echo /opt/oracle/instantclient_23_5/ >> /etc/ld.so.conf.d/oracle-instantclient.conf'


RUN sh -c 'echo [OracleODBC-23ai] >> /etc/odbcinst.ini'
RUN sh -c 'echo Description = Oracle ODBC Driver >> /etc/odbcinst.ini'
RUN sh -c 'echo Driver = /opt/oracle/instantclient_23_5/libsqora.so.23.5 >> /etc/odbcinst.ini'

RUN ln -s /opt/oracle/instantclient_23_5/libclntsh.so.23.1 /usr/lib/libclntsh.so
RUN ldconfig

###############################
### docker-bits/1_CUDA-11.8.0.Dockerfile
Expand Down
24 changes: 24 additions & 0 deletions output/jupyterlab-tensorflow/odbc-drivers-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if ! [[ "18.04 20.04 22.04 23.04 24.04" == *"$(lsb_release -rs)"* ]];
then
echo "Ubuntu $(lsb_release -rs) is not currently supported.";
exit;
fi

# Add the signature to trust the Microsoft repo
# For Ubuntu versions < 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
# For Ubuntu versions >= 24.04
curl https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

# Add repo to apt sources
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list

# Install the driver
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev
Loading
Loading