Source of UN/LOCODE database generated by FrostFS CLI.
Find a file
George Bartolomey 840b20538b
[#7] Add local tool for building database file
Added frostfs-locode-db CLI utility that can generate and view UN/LOCODE
database files. Go package
git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/locode copied to
this repository to eliminate interdependency between frostfs-node and
frostfs-locode-db projects. The process of building database files
reduced to starting make command.

Signed-off-by: George Bartolomey <george@bh4.ru>
2024-07-09 18:54:05 +03:00
.forgejo/workflows [#6] Add automated database updater 2024-07-04 14:33:03 +03:00
.github [#3] Add Issue Template 2023-03-23 12:21:54 +03:00
data [#5] Add local data sources 2023-04-24 15:44:24 +03:00
debian [#5] Fix rebranding for Debian packages 2023-04-24 15:44:24 +03:00
pkg/locode [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
.gitattributes Update common files from template repo 2024-07-08 11:12:07 +03:00
.gitignore [#11] Fix lintian warnings 2022-10-28 09:05:48 +03:00
.gitlint Update common files from template repo 2024-07-08 11:12:07 +03:00
.golangci.yml Update common files from template repo 2024-07-08 11:12:07 +03:00
.pre-commit-config.yaml Update common files from template repo 2024-07-08 11:12:07 +03:00
CHANGELOG.md [#5] Release v0.4.0 2023-04-24 16:04:32 +03:00
CONTRIBUTING.md Update common files from template repo 2024-07-08 11:12:07 +03:00
go.mod [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
go.sum [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
LICENSE Initial commit 2021-02-10 15:04:51 +03:00
locode_generate.go [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
locode_info.go [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
main.go [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
Makefile [#7] Add local tool for building database file 2024-07-09 18:54:05 +03:00
README.md [#5] Update README for local build 2023-04-24 15:44:24 +03:00
VERSION Rebranding 2022-12-22 16:28:24 +03:00

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