Skip to content

Commit

Permalink
fix push of conda base image (#3406)
Browse files Browse the repository at this point in the history
* fix push of conda base image

* fix problem with not setting conda version

* redhat image = local image

* remove build_all_local as all builds are local
  • Loading branch information
RafalSkolasinski authored Jul 19, 2021
1 parent a40e5cb commit 1fe87a2
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 43 deletions.
2 changes: 1 addition & 1 deletion testing/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ port-forward-ambassador:

.PHONY: s2i_build_base_images
s2i_build_base_images:
cd ../../wrappers/s2i/python/build_scripts && ./build_all_local.sh
cd ../../wrappers/s2i/python/build_scripts && ./build_all.sh

.PHONY: build_protos
build_protos:
Expand Down
6 changes: 5 additions & 1 deletion wrappers/s2i/python/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
ARG CONDA_VERSION
ARG BASE_IMAGE
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
# Note: ARGs must be after FROM statement , see source:
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact

ARG PYTHON_VERSION
ARG CONDA_VERSION

RUN conda install --yes python=$PYTHON_VERSION conda=$CONDA_VERSION
RUN dnf install -y make automake gcc gcc-c++

Expand Down
29 changes: 0 additions & 29 deletions wrappers/s2i/python/Dockerfile.redhat

This file was deleted.

10 changes: 5 additions & 5 deletions wrappers/s2i/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ get_local_repo:
.PHONY: build
build: get_local_repo
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) .
docker tag $(IMAGE_NAME):$(IMAGE_VERSION) $(IMAGE_NAME)-ubi8:$(IMAGE_VERSION)

.PHONY: build_gpu
build_gpu: get_local_repo
Expand All @@ -33,14 +34,10 @@ build_gpu: get_local_repo
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=${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} --build-arg IMAGE_VERSION=${IMAGE_VERSION} -t $(IMAGE_NAME)-ubi8:$(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)-ubi8:$(IMAGE_VERSION) .


tag_base_python:
Expand Down Expand Up @@ -84,3 +81,6 @@ after_build_image_seldon_core_check:

build_conda_base:
docker build -f Dockerfile.conda --build-arg CONDA_VERSION=${CONDA_VERSION} -t ${CONDA_BASE_IMAGE}:${IMAGE_VERSION} .

push_to_dockerhub_conda_base:
docker push $(CONDA_BASE_IMAGE):$(IMAGE_VERSION)
3 changes: 1 addition & 2 deletions wrappers/s2i/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
e.g. from 0.3-SNAPSHOT to release 0.3 and create 0.4-SNAPSHOT

* set IMAGE_VERSION to new stable version X in Makefile (e.g. 0.3)
* ```cd build_scripts``` and run ```./build_all.sh``` (OR ```./build_all_local.sh``` if pypi not updated yet) and then ```./push_all.sh```
* ```cd build_scripts``` and run ```./build_all.sh``` and then ```./push_all.sh```
* Update IMAGE_VERSION to (X+1)-SNAPSHOT (e.g. 0.4-SNAPSHOT)
* ```./build_all.sh``` and then ```./push_all.sh```
* Update main readme to show new versions of stable and snapshot
* Update versions in docs, Makefiles and notebooks of stable version
``` ./update_python_version.sh X X+1```, e.g ```./update_python_version.sh 0.2 0.3```
(check that any references to X-SNAPSHOT are updated to X - may need manual intervention)
* Update the `doc/source/reference/images.md` manually with the latest image versions

4 changes: 0 additions & 4 deletions wrappers/s2i/python/build_scripts/build_all_local.sh

This file was deleted.

1 change: 0 additions & 1 deletion wrappers/s2i/python/build_scripts/build_local_redhat.sh

This file was deleted.

1 change: 1 addition & 0 deletions wrappers/s2i/python/build_scripts/push_all.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
./push_conda_base.sh
./push_python3.6.sh
./push_python3.7.sh
./push_python3.6_gpu.sh
Expand Down
1 change: 1 addition & 0 deletions wrappers/s2i/python/build_scripts/push_conda_base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
make -C ../ push_to_dockerhub_conda_base

0 comments on commit 1fe87a2

Please sign in to comment.