Skip to content

Commit

Permalink
RHOAIENG-11274: chore(Makefile): widen the container build context to…
Browse files Browse the repository at this point in the history
… the whole repo, so we can start reusing code between images in the future (#792)

* Update `COPY` commands in all not-intel Dockerfiles

* Update `COPY` commands in intel Dockerfiles too

* RHOAIENG-11274: chore(Makefile): widen the container build context to the whole repo, so we can start reusing code between images in the future

```python
import glob
import pathlib

def main():
    for dockerfile in glob.glob("**/Dockerfile", recursive=True):
        print(dockerfile)
        path = pathlib.Path(dockerfile)
        lines = path.read_text().splitlines()
        idx = lines.index("ARG SOURCE_CODE=.")
        lines[idx] = f"ARG SOURCE_CODE={str(path.parent)}"
        print("\t", lines[idx])
        path.write_text("\n".join(lines) + "\n")

if __name__ == '__main__':
    main()
```

* Adjust Makefile to build in `ROOT_DIR` and create .dockerignore to save time when initializing builds
  • Loading branch information
jiridanek authored Dec 9, 2024
1 parent ecd9e76 commit 03c3b6f
Show file tree
Hide file tree
Showing 56 changed files with 294 additions and 172 deletions.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git/
.idea/
.venv/
bin/
ci/
tests/

**/.mypy_cache/
**/.pytest_cache/
**/__pycache__/
**/*.pyc

**/Dockerfile
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

# https://tech.davis-hansson.com/p/make/
SHELL := bash
# todo: do not set .ONESHELL: for now
Expand Down Expand Up @@ -65,7 +68,7 @@ define build_image
$(eval BUILD_ARGS := --build-arg BASE_IMAGE=$(BASE_IMAGE_NAME)),
$(eval BUILD_ARGS :=)
)
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) -t $(IMAGE_NAME) $(BUILD_ARGS) $(2)
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) --tag $(IMAGE_NAME) --file $(2)/Dockerfile $(BUILD_ARGS) $(ROOT_DIR)/
endef

# Push function for the notebok image:
Expand Down
4 changes: 3 additions & 1 deletion base/c9s-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM quay.io/sclorg/python-311-c9s:c9s

ARG SOURCE_CODE=base/c9s-python-3.11

LABEL name="odh-notebook-base-centos-stream9-python-3.11" \
summary="Python 3.11 CentOS Stream 9 base image for ODH notebooks" \
description="Base Python 3.11 builder image based on CentOS Stream 9 for ODH notebooks" \
Expand All @@ -16,7 +18,7 @@ WORKDIR /opt/app-root/bin
RUN pip install --no-cache-dir -U "micropipenv[toml]"

# Install Python dependencies from Pipfile.lock file
COPY Pipfile.lock ./
COPY ${SOURCE_CODE}/Pipfile.lock ./

# OS Packages needs to be installed as root
USER root
Expand Down
4 changes: 3 additions & 1 deletion base/c9s-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM quay.io/sclorg/python-39-c9s:c9s

ARG SOURCE_CODE=base/c9s-python-3.9

LABEL name="odh-notebook-base-centos-stream9-python-3.9" \
summary="Python 3.9 CentOS Stream 9 base image for ODH notebooks" \
description="Base Python 3.9 builder image based on CentOS Stream 9 for ODH notebooks" \
Expand All @@ -16,7 +18,7 @@ WORKDIR /opt/app-root/bin
RUN pip install --no-cache-dir -U "micropipenv[toml]"

# Install Python dependencies from Pipfile.lock file
COPY Pipfile.lock ./
COPY ${SOURCE_CODE}/Pipfile.lock ./

# OS Packages needs to be installed as root
USER root
Expand Down
4 changes: 3 additions & 1 deletion base/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM registry.access.redhat.com/ubi9/python-311:latest

ARG SOURCE_CODE=base/ubi9-python-3.11

LABEL name="odh-notebook-base-ubi9-python-3.11" \
summary="Python 3.11 base image for ODH notebooks" \
description="Base Python 3.11 builder image based on UBI9 for ODH notebooks" \
Expand All @@ -16,7 +18,7 @@ WORKDIR /opt/app-root/bin
RUN pip install --no-cache-dir -U "micropipenv[toml]"

# Install Python dependencies from Pipfile.lock file
COPY Pipfile.lock ./
COPY ${SOURCE_CODE}/Pipfile.lock ./

RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock

Expand Down
4 changes: 3 additions & 1 deletion base/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM registry.access.redhat.com/ubi9/python-39:latest

ARG SOURCE_CODE=base/ubi9-python-3.9

LABEL name="odh-notebook-base-ubi9-python-3.9" \
summary="Python 3.9 base image for ODH notebooks" \
description="Base Python 3.9 builder image based on UBI9 for ODH notebooks" \
Expand All @@ -16,7 +18,7 @@ WORKDIR /opt/app-root/bin
RUN pip install --no-cache-dir -U "micropipenv[toml]"

# Install Python dependencies from Pipfile.lock file
COPY Pipfile.lock ./
COPY ${SOURCE_CODE}/Pipfile.lock ./

RUN echo "Installing softwares and packages" && micropipenv install && rm -f ./Pipfile.lock

Expand Down
17 changes: 9 additions & 8 deletions codeserver/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=codeserver/ubi9-python-3.11
ARG CODESERVER_VERSION=v4.92.2

LABEL name="odh-notebook-code-server-ubi9-python-3.11" \
Expand All @@ -18,7 +19,7 @@ USER 0
WORKDIR /opt/app-root/bin

# Install usefull packages from Pipfile.lock
COPY Pipfile.lock ./
COPY ${SOURCE_CODE}/Pipfile.lock ./

# Install packages and cleanup
RUN echo "Installing softwares and packages" && \
Expand All @@ -39,7 +40,7 @@ RUN yum install -y "https://github.com/coder/code-server/releases/download/${COD
RUN chmod -R g+w /opt/app-root/lib/python3.11/site-packages && \
fix-permissions /opt/app-root -P

COPY --chown=1001:0 utils utils/
COPY --chown=1001:0 ${SOURCE_CODE}/utils utils/

# Create and intall the extensions though build-time on a temporary directory. Later this directory will copied on the `/opt/app-root/src/.local/share/code-server/extensions` via run-code-server.sh file when it starts up.
RUN mkdir -p /opt/app-root/extensions-temp && \
Expand All @@ -64,10 +65,10 @@ RUN yum install -y https://download.fedoraproject.org/pub/epel/epel-release-late
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'

COPY --chown=1001:0 supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY --chown=1001:0 ${SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Copy extra files to the image.
COPY nginx/root/ /
COPY ${SOURCE_CODE}/nginx/root/ /

# Changing ownership and user rights to support following use-cases:
# 1) running container on OpenShift, whose default security model
Expand Down Expand Up @@ -104,12 +105,12 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \
chown -R 1001:0 /opt/app-root/src/.config/code-server

## Configure nginx
COPY nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/
COPY nginx/api/ /opt/app-root/api/
COPY ${SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
COPY ${SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
COPY ${SOURCE_CODE}/nginx/api/ /opt/app-root/api/

# Launcher
COPY --chown=1001:0 run-code-server.sh run-nginx.sh ./
COPY --chown=1001:0 ${SOURCE_CODE}/run-code-server.sh ${SOURCE_CODE}/run-nginx.sh ./

ENV SHELL /bin/bash

Expand Down
17 changes: 9 additions & 8 deletions codeserver/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=codeserver/ubi9-python-3.9
ARG CODESERVER_VERSION=v4.92.2

LABEL name="odh-notebook-code-server-ubi9-python-3.9" \
Expand All @@ -18,7 +19,7 @@ USER 0
WORKDIR /opt/app-root/bin

# Install usefull packages from Pipfile.lock
COPY Pipfile.lock ./
COPY ${SOURCE_CODE}/Pipfile.lock ./

# Install packages and cleanup
RUN echo "Installing softwares and packages" && \
Expand All @@ -39,7 +40,7 @@ RUN yum install -y "https://github.com/coder/code-server/releases/download/${COD
RUN chmod -R g+w /opt/app-root/lib/python3.9/site-packages && \
fix-permissions /opt/app-root -P

COPY --chown=1001:0 utils utils/
COPY --chown=1001:0 ${SOURCE_CODE}/utils utils/

# Create and intall the extensions though build-time on a temporary directory. Later this directory will copied on the `/opt/app-root/src/.local/share/code-server/extensions` via run-code-server.sh file when it starts up.
RUN mkdir -p /opt/app-root/extensions-temp && \
Expand All @@ -64,10 +65,10 @@ RUN yum install -y https://download.fedoraproject.org/pub/epel/epel-release-late
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*'

COPY --chown=1001:0 supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY --chown=1001:0 ${SOURCE_CODE}/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Copy extra files to the image.
COPY nginx/root/ /
COPY ${SOURCE_CODE}/nginx/root/ /

# Changing ownership and user rights to support following use-cases:
# 1) running container on OpenShift, whose default security model
Expand Down Expand Up @@ -104,12 +105,12 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \
chown -R 1001:0 /opt/app-root/src/.config/code-server

## Configure nginx
COPY nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/
COPY nginx/api/ /opt/app-root/api/
COPY ${SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
COPY ${SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
COPY ${SOURCE_CODE}/nginx/api/ /opt/app-root/api/

# Launcher
COPY --chown=1001:0 run-code-server.sh run-nginx.sh ./
COPY --chown=1001:0 ${SOURCE_CODE}/run-code-server.sh ${SOURCE_CODE}/run-nginx.sh ./

ENV SHELL /bin/bash

Expand Down
6 changes: 4 additions & 2 deletions cuda/c9s-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=cuda/c9s-python-3.11

LABEL name="odh-notebook-cuda-c9s-python-3.11" \
summary="CUDA Python 3.11 base image for ODH notebooks" \
description="CUDA Python 3.11 builder image based on CentOS Stream 9 for ODH notebooks" \
Expand All @@ -20,7 +22,7 @@ ENV NVARCH x86_64
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.1 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526"
ENV NV_CUDA_CUDART_VERSION 12.1.105-1

COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo

RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${NVARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
Expand All @@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64

COPY NGC-DL-CONTAINER-LICENSE /
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
Expand Down
6 changes: 4 additions & 2 deletions cuda/c9s-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=cuda/c9s-python-3.9

LABEL name="odh-notebook-cuda-c9s-python-3.9" \
summary="CUDA Python 3.9 base image for ODH notebooks" \
description="CUDA Python 3.9 builder image based on CentOS Stream 9 for ODH notebooks" \
Expand All @@ -20,7 +22,7 @@ ENV NVARCH x86_64
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.1 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526"
ENV NV_CUDA_CUDART_VERSION 12.1.105-1

COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo

RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${NVARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
Expand All @@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64

COPY NGC-DL-CONTAINER-LICENSE /
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
Expand Down
6 changes: 4 additions & 2 deletions cuda/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=cuda/ubi9-python-3.11

LABEL name="odh-notebook-cuda-ubi9-python-3.11" \
summary="CUDA Python 3.11 base image for ODH notebooks" \
description="CUDA Python 3.11 builder image based on UBI9 for ODH notebooks" \
Expand All @@ -20,7 +22,7 @@ ENV NVARCH x86_64
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.4 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526 brand=tesla,driver>=535,driver<536 brand=unknown,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=geforce,driver>=535,driver<536 brand=geforcertx,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=titan,driver>=535,driver<536 brand=titanrtx,driver>=535,driver<536"
ENV NV_CUDA_CUDART_VERSION 12.4.127-1

COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo

RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${NVARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
Expand All @@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64

COPY NGC-DL-CONTAINER-LICENSE /
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
Expand Down
6 changes: 4 additions & 2 deletions cuda/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=cuda/ubi9-python-3.9

LABEL name="odh-notebook-cuda-ubi9-python-3.9" \
summary="CUDA Python 3.9 base image for ODH notebooks" \
description="CUDA Python 3.9 builder image based on UBI8 for ODH notebooks" \
Expand All @@ -20,7 +22,7 @@ ENV NVARCH x86_64
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.1 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526"
ENV NV_CUDA_CUDART_VERSION 12.1.105-1

COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo

RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${NVARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
Expand All @@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64

COPY NGC-DL-CONTAINER-LICENSE /
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
Expand Down
2 changes: 2 additions & 0 deletions intel/base/gpu/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=intel/base/gpu/ubi9-python-3.11

LABEL name="odh-notebook-intel-base-gpu-ubi9-python-3.11" \
summary="Intel® XPU base image for ODH notebooks based on ubi9" \
description="Base Intel® XPU base image builder image based on ubi9 for ODH notebooks" \
Expand Down
2 changes: 2 additions & 0 deletions intel/base/gpu/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=intel/base/gpu/ubi9-python-3.9

LABEL name="odh-notebook-intel-base-gpu-ubi9-python-3.9" \
summary="Intel® XPU base image for ODH notebooks based on ubi9" \
description="Base Intel® XPU base image builder image based on ubi9 for ODH notebooks" \
Expand Down
8 changes: 5 additions & 3 deletions intel/runtimes/ml/ubi9-python-3.11/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=intel/runtimes/ml/ubi9-python-3.11

LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.11" \
summary="Runtime Intel® optimized ML notebook image for ODH notebooks" \
description="Runtime Intel® optimized ML notebook image with base Python 3.11 builder image based on UBI9 for ODH notebooks" \
Expand All @@ -14,12 +16,12 @@ LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.11" \
WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY Pipfile.lock Pipfile.lock
COPY ${SOURCE_CODE}/Pipfile.lock Pipfile.lock

# Copy Elyra dependencies for air-gapped enviroment
COPY utils utils
COPY ${SOURCE_CODE}/utils utils

COPY --chown=1001:0 .patch_sklearn.py /opt/app-root/bin/.patch_sklearn.py
COPY --chown=1001:0 ${SOURCE_CODE}/.patch_sklearn.py /opt/app-root/bin/.patch_sklearn.py
ENV PYTHONSTARTUP="/opt/app-root/bin/.patch_sklearn.py"

#Virtualenv creates a symlink of lib to lib64. That causes issues with importing ITEX since both locations will have ITEX library and it will conflict.
Expand Down
8 changes: 5 additions & 3 deletions intel/runtimes/ml/ubi9-python-3.9/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

ARG SOURCE_CODE=intel/runtimes/ml/ubi9-python-3.9

LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.9" \
summary="Runtime Intel® optimized ML notebook image for ODH notebooks" \
description="Runtime Intel® optimized ML notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
Expand All @@ -14,12 +16,12 @@ LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.9" \
WORKDIR /opt/app-root/bin

# Install Python packages from Pipfile.lock
COPY Pipfile.lock Pipfile.lock
COPY ${SOURCE_CODE}/Pipfile.lock Pipfile.lock

# Copy Elyra dependencies for air-gapped enviroment
COPY utils utils
COPY ${SOURCE_CODE}/utils utils

COPY --chown=1001:0 .patch_sklearn.py /opt/app-root/bin/.patch_sklearn.py
COPY --chown=1001:0 ${SOURCE_CODE}/.patch_sklearn.py /opt/app-root/bin/.patch_sklearn.py
ENV PYTHONSTARTUP="/opt/app-root/bin/.patch_sklearn.py"

#Virtualenv creates a symlink of lib to lib64. That causes issues with importing ITEX since both locations will have ITEX library and it will conflict.
Expand Down
Loading

0 comments on commit 03c3b6f

Please sign in to comment.