f4lco / om-parser-stw-potsdam-v2

Connect canteens of the Studentenwerk Potsdam to OpenMensa
3 stars 7 forks source link

add new Mensa Filmuniversität #13

Closed SusanneBue closed 3 years ago

SusanneBue commented 3 years ago

a new canteen openend recently in the Filmuniversität

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 1042


Totals Coverage Status
Change from base Build 961: 0.0%
Covered Lines: 139
Relevant Lines: 141

💛 - Coveralls
f4lco commented 3 years ago

Thank you very much! That looks very good. I'm curious, let me ask:

For the PR: I'll merge it as-is and then ping the guy who deploys it 👍 You may expect a couple more notifications from GitHub.

🚀

SusanneBue commented 3 years ago

Sorry for the late response, seems like I missed your comment...

I did not have a deeper look into the docs, I just skimmed the code. Compliments to your structure that adding a new mensa just required editing a config file :D Running the project locally worked smoothly. I consume the openmensa API to post the daily menu to a slack channel.

Can I somehow support in registering the new canteen? It does not yet show up or am i missing something?

f4lco commented 3 years ago

Thank you for the kind words and sorry for the long delay, busy times.

I can confirm the canteen is not on OpenMensa, but the parser works and shows that the mensa has actually a menu with meals 🤷‍♂️ (last time I checked I believe they were closed or something).

So let's ping @kaifabian, he's doing the operations. @kaifabian is there any piece missing, like some sort of registration on the OpenMensa platform? Filmuniversität ain't showing up. Thanks for checking.

kaifabian commented 3 years ago

Sorry for the delay, debugging this took a bit longer than expected. Long story short: I updated the Linux kernel and libc on the host running the parser, but didn't update the Docker runtime. Thus it used an outdated libseccomp (or profile or whatever= that had issues with the "new" faccessat2 syscall (making that syscall return -EPERM).

Also, Docker thankfully kept the old image running (great, so that other canteens are still available on OpenMensa), but the failure emails didn't leave the send queue...

I've updated the necessary packages and with the next deployment run, the new canteen should reach production.

kaifabian commented 3 years ago

Ugh. New deployment is failing with:

Traceback (most recent call last):
  File "/opt/om-parser-stw-potsdam-v2/./stw_potsdam/views.py", line 6, in <module>
    import cachetools as ct
ModuleNotFoundError: No module named 'cachetools'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

@f4lco any idea what might cause this? If I run a pipenv run python and import cachetools in the container, everything looks alright.

f4lco commented 3 years ago

If I run a pipenv run python and import cachetools in the container, everything looks alright.

@kaifabian That really odd. I've got no idea and no real starting point, because I lack a reproducer. I tried successfully:

$ docker build .
$ docker run -p 3080:3080 475 # image id
$ http :3080
$ http :3080/canteens/filmuniversitaet/meta
$ http :3080/canteens/filmuniversitaet/menu

🤷 It must be some type of environment issue. Other random issues on GH bring up that cachetools dropped Python 2 support at some point. Are you sure the interpreter is not Python 2? I got a slightly different import-related error when I try python2 -m stw_potsdam.views on my machine.

kaifabian commented 3 years ago

Weird. If I install uwsgi via pip (apk add gcc linux-headers musl-dev python3-dev && pipenv run pip install uwsgi), then everything works.

Also weird: straceing the whole pipenv run uwsgi ... command from the RUN command shows the following error:

stat("/opt/om-parser-stw-potsdam-v2/.venv/lib/python3.9/site-packages", 0x7ffcb1382950) = -1 ENOENT (No such file or directory)

... which shouldn't happen as the running Python version is 3.8 (and the site-packages folder is also in .../.venv/lib/python3.8). Creating a symlink (python3.9 -> python3.8) mitigates the issue, but I don't think this should ever happen.

f4lco commented 3 years ago

@kaifabian I don't think Filmuniversität is showing up on the map https://openmensa.org/#14/52.3879/13.1263. Do you think there is still anything wrong with it?

kaifabian commented 3 years ago

Interesting. It is definitely synced to OpenMensa (ref. https://openmensa.org/c/1222), but for some reason it's missing geo data and I'm not allowed to change it. Investigating.

kaifabian commented 3 years ago

Should be fixed now.

f4lco commented 3 years ago

Thank you very much! 💯 And thanks @SusanneBue for bearing with us.