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

Install odbc driver #678

Open
wants to merge 17 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
1 change: 1 addition & 0 deletions docker-bits/0_cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG BASE_VERSION=2024-06-17

FROM k8scc01covidacr.azurecr.io/sas4c:0.0.3 as SASHome
FROM quay.io/jupyter/datascience-notebook:$BASE_VERSION
# using Ubuntu 22.04 Jammy

USER root

Expand Down
39 changes: 38 additions & 1 deletion docker-bits/5_DB-Drivers.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
USER root

# ODBC drivers
# Add the signature to trust the Microsoft repo
RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc && \
# 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

RUN apt-get update && \
apt-get install -y unixodbc-dev && \
# Install the driver
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
# optional: for bcp and sqlcmd
ACCEPT_EULA=Y apt-get install -y mssql-tools18 && \
# installing unixODBC
apt-get install -y unixodbc unixodbc-dev && \
# libaio1 needed for Oracle Instant Client
apt-get install -y libaio1 && \
pip install --no-cache-dir --quiet pyodbc && \
rm -rf /var/lib/apt/lists/* && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc && \
source ~/.bashrc

# installing Oracle Instant Client
RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip && \
unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle/ && \
echo /opt/oracle/instantclient_23_5 > /etc/ld.so.conf.d/oracle-instantclient.conf && \
ldconfig

ENV PATH /opt/oracle/instantclient_23_5:${PATH}

# installing Oracle ODBC driver
RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-odbc-linux.x64-23.5.0.24.07.zip && \
unzip -oj instantclient-odbc-linux.x64-23.5.0.24.07.zip -d /opt/oracle/instantclient_23_5 && \
/opt/oracle/instantclient_23_5/odbc_update_ini.sh / /opt/oracle/instantclient_23_5

# add relevent files needed for oracle
COPY dbConnection/LINUX_CLIENT_WALLET /opt/oracle/instantclient_23_5/LINUX_CLIENT_WALLET
COPY dbConnection/*.ora /opt/oracle/instantclient_23_5/network/admin/
#give users permissions to edit the alias file
RUN chmod a+w /opt/oracle/instantclient_23_5/network/admin
RUN chown $NB_UID:$NB_GID /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
12 changes: 6 additions & 6 deletions docker-bits/6_rstudio.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ RUN mkdir -p /etc/rstudio && \

ENV PATH=$PATH:/usr/lib/rstudio-server/bin

# Install some default R packages
RUN mamba install --quiet --yes \
'r-rodbc' \
'r-tidyverse' \
'r-arrow' \
'r-aws.s3' \
'r-catools' \
&& \
clean-layer.sh && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

# Install some default R packages
&& \
clean-layer.sh && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
#Split from command directly above because of performance issues.
RUN mamba install --quiet --yes \
'r-hdf5r' \
'r-odbc' \
Expand Down
Binary file not shown.
Binary file not shown.
62 changes: 62 additions & 0 deletions output/docker-stacks-datascience-notebook/dbConnection/sqlnet.ora
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# sqlnet.ora Network Configuration File: \\fld6filer\tnsnames\ora19\sqlnet.ora
# Generated by Oracle configuration tools.

#TRACE_DIRECTORY_CLIENT=c:\oracle\trace
#TRACE_FILE_CLIENT=krb_clt
#TRACE_FILELEN_CLIENT=100
#TRACE_FILENO_CLIENT=3
#TRACE_LEVEL_CLIENT=OFF
#TRACE_TIMESTAMP_CLIENT=ON
#TRACE_UNIQUE_CLIENT=OFF
#USE_DEDICATED_SERVER=OFF
#SQLNET.AUTHENTICATION_SERVICES=(KERBEROS5,NTS)
#ADR_BASE = C:\oracle\trace
# The following parameters were set by TOAD
#TRACE_DIRECTORY_OKINIT = c:\oracle\trace
#TRACE_FILE_OKINIT = okini_clt
#TRACE_LEVEL_OKINIT = 0
#SQLNET.KERBEROS5_CC_NAME = MSLSA:
# for Oracle 12c (12.1.0.2 or newwer) Windows 32/64 bit clients
#
# put in place @ 20150106 by John Kowalski
#
# to use Kerberos, copy \\fld6filer\SDD-TNSadmin\krb5\krb5.conf to c:\krb5\krb5.conf on your PC
#
## kerberos sqlnet.ora settings / will work with "non-kerberos" oracle databases
#NAMES.DEFAULT_DOMAIN = statcan.ca

SQLNET.RECV_TIMEOUT = 86400

SQLNET.KERBEROS5_CC_NAME = OSMSFT://

SQLNET.AUTHENTICATION_SERVICES= (NTS)

SSL_VERSION = 1.2

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

SSL_CLIENT_AUTHENTICATION = FALSE

SQLNET.KERBEROS5_DELEGATION = TRUE

SQLNET.OS_AUTHENT_PREFIX = ""

SQLNET.KERBEROS5_CONF = c:\krb5\krb5.conf

SQLNET.KERBEROS5_CONF_MIT = TRUE

WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY=/opt/oracle/instantclient_23_5/LINUX_CLIENT_WALLET)
)
)

SQLNET.ALLOWED_LOGIN_VERSION = 11

DIAG_ADR_ENABLED = OFF

SQLNET.EXPIRE_TIME = 0

SQLNET.AUTHENTICATION_KERBEROS5_SERVICE = oracle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###############################################################################
#
# TODO: Maybe add instructions in a comment block like this on how to setup this file for users?
# Possibly just copying whatever we put in the docs.
#
###############################################################################
6 changes: 6 additions & 0 deletions output/docker-stacks-datascience-notebook/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ if [ ! -d "$HOME/workspace" ]; then
mkdir -p "$HOME/workspace/repositories"
fi

# Creating symlink to oracle files for easier access
if [ ! -d "$HOME/oracle" ]; then
echo "Creating symlink for oracle"
ln -s /opt/oracle/instantclient_23_5/network/admin/ "$HOME/oracle"
fi

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
echo "No sas studio default settings created"
Expand Down
52 changes: 45 additions & 7 deletions output/jupyterlab-cpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ARG BASE_VERSION=2024-06-17

FROM k8scc01covidacr.azurecr.io/sas4c:0.0.3 as SASHome
FROM quay.io/jupyter/datascience-notebook:$BASE_VERSION
# using Ubuntu 22.04 Jammy

USER root

Expand Down Expand Up @@ -158,14 +159,51 @@ RUN wget -q "${GIT_CRED_MANAGER_URL}" -O ./gcm.deb \
### docker-bits/5_DB-Drivers.Dockerfile
###############################

USER root

# ODBC drivers
# Add the signature to trust the Microsoft repo
RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc && \
# 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

RUN apt-get update && \
apt-get install -y unixodbc-dev && \
# Install the driver
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
# optional: for bcp and sqlcmd
ACCEPT_EULA=Y apt-get install -y mssql-tools18 && \
# installing unixODBC
apt-get install -y unixodbc unixodbc-dev && \
# libaio1 needed for Oracle Instant Client
apt-get install -y libaio1 && \
pip install --no-cache-dir --quiet pyodbc && \
rm -rf /var/lib/apt/lists/* && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc && \
source ~/.bashrc

# installing Oracle Instant Client
RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip && \
unzip instantclient-basic-linux.x64-23.5.0.24.07.zip -d /opt/oracle/ && \
echo /opt/oracle/instantclient_23_5 > /etc/ld.so.conf.d/oracle-instantclient.conf && \
ldconfig

ENV PATH /opt/oracle/instantclient_23_5:${PATH}

# installing Oracle ODBC driver
RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-odbc-linux.x64-23.5.0.24.07.zip && \
unzip -oj instantclient-odbc-linux.x64-23.5.0.24.07.zip -d /opt/oracle/instantclient_23_5 && \
/opt/oracle/instantclient_23_5/odbc_update_ini.sh / /opt/oracle/instantclient_23_5

# add relevent files needed for oracle
COPY dbConnection/LINUX_CLIENT_WALLET /opt/oracle/instantclient_23_5/LINUX_CLIENT_WALLET
COPY dbConnection/*.ora /opt/oracle/instantclient_23_5/network/admin/
#give users permissions to edit the alias file
RUN chmod a+w /opt/oracle/instantclient_23_5/network/admin
RUN chown $NB_UID:$NB_GID /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora

###############################
### docker-bits/6_rstudio-server.Dockerfile
###############################
Expand Down Expand Up @@ -204,18 +242,18 @@ RUN mkdir -p /etc/rstudio && \

ENV PATH=$PATH:/usr/lib/rstudio-server/bin

# Install some default R packages
RUN mamba install --quiet --yes \
'r-rodbc' \
'r-tidyverse' \
'r-arrow' \
'r-aws.s3' \
'r-catools' \
&& \
clean-layer.sh && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

# Install some default R packages
&& \
clean-layer.sh && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER
#Split from command directly above because of performance issues.
RUN mamba install --quiet --yes \
'r-hdf5r' \
'r-odbc' \
Expand Down
Binary file not shown.
Empty file.
Binary file not shown.
Empty file.
62 changes: 62 additions & 0 deletions output/jupyterlab-cpu/dbConnection/sqlnet.ora
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# sqlnet.ora Network Configuration File: \\fld6filer\tnsnames\ora19\sqlnet.ora
# Generated by Oracle configuration tools.

#TRACE_DIRECTORY_CLIENT=c:\oracle\trace
#TRACE_FILE_CLIENT=krb_clt
#TRACE_FILELEN_CLIENT=100
#TRACE_FILENO_CLIENT=3
#TRACE_LEVEL_CLIENT=OFF
#TRACE_TIMESTAMP_CLIENT=ON
#TRACE_UNIQUE_CLIENT=OFF
#USE_DEDICATED_SERVER=OFF
#SQLNET.AUTHENTICATION_SERVICES=(KERBEROS5,NTS)
#ADR_BASE = C:\oracle\trace
# The following parameters were set by TOAD
#TRACE_DIRECTORY_OKINIT = c:\oracle\trace
#TRACE_FILE_OKINIT = okini_clt
#TRACE_LEVEL_OKINIT = 0
#SQLNET.KERBEROS5_CC_NAME = MSLSA:
# for Oracle 12c (12.1.0.2 or newwer) Windows 32/64 bit clients
#
# put in place @ 20150106 by John Kowalski
#
# to use Kerberos, copy \\fld6filer\SDD-TNSadmin\krb5\krb5.conf to c:\krb5\krb5.conf on your PC
#
## kerberos sqlnet.ora settings / will work with "non-kerberos" oracle databases
#NAMES.DEFAULT_DOMAIN = statcan.ca

SQLNET.RECV_TIMEOUT = 86400

SQLNET.KERBEROS5_CC_NAME = OSMSFT://

SQLNET.AUTHENTICATION_SERVICES= (NTS)

SSL_VERSION = 1.2

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

SSL_CLIENT_AUTHENTICATION = FALSE

SQLNET.KERBEROS5_DELEGATION = TRUE

SQLNET.OS_AUTHENT_PREFIX = ""

SQLNET.KERBEROS5_CONF = c:\krb5\krb5.conf

SQLNET.KERBEROS5_CONF_MIT = TRUE

WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY=/opt/oracle/instantclient_23_5/LINUX_CLIENT_WALLET)
)
)

SQLNET.ALLOWED_LOGIN_VERSION = 11

DIAG_ADR_ENABLED = OFF

SQLNET.EXPIRE_TIME = 0

SQLNET.AUTHENTICATION_KERBEROS5_SERVICE = oracle
6 changes: 6 additions & 0 deletions output/jupyterlab-cpu/dbConnection/tnsnames.ora
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###############################################################################
#
# TODO: Maybe add instructions in a comment block like this on how to setup this file for users?
# Possibly just copying whatever we put in the docs.
#
###############################################################################
6 changes: 6 additions & 0 deletions output/jupyterlab-cpu/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ if [ ! -d "$HOME/workspace" ]; then
mkdir -p "$HOME/workspace/repositories"
fi

# Creating symlink to oracle files for easier access
if [ ! -d "$HOME/oracle" ]; then
echo "Creating symlink for oracle"
ln -s /opt/oracle/instantclient_23_5/network/admin/ "$HOME/oracle"
fi

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
echo "No sas studio default settings created"
Expand Down
Loading
Loading