-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
159 lines (120 loc) · 4.93 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# Pull base image.
# FROM ubuntu:trusty
FROM maven:3-jdk-8
MAINTAINER George Giannakopoulos ([email protected])
ARG daemon_directory=/daemon
LABEL multi.label1="BDE" \
multi.label2="Event Detection"
# Install main apt utils
RUN apt-get update
#apt-get install -y \
#software-properties-common
# Install Java
#RUN echo 'Getting java 8...'
#
#RUN \
#echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
#add-apt-repository -y ppa:webupd8team/java && \
#apt-get update && \
#apt-get install -y oracle-java8-installer && \
#rm -rf /var/lib/apt/lists/* && \
#rm -rf /var/cache/oracle-jdk8-installer
# Define commonly used JAVA_HOME variable
#ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
#RUN echo 'Getting java 8... Done.'
# Get build tools
RUN echo 'Getting git...'
RUN apt-get install -y git
RUN echo 'Getting maven and git... Done.'
# Make and define working directory.
RUN mkdir -p /bde
# Bring BDE components
RUN echo 'Getting components...'
RUN cd /bde; \
git clone https://github.com/ggianna/bde-event-detection-sc7.git BDEEventDetection/
RUN echo 'Getting components... Done.'
# RUN echo 'Adding custom NewSum components...'
# ADD NewSumClusterer/ ~/.m2/repository/org/scify/NewSumClusterer/
# ADD NewSumClusterer-0.5-BDE-SNAPSHOT.jar /bde/
# ADD NewSumSummarizer/ ~/.m2/repository/org/scify/NewSumSummarizer/
# ADD NewSumSummarizer-1.2-BDE-SNAPSHOT.jar /bde/
# ADD SocialMediaEvaluator/ ~/.m2/repository/org/scify/SocialMediaEvaluator/
# ADD SocialMediaEvaluator-0.4.1-BDE-SNAPSHOT.jar /bde/
# ADD *.jar /bde/
# ADD *.pom /bde/
# Temporarily use public SciFY user
ADD bde-mvn-settings.xml /root/.m2/settings.xml
# TODO: Use only jars instead of whole repos from SciFY
# ADD registerNSComponents.sh /bde/
# RUN ["/bin/bash", "/bde/registerNSComponents.sh"]
RUN echo 'Adding custom NewSum components... Done.'
# DEBUG LINES
# RUN ls -l /bde/
# RUN ls -l /bde/BDEEventDetection/
# Update setting files
RUN echo 'Updating setting files...'
# Twitter
RUN sed -i 's/cassandra_hosts = 127[.]0[.]0[.]1/cassandra_hosts = ${CASSANDRA_IPS}/' /bde/BDEEventDetection/BDETwitterListener/res/twitter.properties && \
# RSS
sed -i 's/cassandra_hosts = 127[.]0[.]0[.]1/cassandra_hosts = ${CASSANDRA_IPS}/' /bde/BDEEventDetection/BDERSSCrawler/res/newscrawler_configuration.properties &&\
# Clustering
sed -i 's/cassandra_hosts = 127[.]0[.]0[.]1/cassandra_hosts = ${CASSANDRA_IPS}/' /bde/BDEEventDetection/BDECLustering/res/clustering.properties &&\
# Location extraction
sed -i 's/cassandra_hosts = 127[.]0[.]0[.]1/cassandra_hosts = ${CASSANDRA_IPS}/' /bde/BDEEventDetection/BDELocationExtraction/res/location_extraction.properties;
RUN echo 'Updating setting files... Done.'
RUN echo 'Building system...'
# RUN echo 'Building components...'
# RUN cd /bde/BDEEventDetection/BDEBase; \
# mvn install;
# RUN cd /bde/BDEEventDetection/BDETwitterListener; \
# mvn install;
# RUN cd /bde/BDEEventDetection/BDERSSCrawler; \
# mvn install;
# RUN cd /bde/BDEEventDetection/BDECLustering; \
# mvn install; \
# cd /bde/BDEEventDetection/BDELocationExtraction; \
# mvn install; \
RUN cd /bde/BDEEventDetection; \
mvn install;
# RUN echo 'Building components... Done.'
### Daemon interface
####################
# declare and set environment variables required for interaction with the
# init daemon to their default values. Stepname can/will be set at the
# daemonInterface.sh (TBD)
ENV ENABLE_INIT_DAEMON true
ENV INIT_DAEMON_BASE_URI http://identifier/init-daemon
ENV INIT_DAEMON_STEP default_step_name
# make a dedicated directory for the daemon interface and a mount point
# daemon scripts will be placed there. Is a build arg (default=/daemon).
# also add the daemon_directory name to /home keep track of the location in a
# built image
RUN echo "Daemon dir is $daemon_directory" > /home/daemonDirLoc
ENV DAEMON_DIR $daemon_directory
RUN mkdir $daemon_directory
# copy the main script that will manage the interface with the remote daemon
# and the query scripts the perform the querying at each stage
# run your work right after the execute-step.sh call
COPY wait-for-step.sh $daemon_directory/
COPY execute-step.sh $daemon_directory/
COPY finish-step.sh $daemon_directory/
COPY daemonInterface.sh $daemon_directory/
# set the executable bit for the scripts
RUN chmod +x $daemon_directory/*.sh
# set sleep times for wait - execute - finish daemon probe scripts
ENV SLEEP_WAIT 1
ENV SLEEP_EXEC 1
ENV SLEEP_FINISH 1
#### Testing:
# To override the default daemon URI ( e.g. for testing purposes ),
# you can add a override file with another address.
# Mount as data volume to the following mount point and write in it
# the override daemon address.
RUN mkdir $daemon_directory/mnt
ENV DAEMON_INFO_FILE $daemon_directory/mnt/daemoninfo
# install dependencies: curl for making http requests.
RUN apt-get install -y curl
### End of Daemon interface
###########################
# Define default command.
CMD ["bash"]