Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
coastal-tep
semantic-api
Commits
41d352a1
Commit
41d352a1
authored
8 years ago
by
Francesco Pavone
Browse files
Options
Download
Plain Diff
Merge branch 'release/1.1.0'
parents
ffa29a04
e5380bcd
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
192 additions
and
112 deletions
+192
-112
Dockerfile
Dockerfile
+12
-0
docker-compose.yml
docker-compose.yml
+22
-0
docker/docker-compose.yml
docker/docker-compose.yml
+1
-4
docker/monetdb/Dockerfile
docker/monetdb/Dockerfile
+90
-3
docker/monetdb/Dockerfile.new
docker/monetdb/Dockerfile.new
+0
-89
docker/monetdb/configs/.monetdb
docker/monetdb/configs/.monetdb
+2
-0
docker/monetdb/configs/supervisord.conf
docker/monetdb/configs/supervisord.conf
+10
-0
docker/monetdb/scripts/ctep_dump.sql
docker/monetdb/scripts/ctep_dump.sql
+0
-0
docker/monetdb/scripts/init-db.sh
docker/monetdb/scripts/init-db.sh
+41
-0
docker/monetdb/scripts/set-monetdb-password.sh
docker/monetdb/scripts/set-monetdb-password.sh
+14
-0
docker/server/Dockerfile.old
docker/server/Dockerfile.old
+0
-0
pom.xml
pom.xml
+0
-16
No files found.
Dockerfile
0 → 100644
View file @
41d352a1
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
This diff is collapsed.
Click to expand it.
docker-compose.yml
0 → 100644
View file @
41d352a1
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
This diff is collapsed.
Click to expand it.
docker/docker-compose.yml
View file @
41d352a1
...
...
@@ -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
This diff is collapsed.
Click to expand it.
docker/monetdb/Dockerfile
View file @
41d352a1
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
This diff is collapsed.
Click to expand it.
docker/monetdb/Dockerfile.new
deleted
100644 → 0
View file @
ffa29a04
############################################################
# 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"]
This diff is collapsed.
Click to expand it.
docker/monetdb/configs/.monetdb
0 → 100755
View file @
41d352a1
user=monetdb
password=monetdb
This diff is collapsed.
Click to expand it.
docker/monetdb/configs/supervisord.conf
0 → 100755
View file @
41d352a1
[
supervisord
]
nodaemon
=
true
[
program
:
monetdbd
]
command
=
monetdbd
start
/
var
/
monetdb5
/
dbfarm
autorestart
=
false
user
=
monetdb
priority
=
1
exitcodes
=
0
startsecs
=
0
This diff is collapsed.
Click to expand it.
docker/monetdb/ctep_dump.sql
→
docker/monetdb/
scripts/
ctep_dump.sql
View file @
41d352a1
File moved
This diff is collapsed.
Click to expand it.
docker/monetdb/scripts/init-db.sh
0 → 100755
View file @
41d352a1
#!/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"
This diff is collapsed.
Click to expand it.
docker/monetdb/scripts/set-monetdb-password.sh
0 → 100755
View file @
41d352a1
#!/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
\n
password=monetdb"
>
.monetdb
mclient
$dbname
-s
"ALTER USER SET PASSWORD '
$password
' USING OLD PASSWORD 'monetdb'"
;
rm
-f
.monetdb
else
echo
"No password provided, aborting."
fi
This diff is collapsed.
Click to expand it.
docker/server/Dockerfile
→
docker/server/Dockerfile
.old
View file @
41d352a1
File moved
This diff is collapsed.
Click to expand it.
pom.xml
View file @
41d352a1
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment