Git Product home page Git Product logo

fira's Introduction

FiRA - Fine-grained Relevance Annotation

How to run (in production mode)

  1. Put data files in a directory on the host system
  2. Set environment variables
  3. Run the application
  4. Inspect the file containing the imported users

#1: Put data files in a directory on the host system

On the first startup, Fira will import all the data necessary to run the application.

The files needed are:

  • users.tsv
  • documents.tsv
  • queries.tsv
  • judgement-pairs.tsv
  • config.tsv

See sample/data for example files and the predefined file structure.

#2: Set environment variables

Credentials, ports, and other parameters for deployment must be set as environment variables for docker-compose.
The recommended way is to create a .env file next to the docker-compose.yml file.

The following example shows the parameters which must be set (see also sample/.env).
The parameter FIRA_APPSVC_DATA_DIRECTORY must match the absolute path to the directory where the data files (users.tsv etc.) are. Also, don't forget to use more sensible values for the parameters for credentials!

# --- users and credentials ---
ADMIN_USER=admin
ADMIN_PASSWORD=admin
FIRA_PERSISTENT_DB_USER=fira
FIRA_PERSISTENT_DB_PASSWORD=password
FIRA_PERSISTENT_DB_DATABASENAME=fira
FIRA_PERSISTENT_DB_URL=postgresql://fira:password@postgres_fira:5432/fira
KEYCLOAK_DB_USER=keycloak
KEYCLOAK_DB_PASSWORD=password

# --- variables for connection (externally exposed ports, i.e. ports mapped on host system) ---
FIRA_APPSVC_PUBLIC_PORT=80

# --- docker volumes for backend ---
FIRA_APPSVC_DATA_DIRECTORY=/c/data/fira-data/
FIRA_PERSISTENT_DB_DIRECTORY=/c/data/fira-db/
KEYCLOAK_DATABASE_DIRECTORY=/c/data/keycloak-db/

# --- configuration for domain the app is deployed on. Avoid trailing slash ("/") ---
FIRA_HOMEPAGE=https://my-domain/path-of-app

# --- DEVELOPMENT VARIABLES ---
NODE_ENV=development
FIRA_APPSVC_INTERNAL_PORT=80
FIRA_DEV_PERSISTENT_DB_PUBLIC_PORT=8079
PGADMIN_PUBLIC_PORT=8078
KEYCLOAK_PUBLIC_PORT=8077
K6_GRAFANA_PUBLIC_PORT=8076
PGADMIN_EMAIL[email protected]
PGADMIN_PASSWORD=pgadmin

#3: Run the application

Run docker-compose up -d --build on the docker host. This will launch all services of the application necessary to operate in production. One can inspect the logs with docker-compose logs -f.

Note: the option --build will rebuild the docker images every time the application is started. This will avoid old images being used by docker, and the Dockerfiles are structured in a way so that docker will re-use caches as much as possible, thus the rebuild will take as little time as needed.

#4: Inspect the file containing the imported users

Fira will write the generated credentials of all imported users to the file FIRA_APPSVC_DATA_DIRECTORY\out\users.tsv.

Additional information

Hints for using Docker-Compose

The detached mode (Flag -d) is used in both options because this is the recommended way of launching an application with docker-compose (not using the detached mode leads to the problem that if the terminal is closed or the process is terminated via Ctrl+C, the entire application stops...).

If you do not have docker-compose installed on your host system, you can try the following command (taken from cloud.google.com/community/tutorials/docker-compose-on-container-optimized-os):

docker run --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v "$PWD:$PWD" \
    -w="$PWD" \
    docker/compose:latest up -d --build

Development

Run the application with ./scripts/dev-up.sh. This will launch not only the essential services, but also PgAdmin to inspect the contents of the postgres database. Furthermore, all services normally not exposed from the docker network (e.g. keycloak, postgres database server) will get exposed to the host system. This allows to connect the local instance of the fira backend to the services running in docker.

The PgAdmin Web UI is available at http://localhost:8078 (or whatever port set with PGADMIN_PUBLIC_PORT). The postgres database is automatically added to PgAdmin. You only have to enter the password when connecting.

The scripts folder contains more useful scripts to interact with the docker environment.

fira's People

Contributors

pkerschbaum avatar sebastian-hofstaetter avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.