From b15195a101afd2f5c72ac9ef812379d690151146 Mon Sep 17 00:00:00 2001 From: David Beniamine <david.beniamine@tetras-libre.fr> Date: Mon, 11 May 2020 20:29:30 +0200 Subject: [PATCH] Update doc Fix #6 --- Readme.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 3920bb1..f836cb0 100644 --- a/Readme.md +++ b/Readme.md @@ -1,18 +1,39 @@ -# Web services based on Python scripts +# Unl2rdf web demo -Initially deveopped to deploy a serialization converter from the official UNL format to the proposed RDF-UNL format. +This is a [dockerized](https://www.docker.com/) webdemo of the [unl2rdf java parser](https://gitlab.tetras-libre.fr/unl/unl2rdf) -## How to use +## Requirements + ++ [Docker](https://docs.docker.com/get-docker/) ++ [Docker-compose](https://docs.docker.com/compose/install/) + +## Install ```bash cp .env.sample .env docker-compose up ``` +The first time this process will take a while as it has to [build](#build-process) the docker images and the [java parser](https://gitlab.tetras-libre.fr/unl/unl2rdf). + Then open in a browser `http://localhost:5000` +## build process + +The docker build process consists in three steps + +1. On create a debian base image with jdk +2. Create a build image that retrieve the unl2rdf parser sources and builds it +3. Create an image to run the flask application + +### Triggering a rebuild + +Docker caches every step of the build, if the java parser has changed, `docker-compose build` will not detect it, so you have to change `GIT_REF=` in the `.env` file to point to the desired commit, branch or tag. Then you can run `docker-compose build` and only the required steps to rebuild the java parser will run again. + ## Developpement -This is a one page [flask](https://flask.palletsprojects.com) app to convert unl to rdf, the web app is full python, everything is in the file `src/app/app.py`. +This is a one page [flask](https://flask.palletsprojects.com) app to acces the [unl2rdf parser](https://gitlab.tetras-libre.fr/unl/unl2rdf), the web app is full python, everything is in the file `src/app/app.py` and in `src/app/static/<css|js>` The display rendering uses the templates in the directory `src/app/templates` see [flakes templating](https://flask.palletsprojects.com/en/1.1.x/quickstart/#rendering-templates). + +Js and css dependencies are installed via npm in directory `src/app/static` -- GitLab