Skip to content

Commit

Permalink
Updating all python wrappers to use new base 3.7.10 (including all de…
Browse files Browse the repository at this point in the history
…pendent images) (SeldonIO#3381)

* Updating python version

* Updated release build scripts

* Updated wrappers scripts

* Updated wrappers scripts

* Updated wrappers scripts

* Modified sklearn folder to force rebuild

* Modified folder to force rebuild
  • Loading branch information
axsaucedo authored Jul 8, 2021
1 parent 87d78e7 commit 697ee2f
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 32 deletions.
6 changes: 2 additions & 4 deletions ci_build_and_push_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ fi

function build_push_python {
(cd wrappers/s2i/python/build_scripts \
&& ./build_all_local.sh \
&& ./push_all.sh \
&& ./build_redhat.sh \
&& ./push_redhat.sh)
&& ./build_all.sh \
&& ./push_all.sh)
PYTHON_EXIT_VALUE=$?
}

Expand Down
1 change: 1 addition & 0 deletions components/alibi-detect-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ redhat-image-scan:
echo $${rh_password_alibi_detect} | docker login -u unused scan.connect.redhat.com --password-stdin
docker tag ${REPO}/${IMAGE}:${VERSION} scan.connect.redhat.com/ospid-32ed6498-bce5-4c3b-9486-fe1c6e2582d3/${IMAGE}:${VERSION}
docker push scan.connect.redhat.com/ospid-32ed6498-bce5-4c3b-9486-fe1c6e2582d3/${IMAGE}:${VERSION}

1 change: 1 addition & 0 deletions components/alibi-explain-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,4 @@ run_explainer_triton_cifar10_docker:
curl_explain_triton_cifar10_image:
curl -d @tests/data/truck-v2.json -X POST http://localhost:8080/v2/models/cifar10/explain -H "Content-Type: application/json"


1 change: 1 addition & 0 deletions examples/models/mean_classifier/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ redhat-image-scan:
docker push scan.connect.redhat.com/${scan}/${IMAGE_NAME_BASE}:${VERSION}



1 change: 0 additions & 1 deletion servers/sklearnserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ redhat-image-scan:
docker tag ${IMAGE_NAME}:${VERSION} scan.connect.redhat.com/${scan}/${IMAGE_NAME_BASE}:${VERSION}
docker push scan.connect.redhat.com/${scan}/${IMAGE_NAME_BASE}:${VERSION}


8 changes: 5 additions & 3 deletions wrappers/s2i/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
ARG CONDA_VERSION
ARG BASE_IMAGE
FROM $BASE_IMAGE:$CONDA_VERSION
ARG IMAGE_VERSION
FROM $BASE_IMAGE:$IMAGE_VERSION

LABEL io.openshift.s2i.scripts-url="image:///s2i/bin"

# This is to install desired version of Python without updating conda version
ARG PYTHON_VERSION
RUN conda install --yes python=$PYTHON_VERSION conda=$CONDA_VERSION
RUN apt-get update --yes && apt-get install --yes gcc make build-essential
RUN dnf install -y make automake gcc gcc-c++

# Upgrade pip version
RUN pip install pip==20.2
RUN pip install pip==20.2 setuptools==46.1

RUN mkdir microservice
WORKDIR /microservice
Expand All @@ -24,5 +25,6 @@ COPY _python/python/licenses/license.txt .
RUN pip install -r requirements.txt

RUN mkdir -p /.conda && chmod a+rwx /.conda
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical

EXPOSE 5000
11 changes: 7 additions & 4 deletions wrappers/s2i/python/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
ARG CONDA_VERSION
ARG BASE_IMAGE
FROM $BASE_IMAGE:$CONDA_VERSION
ARG IMAGE_VERSION
FROM $BASE_IMAGE:$IMAGE_VERSION

LABEL io.openshift.s2i.scripts-url="image:///s2i/bin"

# This is to install desired version of Python without updating conda version
ARG PYTHON_VERSION
RUN conda install --yes python=$PYTHON_VERSION conda=$CONDA_VERSION
RUN apt-get update --yes && apt-get install --yes gcc make build-essential
RUN dnf install -y make automake gcc gcc-c++

# Pin pip and setuptools
RUN pip install pip==20.2 setuptools==46.1
Expand All @@ -17,11 +18,13 @@ WORKDIR /microservice

COPY ./s2i/bin/ /s2i/bin

# Install Seldon Core from local copy
COPY _python /microservice
# keep install of seldon-core after the COPY to force re-build of layer
COPY version.txt /microservice/version.txt
COPY _python/python/licenses/license.txt .
COPY _python /microservice
RUN cd /microservice/python && pip install .

RUN mkdir -p /.conda && chmod a+rwx /.conda
RUN yum -y update-minimal --security --sec-severity=Important --sec-severity=Critical

EXPOSE 5000
3 changes: 2 additions & 1 deletion wrappers/s2i/python/Dockerfile.redhat
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG CONDA_VERSION
ARG IMAGE_VERSION
ARG BASE_IMAGE
FROM $BASE_IMAGE:$CONDA_VERSION
FROM $BASE_IMAGE:$IMAGE_VERSION

LABEL io.openshift.s2i.scripts-url="image:///s2i/bin"

Expand Down
16 changes: 10 additions & 6 deletions wrappers/s2i/python/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
IMAGE_VERSION := $(shell cat ../../../version.txt)
SHELL:=/bin/bash

PYTHON_VERSION=3.7
PYTHON_VERSION=3.7.10
CONDA_VERSION=4.7.12
IMAGE_PYTHON_VERSION=`echo -n $(PYTHON_VERSION) | sed 's/\.//g'`
IMAGE_PYTHON_VERSION=`echo -n $(PYTHON_VERSION) | cut -d. -f1-2 | sed 's/\.//g'`
DEFAULT_IMAGE_PYTHON_VERSION=`echo -n $(PYTHON_VERSION) | cut -d. -f1`
IMAGE_NAME = docker.io/seldonio/seldon-core-s2i-python${IMAGE_PYTHON_VERSION}
DEFAULT_IMAGE_NAME = docker.io/seldonio/seldon-core-s2i-python${DEFAULT_IMAGE_PYTHON_VERSION}
Expand All @@ -23,19 +23,23 @@ get_local_repo:

.PHONY: build
build: get_local_repo
set -x && docker build -f Dockerfile --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${BASE_IMAGE} -t $(IMAGE_NAME):$(IMAGE_VERSION) .
set -x && docker build -f Dockerfile --build-arg IMAGE_VERSION=${IMAGE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${CONDA_BASE_IMAGE} -t $(IMAGE_NAME):$(IMAGE_VERSION) .

.PHONY: build_gpu
build_gpu: get_local_repo
docker build -f Dockerfile.gpu --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} -t ${GPU_IMAGE_NAME}:${IMAGE_VERSION} .

.PHONY: build_local
build_local: get_local_repo
set -x && docker build -f Dockerfile.local --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${BASE_IMAGE} -t $(IMAGE_NAME):$(IMAGE_VERSION) .
set -x && docker build -f Dockerfile.local --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${CONDA_BASE_IMAGE} --build-arg IMAGE_VERSION=${IMAGE_VERSION} -t $(IMAGE_NAME):$(IMAGE_VERSION) .

.PHONY: build_local
build_local_redhat: get_local_repo
set -x && docker build -f Dockerfile.local --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${CONDA_BASE_IMAGE} --build-arg IMAGE_VERSION=${IMAGE_VERSION} -t $(IMAGE_NAME)-ubi8:$(IMAGE_VERSION) .

.PHONY: build_redhat
build_redhat: get_local_repo
set -x && docker build -f Dockerfile.redhat --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${CONDA_BASE_IMAGE} -t $(IMAGE_NAME)-ubi8:$(IMAGE_VERSION) .
set -x && docker build -f Dockerfile.redhat --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg CONDA_VERSION=${CONDA_VERSION} --build-arg BASE_IMAGE=${CONDA_BASE_IMAGE} --build-arg IMAGE_VERSION=${IMAGE_VERSION} -t $(IMAGE_NAME)-ubi8:$(IMAGE_VERSION) .



Expand Down Expand Up @@ -79,4 +83,4 @@ after_build_image_seldon_core_check:


build_conda_base:
docker build -f Dockerfile.conda --build-arg CONDA_VERSION=${CONDA_VERSION} -t ${CONDA_BASE_IMAGE}:${CONDA_VERSION} .
docker build -f Dockerfile.conda --build-arg CONDA_VERSION=${CONDA_VERSION} -t ${CONDA_BASE_IMAGE}:${IMAGE_VERSION} .
5 changes: 4 additions & 1 deletion wrappers/s2i/python/build_scripts/build_all.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
./build_conda_base.sh
./build_python3.6.sh
./build_python3.6_gpu.sh
./build_python3.7.sh
./build_python_gpu.sh
./build_python3.7_gpu.sh
./build_redhat.sh
5 changes: 2 additions & 3 deletions wrappers/s2i/python/build_scripts/build_all_local.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
./build_conda_base.sh
./build_local_python3.6.sh
./build_local_python3.7.sh
./build_python3.6_gpu.sh
./build_python3.7_gpu.sh
./build_redhat.sh
./build_local_redhat.sh
1 change: 1 addition & 0 deletions wrappers/s2i/python/build_scripts/build_conda_base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make -C ../ build_conda_base
4 changes: 2 additions & 2 deletions wrappers/s2i/python/build_scripts/build_local_python3.7.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
make -C ../ build_local PYTHON_VERSION=3.7
make -C ../ tag_base_python PYTHON_VERSION=3.7
make -C ../ build_local PYTHON_VERSION=3.7.10
make -C ../ tag_base_python PYTHON_VERSION=3.7.10
1 change: 1 addition & 0 deletions wrappers/s2i/python/build_scripts/build_local_redhat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make -C ../ build_local_redhat
4 changes: 2 additions & 2 deletions wrappers/s2i/python/build_scripts/build_python3.7.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
make -C ../ build PYTHON_VERSION=3.7
make -C ../ tag_base_python PYTHON_VERSION=3.7
make -C ../ build PYTHON_VERSION=3.7.10
make -C ../ tag_base_python PYTHON_VERSION=3.7.10
2 changes: 1 addition & 1 deletion wrappers/s2i/python/build_scripts/build_python3.7_gpu.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
make -C ../ build_gpu PYTHON_VERSION=3.7
make -C ../ build_gpu PYTHON_VERSION=3.7.10
1 change: 0 additions & 1 deletion wrappers/s2i/python/build_scripts/build_redhat.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
make -C ../ build_conda_base
make -C ../ build_redhat
4 changes: 2 additions & 2 deletions wrappers/s2i/python/build_scripts/push_python3.7.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
make -C ../ push_to_dockerhub PYTHON_VERSION=3.7
make -C ../ push_to_dockerhub_base_python PYTHON_VERSION=3.7
make -C ../ push_to_dockerhub PYTHON_VERSION=3.7.10
make -C ../ push_to_dockerhub_base_python PYTHON_VERSION=3.7.10
2 changes: 1 addition & 1 deletion wrappers/s2i/python/build_scripts/push_python3.7_gpu.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
make -C ../ push_gpu_to_dockerhub PYTHON_VERSION=3.7
make -C ../ push_gpu_to_dockerhub PYTHON_VERSION=3.7.10

0 comments on commit 697ee2f

Please sign in to comment.