damb / ws-availability

FDSNWS-Availability implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webservice availability

ws-availability implements the FDSN specification of the availability webservice.

Running in development environment

  1. Go to the root directory
  2. Copy config.py.sample to config.py and adjust it as needed
  3. Create the virtual environment:
    $ python3 -m venv env
  4. Activate the virtual environment:
    $ source env/bin/activate
  5. Install the dependencies:
    (env) $ pip install -r requirements.txt
  6. Now you can either:
    1. Run it:
      (env) $ RUNMODE=test FLASK_APP=start.py flask run
    2. Debug it in VS Code (F5)

Backend

ws-availability relies on the seedtree5 database used at RESIF-DC.

The file update_wsavailability_schema.sql can be used to build the necessary materialized view.

This is RESIF-DC inners and is not detailed here.

Play around with docker

$ docker build -t ws-availability:latest .
# Run with bridged network
$ docker run -d --restart=always -e RUNMODE=production -p 9001:9001 --name ws-availability ws-availability:latest
# Or
$ docker run --rm -e RUNMODE=test -p 9001:9001 --name ws-availability ws-availability:latest
# Run with shared host network
$ docker run -d --restart=always -e RUNMODE=production --net=host --name ws-availability ws-availability:latest
# Or
$ docker run --rm --net=host -e RUNMODE=test --name ws-availability ws-availability:latest

Then :

$ wget -O - http://localhost:8000/1/application.wadl

Run it in debug mode with flask:

$ RUNMODE=test FLASK_APP=start.py flask run

RUNMODE builtin values

  • production
  • test

References

This repository has been forked from https://gitlab.com/resif/ws-availability, special thanks to our colleagues at RESIF for sharing their implementation of the FDSNWS-Availability web service. 💐

About

FDSNWS-Availability implementation

License:GNU General Public License v3.0


Languages

Language:Python 53.3%Language:HTML 39.4%Language:PLpgSQL 5.1%Language:CSS 1.7%Language:Dockerfile 0.5%