File tree Expand file tree Collapse file tree 5 files changed +28
-10
lines changed
tensorflow/ubi9-python-3.9
tensorflow/ubi9-python-3.9 Expand file tree Collapse file tree 5 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 1
- CONTAINER_ENGINE ?= podman
2
1
IMAGE_REGISTRY ?= quay.io/opendatahub/workbench-images
3
2
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
+
5
13
IMAGE_TAG ?= $(RELEASE ) _$(DATE )
6
14
KUBECTL_BIN ?= bin/kubectl
7
15
KUBECTL_VERSION ?= v1.23.11
@@ -10,6 +18,16 @@ REQUIRED_RUNTIME_IMAGE_COMMANDS="curl python3"
10
18
REQUIRED_CODE_SERVER_IMAGE_COMMANDS ="curl python oc code-server"
11
19
REQUIRED_R_STUDIO_IMAGE_COMMANDS ="curl python oc /usr/lib/rstudio-server/bin/rserver"
12
20
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
13
31
14
32
# Build function for the notebok image:
15
33
# ARG 1: Image tag name.
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ ENV CPU_ENV=/opt/app-root-cpu
44
44
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
45
45
46
46
# 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} && \
49
49
chown -R 1001:0 ${CPU_ENV} && \
50
50
fix-permissions ${CPU_ENV} -P && \
51
51
source ${CPU_ENV}/bin/activate && \
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ ENV CPU_ENV=/opt/app-root-cpu
47
47
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
48
48
49
49
# 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} && \
52
52
chown -R 1001:0 ${CPU_ENV} && \
53
53
fix-permissions ${CPU_ENV} -P && \
54
54
unlink ${CPU_ENV}/lib64 && \
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ COPY --chown=1001:0 utils /opt/app-root/bin/utils
34
34
# CPU env
35
35
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
36
36
37
- RUN cd ${CPU_ENV} && \
38
- source ${CPU_ENV}/bin/activate && \
37
+ WORKDIR ${CPU_ENV}
38
+ RUN source ${CPU_ENV}/bin/activate && \
39
39
micropipenv install && \
40
40
rm -f ./Pipfile.lock && \
41
41
python -m ipykernel install --prefix=/opt/app-root --name 'pytorch-cpu' --display-name='pytorch-cpu' && \
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ COPY --chown=1001:0 utils /opt/app-root/bin/utils
34
34
# CPU env
35
35
COPY --chown=1001:0 Pipfile.lock.cpu ${CPU_ENV}/Pipfile.lock
36
36
37
- RUN cd ${CPU_ENV} && \
38
- source ${CPU_ENV}/bin/activate && \
37
+ WORKDIR ${CPU_ENV}
38
+ RUN source ${CPU_ENV}/bin/activate && \
39
39
micropipenv install && \
40
40
rm -f ./Pipfile.lock && \
41
41
python -m ipykernel install --prefix=/opt/app-root --name 'tensorflow-cpu' --display-name='tensorflow-cpu' && \
You can’t perform that action at this time.
0 commit comments