Skip to content

Commit

Permalink
updated to master
Browse files Browse the repository at this point in the history
  • Loading branch information
remstef committed Aug 21, 2017
1 parent 9612a35 commit 6d09e63
Show file tree
Hide file tree
Showing 31 changed files with 405 additions and 475 deletions.
2 changes: 1 addition & 1 deletion webanno
Submodule webanno updated 114 files
7 changes: 7 additions & 0 deletions webanno-webapp-exm/.checkstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
<fileset name="all" enabled="true" check-config-name=" WebAnno checkstyle file" local="false">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
</fileset-config>
32 changes: 32 additions & 0 deletions webanno-webapp-exm/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ===================================================================
# WebAnno Properties
# ===================================================================

database.initial-pool-size=4
database.min-pool-size=4
database.max-pool-size=10
database.generate=update

backup.keep.time=0
backup.interval=0
backup.keep.number=0

ui.brat.sentences.number=5

debug.casDoctor.checks=
debug.casDoctor.repairs=
debug.casDoctor.fatal=false
debug.casDoctor.forceReleaseBehavior=false

# ===================================================================
# Spring Boot Properties
# ===================================================================

# IDENTITY (ContextIdApplicationContextInitializer)
spring.application.name=WebAnno

# MULTIPART (MultipartProperties)
spring.http.multipart.max-file-size=100MB
spring.http.multipart.max-request-size=100MB

spring.resources.cache-period=31536000
22 changes: 17 additions & 5 deletions webanno-webapp-exm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
Expand Down Expand Up @@ -186,6 +190,10 @@
<groupId>de.tudarmstadt.ukp.clarin.webanno</groupId>
<artifactId>webanno-io-tcf</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.clarin.webanno</groupId>
<artifactId>webanno-io-json</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.clarin.webanno</groupId>
<artifactId>webanno-io-conllu</artifactId>
Expand Down Expand Up @@ -317,7 +325,10 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.4.RELEASE</version>
<version>${spring.boot.version}</version>
<configuration>
<executable>true</executable>
</configuration>
<executions>
<execution>
<goals>
Expand All @@ -332,9 +343,8 @@
<executions>
<execution>
<!--
Also create the standalone file under the old name. In particular, OSes do not in
general consider WAR files as executable and won't allow starting them via a
double-click. So having the same file again with the ending ".jar" is convenient.
We want the original file to be the WAR and the repackaged all-inclusive runnable
thing with the embedded Tomcat to be the JAR.
-->
<id>copy-war-to-jar</id>
<phase>package</phase>
Expand All @@ -343,7 +353,8 @@
</goals>
<configuration>
<target>
<copy file="target/webanno-webapp-exm-${project.version}.war" tofile="target/webanno-standalone-${project.version}.jar" />
<move file="target/webanno-webapp-exm-${project.version}.war" tofile="target/webanno-standalone-${project.version}.jar" />
<move file="target/webanno-webapp-exm-${project.version}.war.original" tofile="target/webanno-webapp-${project.version}.war" />
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -375,6 +386,7 @@
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-tei</usedDependency>
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-tsv</usedDependency>
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-tcf</usedDependency>
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-json</usedDependency>
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-xmi</usedDependency>
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-conllu</usedDependency>
<usedDependency>de.tudarmstadt.ukp.clarin.webanno:webanno-io-text</usedDependency>
Expand Down
54 changes: 9 additions & 45 deletions webanno-webapp-exm/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,59 +1,23 @@
############################################################
#
# Dockerfile to build webanno container images
#
# Inspired by
# * https://github.com/NLPbox/webanno-docker
# * https://github.com/simonmeoni/webanno-docker
############################################################

################## BEGIN INSTALLATION ######################
FROM tomcat:7-jre8
FROM openjdk:8

MAINTAINER WebAnno Team

RUN apt-get update
# Install tomcat utilities (we will need tomcat7-instance-create) and mysql
#RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget mysql-server mysql-client tomcat7-user tomcat7-admin authbind
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget tomcat7-user tomcat7-admin authbind

# Copy webanno and mysql settings to tmp
# COPY create_webanno_db.sql mysql-init /tmp/

# Setup mysql as depicted in the webanno admin guide
# RUN service mysql stop
# RUN mysqld_safe --init-file=/tmp/mysql-init &
# RUN rm /tmp/mysql-init
# RUN service mysql start && \
# mysql -u root < /tmp/create_webanno_db.sql

WORKDIR /opt

# Create a tomcat7 instance of webanno to operate on port 18080 as
# shown in the official admin guide
RUN tomcat7-instance-create -p 18080 -c 18005 webanno && \
chown -R www-data /opt/webanno

# create some folders to get rid of tomcat7 warnings
RUN mkdir -p /usr/share/tomcat7/common/classes /usr/share/tomcat7/server/classes /usr/share/tomcat7/shared/classes
WORKDIR /opt/webanno

# Rename the webanno webapp
COPY webanno_initd /etc/init.d/webanno
COPY @docker.warfile@ /opt/webanno/webapps/ROOT.war

# Setup webanno as a service
RUN chmod +x /etc/init.d/webanno
RUN update-rc.d webanno defaults
COPY @docker.warfile@ webanno-standalone.jar

# this will be the WebAnno home folder
RUN mkdir /export
RUN chown -R www-data /export
# COPY settings.properties /export/settings.properties

COPY entrypoint.sh /opt/webanno/entrypoint.sh

##################### INSTALLATION END #####################

VOLUME /export

EXPOSE 18080
EXPOSE 8080

ENV JAVA_OPTS="-Xmx750m"

CMD bash /opt/webanno/entrypoint.sh
CMD java ${JAVA_OPTS} -Djava.awt.headless=true -XX:+UseConcMarkSweepGC -Dwebanno.home=/export -jar webanno-standalone.jar
10 changes: 8 additions & 2 deletions webanno-webapp-exm/src/main/docker/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
docker run -v /path/on/host/webanno/repository:/export -p 18080:18080 webanno/webanno:latest
mvn -Pdocker clean install docker:build (optionally add docker:push)

-v /my/own/datadir:/var/lib/mysql
docker run -v /path/on/host/webanno/repository:/export -p port-on-host:8080 webanno/webanno:latest

export WEBANNO_HOME=/path/on/host/webanno
export WEBANNO_PORT=port-on-host
docker-compose up -d

docker-compose down
4 changes: 0 additions & 4 deletions webanno-webapp-exm/src/main/docker/create_webanno_db.sql

This file was deleted.

49 changes: 49 additions & 0 deletions webanno-webapp-exm/src/main/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
##
# docker-compose up [-d]
# docker-compose down
##
version: '2.1'

networks:
webanno-net:

services:
mysqlserver:
image: "mysql:5"
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=webanno
- MYSQL_USER=webanno
- MYSQL_PORT=3306
- MYSQL_PASSWORD=webanno
volumes:
- ${WEBANNO_HOME}./mysql-data:/var/lib/mysql
command: ["--character-set-server=utf8", "--collation-server=utf8_bin"]
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-pwebanno", "-uwebanno"]
interval: 20s
timeout: 10s
retries: 10
networks:
webanno-net:

webserver:
image: "webanno/webanno-snapshots:latest"
ports:
- "${WEBANNO_PORT}:8080"
environment:
- WEBANNO_DB_DIALECT=org.hibernate.dialect.MySQL5InnoDBDialect
- WEBANNO_DB_DRIVER=com.mysql.jdbc.Driver
- WEBANNO_DB_URL=jdbc:mysql://mysqlserver:3306/webanno?useSSL=false&useUnicode=true&characterEncoding=UTF-8
- WEBANNO_DB_USERNAME=webanno
- WEBANNO_DB_PASSWORD=webanno
volumes:
- ${WEBANNO_HOME}./server-data:/export
depends_on:
mysqlserver:
condition: service_healthy
mem_limit: 4g
memswap_limit: 5g
restart: unless-stopped
networks:
webanno-net:
4 changes: 0 additions & 4 deletions webanno-webapp-exm/src/main/docker/entrypoint.sh

This file was deleted.

2 changes: 0 additions & 2 deletions webanno-webapp-exm/src/main/docker/mysql-init

This file was deleted.

13 changes: 0 additions & 13 deletions webanno-webapp-exm/src/main/docker/settings.properties

This file was deleted.

69 changes: 0 additions & 69 deletions webanno-webapp-exm/src/main/docker/webanno_initd

This file was deleted.

Loading

0 comments on commit 6d09e63

Please sign in to comment.