Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added dockerfiles #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
56 changes: 56 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# Eclipse Core
.project

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Maven
target/

# Baleen specific
testing.log
9 changes: 8 additions & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
2. Run `mvn package` from the Baleen project directory
3. Optionally run `mvn javadoc:aggregate-jar` to build Javadoc
4. The Baleen JAR will be built and saved in the target directory under the top level project directory
5. Run Baleen by running `java -jar baleen-2.4.0.jar` and then navigating to <http://localhost:6413>
5. Run Baleen by running `java -jar baleen-2.4.1.jar` and then navigating to <http://localhost:6413>

## Docker Instructions

1. Download the Baleen source from GitHub
2. Run `docker build -t baleen:2.4.1-SNAPSHOT .` from the root of the project
5. Run Baleen by running `docker run --name baleen -p 6413:6413 baleen:2.4.1-SNAPSHOT` and then navigating to <http://localhost:6413>

31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

###############################################################################
# BUILD
###############################################################################
FROM maven:3.5-jdk-8 AS build

# we need to create a new user as some of the
# tests rely on files being readonly and fail
# when run as root
RUN useradd -ms /bin/bash baleen
WORKDIR /home/baleen

COPY . .

RUN chown -R baleen *
USER baleen

RUN mvn package

###############################################################################
# RELEASE
###############################################################################
FROM java:8-jdk-alpine AS release

ARG baleen_version=2.4.1-SNAPSHOT

COPY --from=build /home/baleen/target/baleen-${baleen_version}.jar ./baleen.jar

EXPOSE 6413

ENTRYPOINT [ "java", "-jar", "baleen.jar" ]
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ Baleen 2.4 contains a number of changes that may make it incompatible with older

Baleen includes an in-built server, which hosts full documentation and guides on how to use Baleen.
To get started, you will need to launch this server and read this documentation.
To launch the server, run the following command.
To launch the server, run one of the following commands.

> java -jar baleen-2.4.0.jar
> `java -jar baleen-2.4.0.jar`

> `docker-compose -f example/docker-compose.yml up`

Once running, the server can be accessed at [http://localhost:6413](http://localhost:6413).

Expand All @@ -28,10 +30,15 @@ If you require the Javadoc to be available through the in-built server, then you

## Running

To run Baleen, you will need:
To run Baleen, you will need either;

* A sensible amount of RAM. Start with 4GB and alter according to the number of annotators being employed.
* Java 8

or

* [Docker](https://www.docker.com/) v17+
* [Docker Compose](https://docs.docker.com/compose/) v1.17+

## Developing

Expand Down
9 changes: 9 additions & 0 deletions example/config/example_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
logging:
loggers:
- name: console
minLevel: INFO

pipelines:
- name: Example Pipeline
file: /config/example_pipeline.yml
17 changes: 17 additions & 0 deletions example/config/example_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
mongo:
db: baleen
host: mongo

collectionreader:
class: FolderReader
folders:
- /data

annotators:
- regex.Url
- language.OpenNLP
- gazetteer.Country

consumers:
- Mongo
13 changes: 13 additions & 0 deletions example/data/example_doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Syria has accused Israel of bombarding an area west of Damascus, with reports of a military airport being hit.
State television quoted the army as saying several rockets landed in the airport compound in Mezzeh, Reuters news agency reports.
It remains unclear if the alleged bombardment, which caused fires, has caused any casualties.
The Israeli government has previously neither confirmed nor denied that it carries out strikes in Syria.
It is thought to have bombed weapons shipments intended for Lebanon's Hezbollah movement several times since Syria's civil war began in 2011.
Hezbollah, which fought a month-long war with Israel in 2006, has sent thousands of fighters to Syria to support President Bashar al-Assad's forces.
State-run Syrian news agency Sana reported explosions at the Mezzeh military airport and said ambulances were rushing to the scene.
"The army was quoted as warning Israel ""of the repercussions of the flagrant attack"", according to Reuters."
In December, Syrian state media said an Israeli missile strike had targeted the airport in Mezzeh, causing fires but no casualties.
Days earlier, on 30 November, Israeli jets were reported to have fired missiles from Lebanese airspace into Syria, striking Sabboura, an area outside Damascus.
The target was unclear but the highway from Lebanon to Damascus runs through the town.

source: https://github.com/dstl/re3d
21 changes: 21 additions & 0 deletions example/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: '3'
services:
baleen:
image: baleen:2.4.1-SNAPSHOT
build:
context: ../
args:
baleen_version: 2.4.1-SNAPSHOT
ports:
- 6413:6413
command: /config/example_config.yml
volumes:
- ./config/:/config
- ./data/:/data
depends_on:
- mongo
mongo:
image: mongo:3.0
ports:
- 27017:27017