Skip to content

Commit 45db3ac

Browse files
authored
Merge pull request #473 from devcoons/main
Update Makefile: Add OS dependant generation of date, selection of proper cmd to locate container engine and automatically select available container engine
2 parents d4568c9 + c5c3af2 commit 45db3ac

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
CONTAINER_ENGINE ?= podman
21
IMAGE_REGISTRY ?= quay.io/opendatahub/workbench-images
32
RELEASE ?= 2023b
4-
DATE ?= $(shell date +'%Y%m%d')
3+
4+
# OS dependant: Generate date, select appropriate cmd to locate container engine
5+
ifeq ($(OS), Windows_NT)
6+
DATE ?= $(shell powershell -Command "Get-Date -Format 'yyyyMMdd'")
7+
WHERE_WHICH ?= where
8+
else
9+
DATE ?= $(shell date +'%Y%m%d')
10+
WHERE_WHICH ?= which
11+
endif
12+
513
IMAGE_TAG ?= $(RELEASE)_$(DATE)
614
KUBECTL_BIN ?= bin/kubectl
715
KUBECTL_VERSION ?= v1.23.11
@@ -10,6 +18,16 @@ REQUIRED_RUNTIME_IMAGE_COMMANDS="curl python3"
1018
REQUIRED_CODE_SERVER_IMAGE_COMMANDS="curl python oc code-server"
1119
REQUIRED_R_STUDIO_IMAGE_COMMANDS="curl python oc /usr/lib/rstudio-server/bin/rserver"
1220

21+
# Detect and select the system's available container engine
22+
ifeq (, $(shell $(WHERE_WHICH) podman))
23+
DOCKER := $(shell $(WHERE_WHICH) docker)
24+
ifeq (, $(DOCKER))
25+
$(error "Neither Docker nor Podman is installed. Please install one of them.")
26+
endif
27+
CONTAINER_ENGINE := docker
28+
else
29+
CONTAINER_ENGINE := podman
30+
endif
1331

1432
# Build function for the notebok image:
1533
# ARG 1: Image tag name.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ ENV CPU_ENV=/opt/app-root-cpu
4444
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
4545

4646
#CPU env
47-
RUN cd ${CPU_ENV} && \
48-
python3.9 -m venv ${CPU_ENV} && \
47+
WORKDIR ${CPU_ENV}
48+
RUN python3.9 -m venv ${CPU_ENV} && \
4949
chown -R 1001:0 ${CPU_ENV} && \
5050
fix-permissions ${CPU_ENV} -P && \
5151
source ${CPU_ENV}/bin/activate && \

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ ENV CPU_ENV=/opt/app-root-cpu
4747
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
4848

4949
#CPU env
50-
RUN cd ${CPU_ENV} && \
51-
python3.9 -m venv ${CPU_ENV} && \
50+
WORKDIR ${CPU_ENV}
51+
RUN python3.9 -m venv ${CPU_ENV} && \
5252
chown -R 1001:0 ${CPU_ENV} && \
5353
fix-permissions ${CPU_ENV} -P && \
5454
unlink ${CPU_ENV}/lib64 && \

jupyter/intel/pytorch/ubi9-python-3.9/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ COPY --chown=1001:0 utils /opt/app-root/bin/utils
3434
#CPU env
3535
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
3636

37-
RUN cd ${CPU_ENV} && \
38-
source ${CPU_ENV}/bin/activate && \
37+
WORKDIR ${CPU_ENV}
38+
RUN source ${CPU_ENV}/bin/activate && \
3939
micropipenv install && \
4040
rm -f ./Pipfile.lock && \
4141
python -m ipykernel install --prefix=/opt/app-root --name 'pytorch-cpu' --display-name='pytorch-cpu' && \

jupyter/intel/tensorflow/ubi9-python-3.9/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ COPY --chown=1001:0 utils /opt/app-root/bin/utils
3434
#CPU env
3535
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
3636

37-
RUN cd ${CPU_ENV} && \
38-
source ${CPU_ENV}/bin/activate && \
37+
WORKDIR ${CPU_ENV}
38+
RUN source ${CPU_ENV}/bin/activate && \
3939
micropipenv install && \
4040
rm -f ./Pipfile.lock && \
4141
python -m ipykernel install --prefix=/opt/app-root --name 'tensorflow-cpu' --display-name='tensorflow-cpu' && \

0 commit comments

Comments
 (0)