snikket-im / snikket-web-portal

This is the web portal for Snikket Chat services. To learn more about what Snikket Chat services are, check the website.
https://snikket.org
GNU Affero General Public License v3.0
32 stars 12 forks source link

Dockerfile: Ensure a compiler is available while pip-installing requirements #124

Closed mwild1 closed 2 years ago

mwild1 commented 2 years ago

Dependencies are not necessarily packaged for all architectures. In some cases (such as aiohttp, and others, on ARM) pip will attempt to compile the dependency from scratch. Since switching to multi-stage builds, we have been installing these without a compiler present which caused the build to fail on ARM architectures.

This commit temporarily installs build-essential packages while running pip, then removes them again afterwards.

@horazont Specifically requesting your review because I'm particularly curious some things, such as whether we need to be keeping things like python-setuptools around. I didn't change this behaviour for now, in case it's needed. Also, is hypercorn not in requirements.txt, or why were we (and still are) installing it separately? Now would be a good time to check this whole thing and fix any issues before we merge.

horazont commented 2 years ago

like python-setuptools around

If I recall correctly, setuptools is also responsible for finding some packages at runtime, through the "entrypoints" mechanism. "pip" is possibly disposable, as is "wheels". However, given that this is going to be a hotfix thing, let's maybe tackle that in a different issue.

is hypercorn not in requirements.txt

Correct, it is not. It is not technically needed to run the thing (quart run does just that), only to run it in production (which quart run is not suited for). And in that case you might want to choose any other ASGI implementation, so installing hypercorn seems like a choice of the deployment method rather than a choice of the software itself.