Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.44 KB

README.md

File metadata and controls

59 lines (39 loc) · 1.44 KB

Locations Generator python

The Python script to generate locations data for the Locations API.

Configuration

  1. Start the API which should be tested locally.
  2. copy configuration-example.yaml as configuration.yaml and modify it as necessary.

Usage

  1. Fetch contrib files with git-submodule:

    $ git submodule update --init
  2. Install dependencies via pip:

    $ pip install -r requirements.txt
  3. Build the artifacts:

    $ python build_artifacts.py --config=configuration.yaml

    If the script runs successfully, the following two files will be generated in the ./build directory:

    • locations_combined.json - Combined OSU locations list from various data sources
    • services.json - OSU services data list
  4. Update AWS Elasticsearch instance:

    $ python es_manager.py --config=configuration.yaml

Docker

  1. Build the docker image:

    $ docker build -t locations-generator .
  2. Run the app in a container:

    $ docker run --name locations-generator \
                 --rm \
                 -v "$PWD"/configuration.yaml:/usr/src/app/configuration.yaml:ro \
                 -v "$PWD"/build:/usr/src/app/build \
                 locations-generator