diff --git a/docker/Dockerfile b/docker/Dockerfile
index d18eebc..ac71a65 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -9,6 +9,8 @@ USER modelscoring
WORKDIR /home/modelscoring/
ADD $MODEL_SCORING_PACKAGE .
+EXPOSE 9100
+
WORKDIR /home/modelscoring/
ENTRYPOINT [ "bin/model-scoring.sh" ]
diff --git a/docker/build.sh b/docker/build.sh
index f325257..dc26c3c 100755
--- a/docker/build.sh
+++ b/docker/build.sh
@@ -37,7 +37,7 @@ echo Base name $NAME
NAME=${NAME//.zip/}
echo Base name $NAME
-echo docker build --file=Dockerfile --tag=scoring-engine \
+echo docker build --file=Dockerfile --tag=scoring-engine-$BUILD_NUMBER \
--build-arg HTTP_PROXY=$http_proxy \
--build-arg HTTPS_PROXY=$http_proxy \
--build-arg NO_PROXY=$no_proxy \
@@ -46,7 +46,7 @@ echo docker build --file=Dockerfile --tag=scoring-engine \
--build-arg no_proxy=$no_proxy \
--build-arg MODEL_SCORING_PACKAGE=$NAME \
.
-docker build --file=Dockerfile --tag=scoring-engine \
+docker build --file=Dockerfile --tag=scoring-engine-$BUILD_NUMBER \
--build-arg HTTP_PROXY=$http_proxy \
--build-arg HTTPS_PROXY=$http_proxy \
--build-arg NO_PROXY=$no_proxy \
@@ -56,3 +56,50 @@ docker build --file=Dockerfile --tag=scoring-engine \
--build-arg MODEL_SCORING_PACKAGE=$NAME \
.
+mars=$(find `pwd` -name "*.mar" -type f )
+IFS=$'\n'
+for mar in $mars
+do
+ echo
+ echo $mar
+ MARNAME="`basename $mar`"
+ echo Base name $MARNAME
+ MARNAME=${MARNAME//.mar/}
+ echo Base name $MARNAME
+ docker kill $MARNAME-$BUILD_NUMBER
+ docker rm $MARNAME-$BUILD_NUMBER
+done
+
+for mar in $mars
+do
+ echo
+ echo $mar
+ MARNAME="`basename $mar`"
+ echo Base name $MARNAME
+ MARNAME=${MARNAME//.mar/}
+ echo Base name $MARNAME
+ DOCKERCONT=$MARNAME-$BUILD_NUMBER
+ docker kill $DOCKERCONT
+ docker rm $DOCKERCONT
+ docker run -it -d -p 9100:9100 --name=$DOCKERCONT scoring-engine-$BUILD_NUMBER
+ MAX=20
+ code=$(curl -s -o /dev/null localhost:9100 -w "%{http_code}")
+ count=$((0))
+ while [ $code -ne 200 ] && [ $count -lt $MAX ];
+ do
+ echo $code
+ code=$(curl -s -o /dev/null localhost:9100 -w "%{http_code}")
+ count=$((0+1))
+ sleep 1
+ done
+ code=$(curl -F "file=@$mar" -s -o /dev/null localhost:9100/uploadMarFile -w "%{http_code}")
+ if [ $code -ge 200 ] && [ $code -lt 400 ]; then
+ echo yes $code
+ else
+ echo failed to load model $mar, http status code $code
+ docker logs $DOCKERCONT
+ exit 1
+ fi
+ docker kill $DOCKERCONT
+ docker rm $DOCKERCONT
+done
\ No newline at end of file
diff --git a/model-scoring-core/bin/model-scoring.sh b/model-scoring-core/bin/model-scoring.sh
index 663762e..d48f902 100755
--- a/model-scoring-core/bin/model-scoring.sh
+++ b/model-scoring-core/bin/model-scoring.sh
@@ -27,11 +27,8 @@ export HOSTNAME=`hostname`
# It is difficult to modify the library path for dynamic libraries after the Java process has started
# LD_LIBRARY_PATH allows the OS to find the dynamic libraries and any dependencies
export MODEL_TMP_DIR=`mktemp -d -t tap-scoring-modelXXXXXXXXXXXXXXXXXX`
-
-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MODEL_TMP_DIR
-
MODEL_SCORING_MAIN="org.trustedanalytics.scoring.MyMainFunction"
diff --git a/model-scoring-core/bin/scoring-server.sh b/model-scoring-core/bin/scoring-server.sh
index 53444b3..77f8fe5 100755
--- a/model-scoring-core/bin/scoring-server.sh
+++ b/model-scoring-core/bin/scoring-server.sh
@@ -15,10 +15,10 @@
# limitations under the License.
#
-#set -o errexit
DIR="$( cd "$( dirname "$0" )" && pwd )"
pushd $DIR/..
+
pwd
export HOSTNAME=`hostname`
diff --git a/model-scoring-core/conf/application.conf.scoring b/model-scoring-core/conf/application.conf.scoring
index e55924b..ecf9d0e 100644
--- a/model-scoring-core/conf/application.conf.scoring
+++ b/model-scoring-core/conf/application.conf.scoring
@@ -2,7 +2,7 @@
#The mar file path can be provided on the command line with a java property
#-Dtrustedanalytics.scoring-engine.archive-mar="SOME_PATH"
trustedanalytics.scoring-engine {
- archive-mar = "hdfs://SOME_PATH/SOME_TAR"
+ archive-mar = ""
}
#-Dtrustedanalytics.scoring.port="SOME_PORT"
diff --git a/model-scoring-core/pom.xml b/model-scoring-core/pom.xml
index e7ec13d..11e3afc 100644
--- a/model-scoring-core/pom.xml
+++ b/model-scoring-core/pom.xml
@@ -69,9 +69,6 @@
-
- maven-compiler-plugin
-
net.alchim31.maven
scala-maven-plugin
diff --git a/pom.xml b/pom.xml
index ab84b67..04108ac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,7 +130,9 @@
1.3.2
+ org.apache.maven.plugins
maven-compiler-plugin
+ 3.6.0
default-compile
@@ -258,11 +260,9 @@
+ org.apache.maven.plugins
maven-compiler-plugin
-
-
- com.mycila
- license-maven-plugin
+ 3.6.0
com.mycila