winds-mobi / winds-mobi-providers

Real-time weather observations: weather data providers
https://winds.mobi
GNU Affero General Public License v3.0
8 stars 11 forks source link

Localhost setup #74

Closed MichalBryxi closed 11 months ago

MichalBryxi commented 11 months ago

Was following the repo README.md to try setup the project locally to try to contribute, but hit this snag:

dotenv -f .env.localhost run python providers/ffvl.py
/Users/michal/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/dotenv-2.8.1/lib/dotenv/cli.rb:54:in `exec': No such file or directory - run (Errno::ENOENT)
    from /Users/michal/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/dotenv-2.8.1/lib/dotenv/cli.rb:54:in `run'
    from /Users/michal/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/dotenv-2.8.1/bin/dotenv:4:in `<top (required)>'
    from /Users/michal/.rbenv/versions/3.2.2/bin/dotenv:25:in `load'
    from /Users/michal/.rbenv/versions/3.2.2/bin/dotenv:25:in `<main>'
ysavary commented 11 months ago

You are using a ruby version of dotenv, not the python version installed by https://github.com/winds-mobi/winds-mobi-providers/blob/main/pyproject.toml#L36

Did you activate the python environment with poetry shell (https://python-poetry.org/docs/basic-usage/#activating-the-virtual-environment)?

MichalBryxi commented 11 months ago

Heh, yeah I noticed that it says ruby but did not realise it can be global namespace collision. Nice :) I have zero clue about Python, literally just copy & pasted the commands from readme. Will try again, thank you.

ysavary commented 11 months ago

Python setup could be a bit tricky. You should start with docker compose setup. I simplified the docker compose deployment et updated the readme.

MichalBryxi commented 11 months ago

Ah yes, good idea. This actually seems to do what it's supposed to:

docker compose -f compose.services.yaml up

[+] Running 2/0
 ⠿ Container winds-mobi-providers-redis-1    Running                                                                                                                                                                                                                                                                 0.0s
 ⠿ Container winds-mobi-providers-mongodb-1  Running                                                                                                                                                                                                                                                                 0.0s
Attaching to winds-mobi-providers-mongodb-1, winds-mobi-providers-redis-1
winds-mobi-providers-mongodb-1  | {"t":{"$date":"2023-08-09T19:28:24.747+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1691609304:747754][1:0x7f26efb4e700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 1822, snapshot max: 1822 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 38"}}
winds-mobi-providers-mongodb-1  | {"t":{"$date":"2023-08-09T19:29:24.768+00:00"},"s":"I",  "c":"STORAGE",  "id":22430,   "ctx":"WTCheckpointThread","msg":"WiredTiger message","attr":{"message":"[1691609364:768750][1:0x7f26efb4e700], WT_SESSION.checkpoint: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 1824, snapshot max: 1824 snapshot count: 0, oldest timestamp: (0, 0) , meta checkpoint timestamp: (0, 0) base write gen: 38"}}
^CGracefully stopping... (press Ctrl+C again to force)
[+] Running 2/2
 ⠿ Container winds-mobi-providers-mongodb-1  Stopped                                                                                                 0.6s
 ⠿ Container winds-mobi-providers-redis-1    Stopped                                                                                                 0.5s
canceled

Thank you!