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

Instal odbc Drivers #659

Open
wants to merge 25 commits into
base: master-2.0
Choose a base branch
from
Open
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
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
48 changes: 47 additions & 1 deletion docker-bits/0_cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,50 @@ 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

# Adding oracle here instead of inside each cp files
#

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 install --yes 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}"
RUN export PATH="$PATH:/opt/oracle/instantclient_23_5"
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_23_5"

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
51 changes: 49 additions & 2 deletions docker-bits/0_cpu_sas.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,56 @@ RUN apt-get update --yes \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /usr/bin/clean-layer.sh


# Adding oracle here instead of inside each cp files
#

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 install --yes 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}"
RUN export PATH="$PATH:/opt/oracle/instantclient_23_5"
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_23_5"

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
1 change: 1 addition & 0 deletions docker-bits/∞_CMD.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ADD connect-to-filer.md /home/$NB_USER/connect-to-filer.md
# Point conda to Artifactory repository
RUN conda config --remove channels conda-forge --system


USER $NB_USER
ENTRYPOINT ["tini", "--"]
CMD ["start-custom.sh"]
1 change: 1 addition & 0 deletions output/docker-stacks-datascience-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ADD connect-to-filer.md /home/$NB_USER/connect-to-filer.md
# Point conda to Artifactory repository
RUN conda config --remove channels conda-forge --system


USER $NB_USER
ENTRYPOINT ["tini", "--"]
CMD ["start-custom.sh"]
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
49 changes: 48 additions & 1 deletion output/jupyterlab-cpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,53 @@ 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

# Adding oracle here instead of inside each cp files
#

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 install --yes 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}"
RUN export PATH="$PATH:/opt/oracle/instantclient_23_5"
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_23_5"

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 Expand Up @@ -544,6 +590,7 @@ ADD connect-to-filer.md /home/$NB_USER/connect-to-filer.md
# Point conda to Artifactory repository
RUN conda config --remove channels conda-forge --system


USER $NB_USER
ENTRYPOINT ["tini", "--"]
CMD ["start-custom.sh"]
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
49 changes: 48 additions & 1 deletion output/jupyterlab-pytorch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,53 @@ 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

# Adding oracle here instead of inside each cp files
#

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 install --yes 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}"
RUN export PATH="$PATH:/opt/oracle/instantclient_23_5"
RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_23_5"

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 Expand Up @@ -566,6 +612,7 @@ ADD connect-to-filer.md /home/$NB_USER/connect-to-filer.md
# Point conda to Artifactory repository
RUN conda config --remove channels conda-forge --system


USER $NB_USER
ENTRYPOINT ["tini", "--"]
CMD ["start-custom.sh"]
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
Loading
Loading