Skip to content
Snippets Groups Projects
Select Git revision
  • fix/twamp-role-update
  • develop default protected
  • feature/NAT-1258_prefix_list_checker
  • fix/resolve-import-failure-unexcpected-redis-error-2
  • fix/sbp-template
  • feature/randepeer
  • feature/nat-1210-edgeports
  • feature/nat-996-dsc0
  • feature/nat-1010-ubfd
  • fix/pe-specific-fixes
  • milos-nat-697-sbp
  • feature/NAT_485_switch_base_config
  • fix/huge-tree
  • v1.0.x
  • add_SR2-se_support
  • fix/iptrunk-ttl-expired
  • Add-ipv4-ipv6-add-fam-in-p-only
  • feature/redundancy_sync
  • fix/aaa-health-check
  • cleanup
  • 1.1.109
  • 1.1.107
  • 1.1.106
  • 1.1.104
  • 1.1.103
  • 1.1.102
  • 1.1.99
  • 1.1.98
  • 1.1.96
  • 1.1.95
  • 1.1.94
  • 1.1.93
  • 1.1.91
  • 1.1.90
  • 1.1.89
  • 1.1.88
  • 1.1.87
  • 1.1.86
  • 1.1.84
  • 1.1.83
40 results

geant-gap-ansible

Skeleton Web App

Installation Process

Clone this repository using your favorite method, then:

$ python3 -m venv compendium-v2
$ .compendium-v2/bin/activate
$ pip install -r requirements.txt
$ tox -e py39

Overview

This module implements a Flask-based webservice and in-browser React front-end.

The webservice communicates with the front end over HTTP. Responses to valid requests are returned as JSON messages. The server will therefore return an error unless application/json is in the Accept request header field.

Configuration

This app allows specification of a few example configuration parameters. These parameters should be stored in a file formatted similarly to config-example.json, and the name of this file should be stored in the environment variable SETTINGS_FILENAME when running the service.

Building the web application

For instructions on building the React frontend see webapp/README.md.

Running this module

This module has been tested in the following execution environments:

  • As an embedded Flask application. For example, the application could be launched as follows:
$ export FLASK_APP=compendium_v2.app
$ export SETTINGS_FILENAME=config-example.json
$ flask run

See https://flask.palletsprojects.com/en/2.1.x/deploying/ for best practices about running in production environments.

Importing the historical data

Pip install can use the setup.py file to register the click cli commands:

pip install --editable .
survey-publisher-v1
survey-publisher-2022

Creating a db migration after editing the sqlalchemy models

flask db migrate -m "description"

Then go to the created migration file to make any necessary additions, for example to migrate data. Also see https://alembic.sqlalchemy.org/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect Flask-migrate sets compare_type=True by default.

Note that starting the application applies all upgrades. This also happens when running flask db commands such as flask db downgrade, so if you want to downgrade 2 or more versions you need to do so in one command, eg by specifying the revision number.