Skip to content
Pieter Heyvaert edited this page Sep 29, 2016 · 13 revisions

Pre-requisites

Getting started

  • Install the pre-requisites.
  • In order to run FREME in the docker container you need to execute these commands
git clone https://github.com/freme-project/freme-docker
cd freme-docker/compose
sudo docker-compose up

The system will download all images from dockerhub and start FREME. Then you can try to perform an API request, e.g. on another shell on the same server, the current shell is busy running FREME:

curl -X POST "http://localhost:4000/e-translation/tilde?input=hello+world&informat=text&source-lang=en&target-lang=de"

This API call should return NIF containing a translation.

description of files and folders

Folder Description
freme-package Contains the freme-package that will be started inside of the freme-broker docker container.
freme-broker Dockerfile and resources for the freme-broker docker image. To build the docker image you need to run mvn package on the freme-package first and copy the package (freme-package/target/freme-package) into the freme-broker folder
freme-mysql Dockerfile and resources to create the mysql docker container
freme-ner-old Old files, will be deleted
freme-solr Dockerfiles and resources to create the docker image for the solr server
compose Configuration to start all packages together

build images

Build images for broker, mysql, and solr. Virtuoso currently uses a default image.

# build mysql and solr
git clone https://github.com/freme-project/freme-docker
cd freme-docker/freme-mysql
sudo docker build -t fremeproject/freme-mysql .
cd ../freme-solr
sudo docker build -t fremeproject/freme-solr .

# build freme package
cd ../freme-package
mvn package
rm -r ../freme-broker/freme-package
cp -r target/freme-package ../freme-broker/freme-package

# add english model
cd ../freme-broker/freme-package
mkdir freme-ner-models
cd freme-ner-models/
wget http://api.freme-project.eu/datasets/ner-trained-models/wikiner/wikiner-en-ner-model.ser.gz

# build freme-broker image
cd ../../
sudo docker build -t fremeproject/freme-broker .

push images to dockerhub

Assuming that you have build the images locally and have logged in to dockerhub using docker login. Further assuming that you have write access to the organization fremeproject.

sudo docker push fremeproject/freme-broker

You can exchange fremeproject/freme-broker with other images. Your images will be uploaded to https://hub.docker.com/u/fremeproject/

run docker-compose

This assumes you have already cloned the freme-docker repository and build the images. From the freme-docker repository folder, execute

cd compose
sudo docker-compose up

Start containers one by one

Usually you do not need this. Docker compose will start all of them.

start MySQL

sudo docker run --name freme-mysql -e MYSQL_ROOT_PASSWORD=root -d fremeproject/freme-mysql

start virtuoso

sudo docker run --name my-virtuoso -e DBA_PASSWORD=myDbaPassword -e SPARQL_UPDATE=true -e DEFAULT_GRAPH=http://www.example.com/my-graph -v /my/path/to/the/virtuoso/db:/data -d tenforce/virtuoso

start solr

sudo docker run --name freme-solr -d-p 4002:8983 fremeproject/freme-solr

start broker

sudo docker run --name freme-broker -d --link freme-mysql:mysql --link freme-solr:solr --link freme-virtuoso -p 4000:8080 fremeproject/freme-broker

The broker exposes the FREME API on port 4000 of the host.