Skip to content

Scripts & infrastructure to create openSenseMap Archive

License

Notifications You must be signed in to change notification settings

openSenseMap/archive

Repository files navigation

openSenseMap Archive

This repository contains the scripts to generate the csv & json files for the openSenseMap Archive.

Getting started

This is a Node.js project.

Prerequisities

You will need to have Node.js (at least >= 18) and npm or yarn installed. Also you need Docker and Docker Compose installed.

Installation

  1. Clone the repository
git clone [email protected]:sensebox/openSenseMap-archive.git
  1. Install NPM packages
npm install
  1. Create the .env file
cp .env.example .env
  1. Enter der environmental variables in .env

  2. Spin up the local database

docker-compose up -d db

To seed the database with boxes and measurements, copy the archive files created by mongodump to the dumps folder. The boxes dump should be named boxes and the measurement dump should be named measurements The folder is mounted to the MongoDB container and will seed the data on start up.

  1. Run the archiver (locally)
npm run create-archive
  1. Run the archiver (Docker)
docker build -t osem-archiver .
docker-compose up -d

For this option skip point 5 and just copy the dumps as explained.

The archive files should be generated by default inside the archive folder.

Release a new version

The releasing workflow includes some manual steps. Please follow these steps:

A new release is created on the main branch.

Scripts

mongodb

Contains scripts to initialize the used MongoDB database for development purposes. Are just used within the docker-compose.yml file and mounted to the db service.

systemd

Contains systemd service and timer files to run the archiver as a systemd service. The archive-checker.service uses the check-container.sh utility.

utilities

Containes two utility scripts to check container status and wait for specific services on a tcp host/port.