frostfs-locode-db/README.md
Stanislav Bogatyrev 65531482be [#5] Update README for local build
From now on, we redistribute our data sources with our repository. Need
to highlight the licenses for all data sources used.

Signed-off-by: Stanislav Bogatyrev <s.bogatyrev@yadro.com>
2023-04-24 15:44:24 +03:00

2.8 KiB

NeoFS

UN/LOCODE database for ForstFS


Overview

FrostFS uses UN/LOCODE in storage node attributes and storage policies. Inner ring nodes converts UN/LOCODE into human-readable set of attributes such as continent, country name, etc.

This repository tools generate UN/LOCODE database for FrostFS using data from following sources:

Build

Prerequisites

Quick start

Just run make to generate locode_db file for use with FrostFS InnerRing nodes.

$ make
...
--out locode_db

Building

Then run frost-cli command to generate boltDB file.

$ frostfs-cli util locode generate --help
generate UN/LOCODE database for FrostFS

Usage:
  frostfs-cli util locode generate [flags]

Flags:
      --airports string     Path to OpenFlights airport database (csv)
      --continents string   Path to continent polygons (GeoJSON)
      --countries string    Path to OpenFlights country database (csv)
  -h, --help                help for generate
      --in strings          List of paths to UN/LOCODE tables (csv)
      --out string          Target path for generated database
      --subdiv string       Path to UN/LOCODE subdivision database (csv)

$ ./frostfs-cli util locode generate \
  --airports airports.dat \
  --continents continents.geojson \
  --countries countries.dat \
  --in 2022-2\ UNLOCODE\ CodeList.csv \
  --subdiv 2022-2\ SubdivisionCodes.csv \
  --out locode_db

Database generation might take some time!

You can test generated database with frostfs-cli.

$ frostfs-cli util locode info --db locode_db --locode 'RU LED'
Country: Russia
Location: Saint Petersburg (ex Leningrad)
Continent: Europe
Subdivision: [SPE] Sankt-Peterburg
Coordinates: 59.88, 30.25

Building Debian package

The most simple way is to run a make target

$ make debpackage

When packages are built, you can clean up the leftover with

$ dh clean

or

$ make debclean

License

This project is licensed under the CC Attribution-ShareAlike 4.0 International - see the LICENSE file for details