[#7] Add local tool for building database file #11

Merged
realloc merged 4 commits from george.bartolomey/frostfs-locode-db:feature-local-util into master 2024-09-04 19:50:57 +00:00
2 changed files with 15 additions and 15 deletions
Showing only changes of commit 2cb22574b9 - Show all commits

View file

@ -3,8 +3,8 @@
First, thank you for contributing! We love and encourage pull requests from
everyone. Please follow the guidelines:
- Check the open [issues](https://git.frostfs.info/TrueCloudLab/frostfs-node/issues) and
[pull requests](https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls) for existing
- Check the open [issues](https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/issues) and
acid-ant marked this conversation as resolved Outdated

frostfs-node -> frostfs-locode-db
Need to do the same changes for the pull requests too.

frostfs-node -> frostfs-locode-db Need to do the same changes for the `pull requests` too.

I fixed that.

I fixed that.
[pull requests](https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/pulls) for existing
discussions.
- Open an issue first, to discuss a new feature or enhancement.
@ -23,23 +23,23 @@ everyone. Please follow the guidelines:
## Development Workflow
Start by forking the `frostfs-node` repository, make changes in a branch and then
Start by forking the `frostfs-locode-db` repository, make changes in a branch and then

Need to fix repository name.

Need to fix repository name.

Fixed.

Fixed.
send a pull request. We encourage pull requests to discuss code changes. Here
are the steps in details:
### Set up your Forgejo repository
Fork [FrostFS node upstream](https://git.frostfs.info/TrueCloudLab/frostfs-node) source
Fork [FrostFS node upstream](https://git.frostfs.info/TrueCloudLab/frostfs-locode-db) source
repository to your own personal repository. Copy the URL of your fork (you will
need it for the `git clone` command below).
```sh
$ git clone https://git.frostfs.info/TrueCloudLab/frostfs-node
$ git clone https://git.frostfs.info/TrueCloudLab/frostfs-locode-db
```
### Set up git remote as ``upstream``
```sh
$ cd frostfs-node
$ git remote add upstream https://git.frostfs.info/TrueCloudLab/frostfs-node
$ cd frostfs-locode-db
$ git remote add upstream https://git.frostfs.info/TrueCloudLab/frostfs-locode-db
$ git fetch upstream
$ git merge upstream/master
...

View file

@ -27,7 +27,7 @@ following sources:
## Prerequisites
- Latest [frostfs-cli](https://git.frostfs.info/TrueCloudLab/frostfs-node) tool
- Go 1.21
## Quick start
@ -41,13 +41,13 @@ $ make
## Building
Then run frost-cli command to generate boltDB file.
Then run frost-cli command to generate UN/LOCODE database.
acid-ant marked this conversation as resolved Outdated

frost-cli -> frostfs-locode-db
boltDB file -> UN/LOCODE database

`frost-cli` -> `frostfs-locode-db` `boltDB file` -> `UN/LOCODE database`

Updated.

Updated.
```
$ frostfs-cli util locode generate --help
generate UN/LOCODE database for FrostFS
$ ./frostfs-locode-db generate
Generate UN/LOCODE database for FrostFS
Usage:
frostfs-cli util locode generate [flags]
frostfs-locode-db generate [flags]
Flags:
--airports string Path to OpenFlights airport database (csv)
@ -58,7 +58,7 @@ Flags:
--out string Target path for generated database
--subdiv string Path to UN/LOCODE subdivision database (csv)
$ ./frostfs-cli util locode generate \
$ ./frostfs-locode-db generate \
--airports airports.dat \
--continents continents.geojson \
--countries countries.dat \
@ -69,9 +69,9 @@ $ ./frostfs-cli util locode generate \
**Database generation might take some time!**
You can test generated database with `frostfs-cli`.
You can test generated database with `frostfs-locode-db`.
acid-ant marked this conversation as resolved Outdated

frostfs-cli -> frostfs-locode-db

`frostfs-cli` -> `frostfs-locode-db`

Done.

Done.
```
$ frostfs-cli util locode info --db locode_db --locode 'RU LED'
$ frostfs-locode-db info --db locode_db --locode 'RU LED'
Country: Russia
Location: Saint Petersburg (ex Leningrad)
Continent: Europe