-
Notifications
You must be signed in to change notification settings - Fork 1
/
Kubeflow
73 lines (59 loc) · 2.87 KB
/
Kubeflow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM kubeflownotebookswg/codeserver-python:v1.9.0
# Switch over to root for building the custom image
USER root
# Install system dependencies including odbc and FreeTDS driver
RUN apt-get update && apt-get install -y \
unixodbc-dev \
unixodbc \
tdsodbc \
curl \
gcc \
g++ \
build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Add FreeTDS driver to odbcinst
RUN cat <<EOF > /etc/odbcinst.ini
[FreeTDS]
Description = FreeTDS Driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
EOF
# Install msodbcsql18 and mssql-tools18
RUN \
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
RUN curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc \
&& curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | tee /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update \
&& ACCEPT_EULA=Y apt-get install -y msodbcsql18 \
&& ACCEPT_EULA=Y apt-get install -y mssql-tools18 \
&& echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc \
&& /bin/bash -c "source ~/.bashrc"
# Install Python packages
ENV UV_SYSTEM_PYTHON=1
RUN pip install uv
# Mount a cache dir for faster repeated installs. Only mounts during build.
# Do not compile the python packages, only compile them at runtime.
# Heaviest requirements first, to preserve cache hits.
COPY gpu-requirements.txt .
RUN --mount=type=cache,target=/root/.cache/uv uv pip install -r gpu-requirements.txt --no-compile
# Add build-essential for psutil
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/uv uv pip install -r requirements.txt --no-compile
COPY test-requirements.txt .
RUN --mount=type=cache,target=/root/.cache/uv uv pip install -r test-requirements.txt --no-compile
COPY dev-requirements.txt .
RUN --mount=type=cache,target=/root/.cache/uv uv pip install -r dev-requirements.txt --no-compile
# Ensure pyright is installed from npm since npm is not accessible at runtime
RUN pyright --help
# BI's SQL server is MsSQL 2016, which supports TLS <= 1.2. This is lower than the default TLS version of Ubuntu 22.04.
# Modify the OpenSSL configuration file, in system and conda, to set the minimum supported TLS version to TLSv1.2
RUN sed -i 's/^\(\[system_default_sect\]\)/\1\nMinProtocol = TLSv1.2/' /etc/ssl/openssl.cnf && \
sed -i 's/^CipherString = DEFAULT:@SECLEVEL=2/CipherString = DEFAULT@SECLEVEL=0/' /etc/ssl/openssl.cnf
RUN sed -i '/\[openssl_init\]/a ssl_conf = ssl_sect' /opt/conda/ssl/openssl.cnf && \
sed -i '$a\\n[ssl_sect]\nsystem_default = system_default_sect\n\n[system_default_sect]\nMinProtocol = TLSv1.2\nCipherString = DEFAULT@SECLEVEL=0' /opt/conda/ssl/openssl.cnf
# Switch back to root user
USER $NB_USER