Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM clearlinux:latest

ARG HOME=/home/modelscoring
ARG MODEL_SCORING_PACKAGE

RUN useradd modelscoring && swupd bundle-add java-basic && java -version && javac -version

USER modelscoring
WORKDIR /home/modelscoring/
ADD $MODEL_SCORING_PACKAGE .

WORKDIR /home/modelscoring/
ENTRYPOINT [ "bin/model-scoring.sh" ]

58 changes: 58 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash
#
# Copyright (c) 2016 Intel Corporation 
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


MODEL_SCORING_PACKAGE=$(find `pwd`/../ -name "model-scoring-java-*.zip" -type f )

echo PATH `pwd`/../

echo $MODEL_SCORING_PACKAGE

if [ "$MODEL_SCORING_PACKAGE" == "" ]; then
echo "couldn't find model scoring java package"
exit 1
fi

echo MODEL_SCORING_PACKAGE $MODEL_SCORING_PACKAGE

unzip -o $MODEL_SCORING_PACKAGE -d `pwd`

NAME="`basename $MODEL_SCORING_PACKAGE`"

echo Base name $NAME
NAME=${NAME//.zip/}
echo Base name $NAME

echo docker build --file=Dockerfile --tag=scoring-engine \
--build-arg HTTP_PROXY=$http_proxy \
--build-arg HTTPS_PROXY=$http_proxy \
--build-arg NO_PROXY=$no_proxy \
--build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$http_proxy \
--build-arg no_proxy=$no_proxy \
--build-arg MODEL_SCORING_PACKAGE=$NAME \
.
docker build --file=Dockerfile --tag=scoring-engine \
--build-arg HTTP_PROXY=$http_proxy \
--build-arg HTTPS_PROXY=$http_proxy \
--build-arg NO_PROXY=$no_proxy \
--build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$http_proxy \
--build-arg no_proxy=$no_proxy \
--build-arg MODEL_SCORING_PACKAGE=$NAME \
.

55 changes: 55 additions & 0 deletions docker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.trustedanalytics</groupId>
<artifactId>model-scoring</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>docker</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>


<profiles>
<profile>
<id>build-server</id>
<activation>
<property>
<name>env.BUILD_NUMBER</name>
</property>
</activation>
<build>
<plugins>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>docker</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>build.sh</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>
</profiles>

<build>
</build>
</project>
16 changes: 16 additions & 0 deletions bin/cf.sh → model-scoring-core/bin/cf.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash
#
# Copyright (c) 2016 Intel Corporation 
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


echo "Starting model scoring startup script"
env
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading