-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assaf-java-s2i-update #2178
Merged
Merged
assaf-java-s2i-update #2178
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a1518f8
updated project
amoldavsky e1afd42
updated maven compiler java versions
amoldavsky 083ebf6
cleanup
amoldavsky 1058854
fixed Spring 2 maven plugin jar packaging
amoldavsky 3b829dc
updated Java S2I build
amoldavsky 74099a4
Merge branch 'master' of https://github.com/amoldavsky/seldon-core in…
amoldavsky ff5176c
Merge branch 'master' of https://github.com/amoldavsky/seldon-core in…
amoldavsky 325d293
added doc
amoldavsky 36ad50a
CR update
amoldavsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM openjdk:8u131-jre-alpine | ||
ARG IMAGE_SOURCE=openjdk:8u131-jre-alpine | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly as above, could you also bump the runtime base to |
||
FROM $IMAGE_SOURCE | ||
|
||
RUN apk update && apk add bash | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Description: | ||
# This is a helper script to produce an S2I Build and S2I Runtime images | ||
# to build and run the Java Wrapper. This helper script provides the flexibility | ||
# to specify the source images to be used for the S2I Build and S2I Runtime images. | ||
# | ||
# This allows you to build a custom images based on different source / base images which | ||
# could be used for testing or pushed to Docker Hub. | ||
# | ||
# Example: | ||
# bash bin/build.sh \ | ||
# --build-source-image seldonio/core-builder:0.15 \ | ||
# --runtime-source-image adoptopenjdk/openjdk13:alpine-slim \ | ||
# jw-0.2.0-jre-13 | ||
# | ||
# will produce two images: | ||
# 1. docker.io/seldonio/seldon-core-s2i-java-build:jw-0.2.0-jre-13 | ||
# 1. docker.io/seldonio/seldon-core-s2i-java-runtime:jw-0.2.0-jre-13 | ||
# | ||
# Authors: | ||
# Assaf Moldavsky ([email protected]) | ||
# | ||
|
||
set -x | ||
|
||
# | ||
# Print the usage and exit. | ||
# | ||
function usage () { | ||
echo "Usage: $0 [OPTIONS] VERSION" | ||
echo "\r\n" | ||
echo "Options: " | ||
echo " --build-source-image (OPTIONAL) override the build image source image" | ||
echo " --build-runtime-image (OPTIONAL) override the runtime image source image" | ||
exit 1 | ||
} | ||
|
||
# Parse the arguments. | ||
# loop until last - 1, we assume the last arg is the model name | ||
while [[ $# -ge 2 ]] | ||
do | ||
key="$1" | ||
case ${key} in | ||
--build-source-image) | ||
BUILD_SOURCE_IMAGE="$2" | ||
shift # past key | ||
shift # past value | ||
;; | ||
--runtime-source-image) | ||
RUNTIME_SOURCE_IMAGE="$2" | ||
shift # past key | ||
shift # past value | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
# assign last parameter to model | ||
VERSION=${@:${#@}} | ||
IMAGE_BUILD_BUILD_ARGS="" | ||
IMAGE_RUNTIME_BUILD_ARGS="" | ||
|
||
# Validate the arguments. | ||
if [[ -z "$VERSION" ]]; then | ||
echo "Missing argument: VERSION." | ||
usage | ||
fi | ||
|
||
# Prepare Docker build args ( if supplied ) | ||
if ! [[ -z "$BUILD_SOURCE_IMAGE" ]]; then | ||
IMAGE_BUILD_BUILD_ARGS=$(echo "$IMAGE_BUILD_BUILD_ARGS --build-arg IMAGE_SOURCE=$BUILD_SOURCE_IMAGE" | awk '{$1=$1};1') | ||
fi | ||
if ! [[ -z "$RUNTIME_SOURCE_IMAGE" ]]; then | ||
IMAGE_RUNTIME_BUILD_ARGS=$(echo "$IMAGE_RUNTIME_BUILD_ARGS --build-arg IMAGE_SOURCE=$RUNTIME_SOURCE_IMAGE" | awk '{$1=$1};1') | ||
fi | ||
|
||
IMAGE_NAME_BUILD=docker.io/seldonio/seldon-core-s2i-java-build:${VERSION} | ||
IMAGE_NAME_RUNTIME=docker.io/seldonio/seldon-core-s2i-java-runtime:${VERSION} | ||
|
||
echo "S2I build image: building..." | ||
docker build \ | ||
-f Dockerfile.build \ | ||
-t ${IMAGE_NAME_BUILD} \ | ||
${IMAGE_BUILD_BUILD_ARGS} \ | ||
. | ||
echo "S2I build image: check Java version..." | ||
docker run --entrypoint "/bin/bash" ${IMAGE_NAME_BUILD} "-c" "java --version" | ||
|
||
echo "S2I runtime image: building..." | ||
docker build \ | ||
-f Dockerfile.runtime \ | ||
-t ${IMAGE_NAME_RUNTIME} \ | ||
${IMAGE_RUNTIME_BUILD_ARGS} \ | ||
. | ||
echo "S2I runtime image: check Java version..." | ||
docker run --entrypoint "/bin/bash" ${IMAGE_NAME_RUNTIME} "-c" "java --version" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try bumping the
core-builder
image to0.16
(which is the latest)?