-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add kubeflow dockerfile (#996)
- Loading branch information
1 parent
45f9ee9
commit 4c4f1f0
Showing
26 changed files
with
193 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: kubeflow-publish | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/aarhus-psychiatry-research/psycop-common-kubeflow | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: ${{ github.ref == 'refs/heads/main' }} | ||
platforms: linux/amd64 | ||
file: Kubeflow | ||
tags: ghcr.io/aarhus-psychiatry-research/psycop-common-kubeflow:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.