Skip to content

Commit 03c3b6f

Browse files
authored
RHOAIENG-11274: chore(Makefile): widen the container build context to the whole repo, so we can start reusing code between images in the future (opendatahub-io#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
1 parent ecd9e76 commit 03c3b6f

File tree

56 files changed

+294
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+294
-172
lines changed

.dockerignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.git/
2+
.idea/
3+
.venv/
4+
bin/
5+
ci/
6+
tests/
7+
8+
**/.mypy_cache/
9+
**/.pytest_cache/
10+
**/__pycache__/
11+
**/*.pyc
12+
13+
**/Dockerfile

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
2+
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
3+
14
# https://tech.davis-hansson.com/p/make/
25
SHELL := bash
36
# todo: do not set .ONESHELL: for now
@@ -65,7 +68,7 @@ define build_image
6568
$(eval BUILD_ARGS := --build-arg BASE_IMAGE=$(BASE_IMAGE_NAME)),
6669
$(eval BUILD_ARGS :=)
6770
)
68-
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) -t $(IMAGE_NAME) $(BUILD_ARGS) $(2)
71+
$(CONTAINER_ENGINE) build $(CONTAINER_BUILD_CACHE_ARGS) --tag $(IMAGE_NAME) --file $(2)/Dockerfile $(BUILD_ARGS) $(ROOT_DIR)/
6972
endef
7073

7174
# Push function for the notebok image:

base/c9s-python-3.11/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM quay.io/sclorg/python-311-c9s:c9s
22

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

1820
# Install Python dependencies from Pipfile.lock file
19-
COPY Pipfile.lock ./
21+
COPY ${SOURCE_CODE}/Pipfile.lock ./
2022

2123
# OS Packages needs to be installed as root
2224
USER root

base/c9s-python-3.9/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM quay.io/sclorg/python-39-c9s:c9s
22

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

1820
# Install Python dependencies from Pipfile.lock file
19-
COPY Pipfile.lock ./
21+
COPY ${SOURCE_CODE}/Pipfile.lock ./
2022

2123
# OS Packages needs to be installed as root
2224
USER root

base/ubi9-python-3.11/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM registry.access.redhat.com/ubi9/python-311:latest
22

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

1820
# Install Python dependencies from Pipfile.lock file
19-
COPY Pipfile.lock ./
21+
COPY ${SOURCE_CODE}/Pipfile.lock ./
2022

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

base/ubi9-python-3.9/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM registry.access.redhat.com/ubi9/python-39:latest
22

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

1820
# Install Python dependencies from Pipfile.lock file
19-
COPY Pipfile.lock ./
21+
COPY ${SOURCE_CODE}/Pipfile.lock ./
2022

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

codeserver/ubi9-python-3.11/Dockerfile

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=codeserver/ubi9-python-3.11
45
ARG CODESERVER_VERSION=v4.92.2
56

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

2021
# Install usefull packages from Pipfile.lock
21-
COPY Pipfile.lock ./
22+
COPY ${SOURCE_CODE}/Pipfile.lock ./
2223

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

42-
COPY --chown=1001:0 utils utils/
43+
COPY --chown=1001:0 ${SOURCE_CODE}/utils utils/
4344

4445
# 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.
4546
RUN mkdir -p /opt/app-root/extensions-temp && \
@@ -64,10 +65,10 @@ RUN yum install -y https://download.fedoraproject.org/pub/epel/epel-release-late
6465
rpm -V $INSTALL_PKGS && \
6566
yum -y clean all --enablerepo='*'
6667

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

6970
# Copy extra files to the image.
70-
COPY nginx/root/ /
71+
COPY ${SOURCE_CODE}/nginx/root/ /
7172

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

106107
## Configure nginx
107-
COPY nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
108-
COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/
109-
COPY nginx/api/ /opt/app-root/api/
108+
COPY ${SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
109+
COPY ${SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
110+
COPY ${SOURCE_CODE}/nginx/api/ /opt/app-root/api/
110111

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

114115
ENV SHELL /bin/bash
115116

codeserver/ubi9-python-3.9/Dockerfile

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=codeserver/ubi9-python-3.9
45
ARG CODESERVER_VERSION=v4.92.2
56

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

2021
# Install usefull packages from Pipfile.lock
21-
COPY Pipfile.lock ./
22+
COPY ${SOURCE_CODE}/Pipfile.lock ./
2223

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

42-
COPY --chown=1001:0 utils utils/
43+
COPY --chown=1001:0 ${SOURCE_CODE}/utils utils/
4344

4445
# 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.
4546
RUN mkdir -p /opt/app-root/extensions-temp && \
@@ -64,10 +65,10 @@ RUN yum install -y https://download.fedoraproject.org/pub/epel/epel-release-late
6465
rpm -V $INSTALL_PKGS && \
6566
yum -y clean all --enablerepo='*'
6667

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

6970
# Copy extra files to the image.
70-
COPY nginx/root/ /
71+
COPY ${SOURCE_CODE}/nginx/root/ /
7172

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

106107
## Configure nginx
107-
COPY nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
108-
COPY nginx/httpconf/ /opt/app-root/etc/nginx.d/
109-
COPY nginx/api/ /opt/app-root/api/
108+
COPY ${SOURCE_CODE}/nginx/serverconf/ /opt/app-root/etc/nginx.default.d/
109+
COPY ${SOURCE_CODE}/nginx/httpconf/ /opt/app-root/etc/nginx.d/
110+
COPY ${SOURCE_CODE}/nginx/api/ /opt/app-root/api/
110111

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

114115
ENV SHELL /bin/bash
115116

cuda/c9s-python-3.11/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=cuda/c9s-python-3.11
5+
46
LABEL name="odh-notebook-cuda-c9s-python-3.11" \
57
summary="CUDA Python 3.11 base image for ODH notebooks" \
68
description="CUDA Python 3.11 builder image based on CentOS Stream 9 for ODH notebooks" \
@@ -20,7 +22,7 @@ ENV NVARCH x86_64
2022
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"
2123
ENV NV_CUDA_CUDART_VERSION 12.1.105-1
2224

23-
COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
25+
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
2426

2527
RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
2628
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 && \
@@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
4244
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
4345
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
4446

45-
COPY NGC-DL-CONTAINER-LICENSE /
47+
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /
4648

4749
# nvidia-container-runtime
4850
ENV NVIDIA_VISIBLE_DEVICES all

cuda/c9s-python-3.9/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=cuda/c9s-python-3.9
5+
46
LABEL name="odh-notebook-cuda-c9s-python-3.9" \
57
summary="CUDA Python 3.9 base image for ODH notebooks" \
68
description="CUDA Python 3.9 builder image based on CentOS Stream 9 for ODH notebooks" \
@@ -20,7 +22,7 @@ ENV NVARCH x86_64
2022
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"
2123
ENV NV_CUDA_CUDART_VERSION 12.1.105-1
2224

23-
COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
25+
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
2426

2527
RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
2628
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 && \
@@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
4244
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
4345
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
4446

45-
COPY NGC-DL-CONTAINER-LICENSE /
47+
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /
4648

4749
# nvidia-container-runtime
4850
ENV NVIDIA_VISIBLE_DEVICES all

cuda/ubi9-python-3.11/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=cuda/ubi9-python-3.11
5+
46
LABEL name="odh-notebook-cuda-ubi9-python-3.11" \
57
summary="CUDA Python 3.11 base image for ODH notebooks" \
68
description="CUDA Python 3.11 builder image based on UBI9 for ODH notebooks" \
@@ -20,7 +22,7 @@ ENV NVARCH x86_64
2022
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"
2123
ENV NV_CUDA_CUDART_VERSION 12.4.127-1
2224

23-
COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
25+
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
2426

2527
RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
2628
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 && \
@@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
4244
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
4345
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
4446

45-
COPY NGC-DL-CONTAINER-LICENSE /
47+
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /
4648

4749
# nvidia-container-runtime
4850
ENV NVIDIA_VISIBLE_DEVICES all

cuda/ubi9-python-3.9/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=cuda/ubi9-python-3.9
5+
46
LABEL name="odh-notebook-cuda-ubi9-python-3.9" \
57
summary="CUDA Python 3.9 base image for ODH notebooks" \
68
description="CUDA Python 3.9 builder image based on UBI8 for ODH notebooks" \
@@ -20,7 +22,7 @@ ENV NVARCH x86_64
2022
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"
2123
ENV NV_CUDA_CUDART_VERSION 12.1.105-1
2224

23-
COPY cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
25+
COPY ${SOURCE_CODE}/cuda.repo-x86_64 /etc/yum.repos.d/cuda.repo
2426

2527
RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
2628
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 && \
@@ -42,7 +44,7 @@ RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
4244
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
4345
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
4446

45-
COPY NGC-DL-CONTAINER-LICENSE /
47+
COPY ${SOURCE_CODE}/NGC-DL-CONTAINER-LICENSE /
4648

4749
# nvidia-container-runtime
4850
ENV NVIDIA_VISIBLE_DEVICES all

intel/base/gpu/ubi9-python-3.11/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=intel/base/gpu/ubi9-python-3.11
5+
46
LABEL name="odh-notebook-intel-base-gpu-ubi9-python-3.11" \
57
summary="Intel® XPU base image for ODH notebooks based on ubi9" \
68
description="Base Intel® XPU base image builder image based on ubi9 for ODH notebooks" \

intel/base/gpu/ubi9-python-3.9/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=intel/base/gpu/ubi9-python-3.9
5+
46
LABEL name="odh-notebook-intel-base-gpu-ubi9-python-3.9" \
57
summary="Intel® XPU base image for ODH notebooks based on ubi9" \
68
description="Base Intel® XPU base image builder image based on ubi9 for ODH notebooks" \

intel/runtimes/ml/ubi9-python-3.11/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=intel/runtimes/ml/ubi9-python-3.11
5+
46
LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.11" \
57
summary="Runtime Intel® optimized ML notebook image for ODH notebooks" \
68
description="Runtime Intel® optimized ML notebook image with base Python 3.11 builder image based on UBI9 for ODH notebooks" \
@@ -14,12 +16,12 @@ LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.11" \
1416
WORKDIR /opt/app-root/bin
1517

1618
# Install Python packages from Pipfile.lock
17-
COPY Pipfile.lock Pipfile.lock
19+
COPY ${SOURCE_CODE}/Pipfile.lock Pipfile.lock
1820

1921
# Copy Elyra dependencies for air-gapped enviroment
20-
COPY utils utils
22+
COPY ${SOURCE_CODE}/utils utils
2123

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

2527
#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.

intel/runtimes/ml/ubi9-python-3.9/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
ARG BASE_IMAGE
22
FROM ${BASE_IMAGE}
33

4+
ARG SOURCE_CODE=intel/runtimes/ml/ubi9-python-3.9
5+
46
LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.9" \
57
summary="Runtime Intel® optimized ML notebook image for ODH notebooks" \
68
description="Runtime Intel® optimized ML notebook image with base Python 3.9 builder image based on UBI9 for ODH notebooks" \
@@ -14,12 +16,12 @@ LABEL name="odh-notebook-intel-runtime-ml-ubi9-python-3.9" \
1416
WORKDIR /opt/app-root/bin
1517

1618
# Install Python packages from Pipfile.lock
17-
COPY Pipfile.lock Pipfile.lock
19+
COPY ${SOURCE_CODE}/Pipfile.lock Pipfile.lock
1820

1921
# Copy Elyra dependencies for air-gapped enviroment
20-
COPY utils utils
22+
COPY ${SOURCE_CODE}/utils utils
2123

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

2527
#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.

0 commit comments

Comments
 (0)