https://github.com/clariah/dane-server

Back-end for the Distributed Annotation 'n' Enrichment (DANE) system

https://github.com/clariah/dane-server

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords from Contributors

archival projection profiles interactive sequences generic observability autograding hacking shellcodes
Last synced: 10 months ago · JSON representation

Repository

Back-end for the Distributed Annotation 'n' Enrichment (DANE) system

Basic Info
  • Host: GitHub
  • Owner: CLARIAH
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 176 KB
Statistics
  • Stars: 2
  • Watchers: 12
  • Forks: 3
  • Open Issues: 4
  • Releases: 0
Created over 6 years ago · Last pushed about 3 years ago
Metadata Files
Readme License

README.md

DANE-server

DANE-server is the back-end component of DANE and takes care of task routing as well as the (meta)data storage. A task submitted to DANE-server is registered in a database, and then its .run() function is called. Running a task involves assigning it to a worker via a message queue.

A specific task is run by publishing the task to a RabbitMQ Topic Exchange, on this exchange the task is routed based on its Task Key. The task key corresponds to the binding_key of a worker, and each worker with this binding_key listens to a shared queue. Once a worker is available it will take the next task from the queue and process it.

DANE-server depends on the DANE package for the logic of how to iterate over tasks, and how to interpret a task in general.

Local Installation

DANE-server has been tested with Python 3 and is installable through pip:

pip install dane-server

Besides the python base, the DANE-server also relies on an Elasticsearch server (version 7.9) for storage, and RabbitMQ (tested with version 3.7) for messaging.

After installing all dependencies it is necessary to configure the DANE server, how to do this is described here: https://dane.readthedocs.io/en/latest/intro.html#configuration

The base config for DANE-server consists of the following parameters, which you might want to overwrite:

LOGGING: DIR: "./dane-server-logs/" LEVEL: "DEBUG" DANE_SERVER: TEMP_FOLDER: "/home/DANE/DANE-data/TEMP/" OUT_FOLDER: "/home/DANE/DANE-data/OUT/"

Usage

NOTE: DANE-server is still in development, as such authorisation (amongst other featueres) has not yet been added. Use at your own peril.

Run the server component (which listens to the RabbitMQ) as follows:

dane-server

Besides the server component we also need the API, which we can start with:

dane-api

If no errors occur then this should start a webserver (at port 5500) which will handle API requests, while in the background the server will handle interaction with the DB and RabbitMQ.

API

The DANE api is documented with a swagger UI, available at: http://localhost:5500/DANE/

Examples

Examples of how to work with DANE can be found at: https://dane.readthedocs.io/en/latest/examples.html

Docker

To run DANE-server, using Docker make sure to install a Docker Engine, e.g. Docker Desktop for OSX.

Build the Docker images

As the DANE-server has two separate processes. Two images need to be created:

  • One for running the Task Scheduler
  • One for running the API

Run the following from the main directory of this repo:

docker build -t dane-server -f Dockerfile.ts . docker build -t dane-server-api -f Dockerfile.api .

Note: currently the build relies on the es-index-cfg branch of DANE (see requirements.txt)

After the images have been successfully built, it is possible to run DANE-server via Kubernetes as well

Kubernetes

These instructions are optimized for minikube, which is for local development only. For deployment to a proper k8s cluster, you're on your own for now...

Note that the provided Kubernetes config only provisions your k8s cluster with:

  • Endpoint to external Elasticsearch (make sure you got one running)
  • RabbitMQ
  • DANE server (task scheduler)
  • DANE server API

In order to get a bunch of workers setup, you can check the k8s config files in DANE-asr-worker repository (later on more examples should follow).

Create a configmap for config.yml

First make sure to create the config.yml from the config-k8s.yml:

cp config-k8s.yml config.yml

Now before applying the Kubernetes file dane-server-k8s.yaml to your cluster, first create a ConfigMap for config.yml

kubectl create configmap dane-server-cfg --from-file config.yml

Now the ConfigMap is there, make sure to check that dane-server-k8s.yml points to a existing Elasticsearch host. After that you can go ahead and run:

kubectl apply -f dane-server-k8s.yaml

Configure your local DNS to access the API (and RabbitMQ dashboard)

Check the ip assigned to the dane-server-ingress (and dane-rabbitmq-ingress) by running:

kubectl get ingress

grab the IP from the ADDRESS column and put this in your /etc/hosts file:

{IP} api.dane.nl rabbitmq.dane.nl

Note: you can assign different domain names by editing the Ingresses in dane-server-k8s.yaml

Owner

  • Name: CLARIAH
  • Login: CLARIAH
  • Kind: organization

CLARIAH offers humanities scholars a Common Lab providing access to large collections of digital resources and innovative tools for research

GitHub Events

Total
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 102
  • Total Committers: 6
  • Avg Commits per committer: 17.0
  • Development Distribution Score (DDS): 0.284
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Nanne n****d@u****l 73
Jaap Blom j****m@b****l 22
Nanne n****d@b****l 4
dependabot[bot] 4****] 1
MvGuizza 8****a 1
Ernst Wevers e****s@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 2
  • Total pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 months
  • Total issue authors: 2
  • Total pull request authors: 4
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.38
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • phivk (1)
  • gb-beng (1)
Pull Request Authors
  • jblom (3)
  • dependabot[bot] (3)
  • ErnstWevers (1)
  • MvGuizza (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (3)

Dependencies

poetry.lock pypi
  • atomicwrites 1.4.1 develop
  • black 22.8.0 develop
  • coverage 6.4.4 develop
  • flake8 5.0.4 develop
  • iniconfig 1.1.1 develop
  • mccabe 0.7.0 develop
  • mockito 1.4.0 develop
  • mypy 0.971 develop
  • mypy-extensions 0.4.3 develop
  • packaging 21.3 develop
  • pathspec 0.10.0 develop
  • platformdirs 2.5.2 develop
  • pluggy 1.0.0 develop
  • py 1.11.0 develop
  • pycodestyle 2.9.1 develop
  • pyflakes 2.5.0 develop
  • pyparsing 3.0.9 develop
  • pytest 7.1.2 develop
  • pytest-cov 3.0.0 develop
  • tomli 2.0.1 develop
  • types-requests 2.28.9 develop
  • types-urllib3 1.26.23 develop
  • typing-extensions 4.3.0 develop
  • aniso8601 9.0.1
  • attrs 22.1.0
  • certifi 2022.6.15
  • charset-normalizer 2.1.1
  • click 8.1.3
  • colorama 0.4.5
  • dane 0.3.4
  • elasticsearch7 7.17.6
  • flask 2.1.3
  • flask-restx 0.5.1
  • idna 3.3
  • itsdangerous 2.1.2
  • jinja2 3.1.2
  • jsonschema 4.15.0
  • markupsafe 2.1.1
  • pika 1.3.0
  • pyrsistent 0.18.1
  • pytz 2022.2.1
  • pyyaml 6.0
  • requests 2.28.1
  • six 1.16.0
  • urllib3 1.26.12
  • werkzeug 2.1.2
  • yacs 0.1.8
pyproject.toml pypi
  • black ^22.8.0 develop
  • flake8 ^5.0.4 develop
  • mockito ^1.4.0 develop
  • mypy ^0.971 develop
  • pytest ^7.1.2 develop
  • pytest-cov ^3.0.0 develop
  • types-requests ^2.28.9 develop
  • dane ^0.3.4
  • elasticsearch7 *
  • flask ~=2.1.0
  • flask-restx *
  • pika *
  • python ^3.10
  • requests *
  • werkzeug <2.2.0