Closed arnesetzer closed 3 weeks ago
@ajnisbet Any feedback? 🙈
Thanks for this Arne!
It's no my radar! I've been on holiday the last month and there's a few things I'll need to tweak before merging, here's a quick review (for my later reference):
subprocess
instead of os.system
uwsgi
with supervisord
instead of killing itconfig.yaml
and example-config.yaml
Hi, thanks for the feedback.
* [ ] Use `subprocess` instead of `os.system`
Done, now using pymemcache to avoid any system manipulation.
- [ ] Stop and start
uwsgi
withsupervisord
instead of killing itI'm a little bit puzzled how to achieve this. I played around with the
supervisorctl
but this requires some serious changes in the supervisord configuration (
- [ ] Add warm cache command
Already done 😄
- [ ] Watch both
config.yaml
andexample-config.yaml
Also done now.
Thanks for this work @arnesetzer !
Here's the final working code if you're interested: https://github.com/ajnisbet/opentopodata/commit/d1fc1a733a097b2fbd5dd39336c29a15fb8f0840
As discussed in #99 a try to enable hot reloading for config (and therefore datasets) without rebuilding the docker image again.
What changed: A watchdog (
/app/watcher.py
) is etablish via supervisor. On a config.yaml add or change (CAVE: Due to docker limitations it won't happen if the inode changes, see: https://medium.com/@jonsbun/why-need-to-be-careful-when-mounting-single-files-into-a-docker-container-4f929340834) the watchdog is triggerd an kills the uwsgi and flushes memcached.