-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize magic-wormhole mailbox and relay images #26
Comments
I would be very hesitant to use a 'smaller' / less well-known (and tested) distribution like Alpine for a long-running, SPoF, high-security Internet server. This needs to be secure, and Debian seems to be like a great choice for that. Why do we care how big the image is? If we're considering changing how these are deployed, I would also ask why we would continue to use Docker at all given its dubious security track-record. |
If we start that discussion, I'd like to throw NixOS into the ring again. Its package set is one of the most up-to-date, and it is stable enough to be left unattended with auto-update IME. If our main motivator for currently using Docker is process isolation, then systemd service hardening can already do all what we need. |
Yeah, in my mind NixOS would be obvious "other" choice since a bunch of our other services are deployed using NixOS. |
The size (and the "broken" cache) is mostly annoying when developing and testing, not really a problem when deploying indeed (unless you're deploying a lot). But smaller image also tends to improve security (less software = less vulnerabilities).
In general, the smaller, the better. IMHO, adding |
@piegamesde I believe our main motivator of using docker is ease of deployment. (And yes, Docker conflates too many things IMHO) IIRC for good isolation one should also not run the thing in the docker container as root - since that makes escaping the container / namespace / etc easier. Maybe running all of Docker in rootless mode is feasible/simpler? |
I agree: moving from Debian to Alpine might be a step too far AND do not seem to be an obvious option in the case of the mailbox and relay as Alpine base images are not available for pypy!
NixOS is indeed a path we should have a good look at. We had a discussion about Docker vs NixOS in an open pairing session yesterday. |
Good point @hacklschorsch, I would be surprised if we could not run these services rootless. |
It seems to work just fine. But I'll create a separate issue because the change will require some work elsewhere. |
It might be worth clarifying the "NixOS" solution. It can be broken into a few pieces:
Another nice thing to note here is that the first two options are each incremental steps towards the last option. |
Thank you @exarkun : it is exactly what I'd like to integrate in this general document we've talked about. |
I do understand that any one change to the existing deployments is "small" -- the reason I bring it up now is because we never "actually chose" Docker (it was an accident) and continuing to do a lot of "small" tweaks (and then subsequent downstream updates, fixes etc) is that in the end "a lot" of time has then been sunk into a thing. So: do we want that thing? (Or more accurately here: do we want more of the thing, or less of it?) |
I'm not sure how to accurately measure the time Docker has cost for the whole magic-wormhole project so far. Maybe there was more time spend downstream in LeastAuthority/mw-projects? I'm not sure I can tell. Though, even if I find it hard to picture how we're going to save time, I'll be happy to migrate to anything else (as long as it FOSS). Back to this issue, I propose to consider the optimizations introduced by #28 to be good enough once staging will be tested with the new images. |
I still need to deploy these smaller images, but I was waiting to have better tag upstream and dependabot enabled to verify the automation has been improved:
I'm not so sure I should wait that long... |
Working smoothly on staging since yesterday:
|
Following up on #20 (and #21), we may want to reduce the size of the mailbox and relay image using slim-bullseye images (from 1.5GB to 929MB).
Alternatively, we may want to switch to Alpine (see #22).
Although, we should assess the possible impact on our own back end which consumes those images (extensive test on staging preferable).
In addition, there is an issue in the current Dockerfiles.
The following RUN commands should be written in a single line:
Also, moving this RUN command a few line above would improve the caching (at least when building locally).
The text was updated successfully, but these errors were encountered: