Commit 41d352a1 authored by Francesco Pavone's avatar Francesco Pavone
Browse files

Merge branch 'release/1.1.0'

parents ffa29a04 e5380bcd
FROM maven:3-jdk-8
VOLUME /tmp
ADD . /semantic-api
WORKDIR /semantic-api
RUN mvn package && \
cp ./target/pke113_C-TEP_API-SemanticDB-1.0-SNAPSHOT.jar /app.jar
ENV JAVA_OPTS=""
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
\ No newline at end of file
version: '2'
services:
monetdb:
restart: always
image: "ciccio86/monet-dump" #"monetdb/monetdb-r-docker"
ports:
- "50000:50000"
networks:
- default
server:
restart: always
build: .
image: "planetek/pke113_c-tep_api-semanticdb"
ports:
- "8080:8080"
depends_on:
- monetdb
networks:
- default
networks:
default:
driver: bridge
......@@ -2,7 +2,7 @@ version: '2'
services:
monetdb:
restart: always
image: "my-monet" #"monetdb/monetdb-r-docker"
image: "ciccio86/monet-dump" #"monetdb/monetdb-r-docker"
ports:
- "50000:50000"
networks:
......@@ -16,9 +16,6 @@ services:
- monetdb
networks:
- default
#links:
# - monetdb
# - monetdb:monetdb
networks:
default:
driver: bridge
FROM monetdb/monetdb-r-docker
WORKDIR /home/monetdb
ADD ctep_dump.sql .
\ No newline at end of file
############################################################
# Dockerfile to build MonetDB and R images
# Based on CentOS 7
############################################################
FROM centos:7
MAINTAINER Panagiotis Koutsourakis <panagiotis.koutsourakis@monetdbsolutions.com>
#######################################################
# Expose ports
#######################################################
EXPOSE 50000
#######################################################
# Setup supervisord
#######################################################
# Install supervisor
RUN yum install -y python-setuptools
RUN easy_install supervisor
# Create a log dir for the supervisor
RUN mkdir -p /var/log/supervisor
# Copy the config
COPY configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
#############################################################
# Enables repos, update system, install packages and clean up
#############################################################
RUN yum install -y epel-release \
wget
# Update & upgrade
RUN yum update -y && \
yum upgrade -y
#############################################################
# MonetDB installation
#############################################################
# Create users and groups
RUN groupadd -g 5000 monetdb && \
useradd -u 5000 -g 5000 monetdb
# Enable MonetDB repo
RUN wget -O /etc/yum.repos.d/monetdb.repo https://dev.monetdb.org/downloads/epel/monetdb.repo
RUN rpm --import https://dev.monetdb.org/downloads/MonetDB-GPG-KEY
ARG MonetDBVersion=11.21.19
# Install MonetDB clients
RUN yum install -y MonetDB-stream-$MonetDBVersion \
MonetDB-client-$MonetDBVersion \
MonetDB-client-tools-$MonetDBVersion \
MonetDB-client-odbc-$MonetDBVersion
# Install MonetDB server
RUN yum install -y MonetDB-$MonetDBVersion \
MonetDB-SQL-server5-hugeint-$MonetDBVersion
# Install MonetDB extensions
RUN yum install -y MonetDB-geom-MonetDB5-$MonetDBVersion \
MonetDB-gsl-MonetDB5-$MonetDBVersion \
MonetDB-R-$MonetDBVersion \
MonetDB-python2-$MonetDBVersion
# RUN yum install -y MonetDB-lidar-$MonetDBVersion
# Clean up
RUN yum -y clean all
#######################################################
# Setup MonetDB
#######################################################
# Add helper scripts
COPY scripts/set-monetdb-password.sh /home/monetdb/set-monetdb-password.sh
RUN chmod +x /home/monetdb/set-monetdb-password.sh
# Add a monetdb config file to avoid prompts for username/password
# We will need this one to authenticate when running init-db.sh, as well
COPY configs/.monetdb /home/monetdb/.monetdb
# Copy the database init scripts
COPY scripts/init-db.sh /home/monetdb/init-db.sh
RUN chmod +x /home/monetdb/init-db.sh
# Init the db in a scipt to allow more than one process to run in the container
# We need two: one for monetdbd and one for mserver
# The sript will init the database with using the unpreveledged user monetdb
COPY scripts/ctep_dump.sql /home/monetdb/ctep_dump.sql
RUN su -c 'sh /home/monetdb/init-db.sh && mclient -d db /home/monetdb/ctep_dump.sql' monetdb
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
\ No newline at end of file
############################################################
# Dockerfile to build MonetDB and R images
# Based on CentOS 7
############################################################
FROM centos:7
MAINTAINER Panagiotis Koutsourakis <panagiotis.koutsourakis@monetdbsolutions.com>
#######################################################
# Expose ports
#######################################################
EXPOSE 50000
#######################################################
# Setup supervisord
#######################################################
# Install supervisor
RUN yum install -y python-setuptools
RUN easy_install supervisor
# Create a log dir for the supervisor
RUN mkdir -p /var/log/supervisor
# Copy the config
COPY configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
#############################################################
# Enables repos, update system, install packages and clean up
#############################################################
RUN yum install -y \
wget \
nano
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN rpm -ivh epel-release-latest-7*.rpm
# Update & upgrade
RUN yum update -y && \
yum upgrade -y
#############################################################
# MonetDB installation
#############################################################
# Create users and groups
RUN groupadd -g 5000 monetdb && \
useradd -u 5000 -g 5000 monetdb
# Enable MonetDB repo
RUN yum install -y http://dev.monetdb.org/downloads/epel/MonetDB-release-epel-1.1-1.monetdb.noarch.rpm
RUN rpm --import http://dev.monetdb.org/downloads/MonetDB-GPG-KEY
# Update & upgrade
RUN yum update -y
# Install MonetDB
RUN yum install -y MonetDB-SQL-server5-hugeint
RUN yum install -y MonetDB-client
# Install the MonetDB/GEOM module
RUN yum install -y MonetDB-geom-MonetDB5
# Install MonetDB/R (R is installed as a dependency)
RUN yum install -y MonetDB-R
# Install MonetDB/GSL module
RUN yum install -y MonetDB-gsl-MonetDB5
# Clean up
RUN yum -y clean all
#######################################################
# Setup MonetDB
#######################################################
# Add helper scripts
COPY scripts/set-monetdb-password.sh /home/monetdb/set-monetdb-password.sh
RUN chmod +x /home/monetdb/set-monetdb-password.sh
# Add a monetdb config file to avoid prompts for username/password
# We will need this one to authenticate when running init-db.sh, as well
COPY configs/.monetdb /home/monetdb/.monetdb
# Copy the database init scripts and dump
COPY scripts/init-db.sh /home/monetdb/init-db.sh
COPY ctep_dump.sql /home/monetdb/ctep_dump.sql
RUN chmod +x /home/monetdb/init-db.sh
# Init the db in a scipt to allow more than one process to run in the container
# We need two: one for monetdbd and one for mserver
# The sript will init the database with using the unpreveledged user monetdb
RUN su -c 'sh /home/monetdb/init-db.sh' monetdb
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
user=monetdb
password=monetdb
[supervisord]
nodaemon=true
[program:monetdbd]
command=monetdbd start /var/monetdb5/dbfarm
autorestart=false
user=monetdb
priority=1
exitcodes=0
startsecs=0
#!/bin/bash
chown -R monetdb:monetdb /var/monetdb5
if [ ! -d "/var/monetdb5/dbfarm" ]; then
monetdbd create /var/monetdb5/dbfarm
else
echo "Existing dbfarm found in '/var/monetdb5/dbfarm'"
fi
monetdbd start /var/monetdb5/dbfarm
sleep 5
if [ ! -d "/var/monetdb5/dbfarm/db" ]; then
monetdb create db && \
monetdb set embedr=true db && \
monetdb release db
else
echo "Existing database found in '/var/monetdb5/dbfarm/db'"
fi
for i in {30..0}; do
echo 'Testing MonetDB connection ' $i
mclient -d db -s 'SELECT 1' &> /dev/null
if [ $? -ne 0 ] ; then
echo 'Waiting for MonetDB to start...'
sleep 1
else
echo 'MonetDB is running'
break
fi
done
if [ $i -eq 0 ]; then
echo >&2 'MonetDB startup failed'
exit 1
fi
mkdir -p /var/log/monetdb
chown -R monetdb:monetdb /var/log/monetdb
echo "Initialization done"
#!/bin/bash
dbname="db"
username="monetdb"
if [ -n "$1" ]; then
password=$1
echo "Setting new password for database '$dbname' and user '$username'."
echo -e "user=monetdb\npassword=monetdb" > .monetdb
mclient $dbname -s "ALTER USER SET PASSWORD '$password' USING OLD PASSWORD 'monetdb'";
rm -f .monetdb
else
echo "No password provided, aborting."
fi
File moved
......@@ -60,22 +60,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.11</version>
<configuration>
<imageName>${docker.image.prefix}/pke113_c-tep_api-semanticdb</imageName>
<dockerDirectory>docker/server</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment