feat(docker): upgrade litestream to v0.5.0#3165
feat(docker): upgrade litestream to v0.5.0#3165peterschmidt85 merged 6 commits intodstackai:masterfrom
Conversation
|
@DragonStuff @sanbyk Thank you very much for the PR. Of course I will review this PR shortly, but just want to confirm, do you plan to actually use dstack with Litestream? |
peterschmidt85
left a comment
There was a problem hiding this comment.
Please see comments.
You can quickly validate if the configuration build is valid by running, for example:
docker build --build-arg VERSION=0.19.31 --load -f release/Dockerfile .
from docker/server (and -f stgn/Dockerfile for staging version)
Co-authored-by: Andrey Cheptsov <54148038+peterschmidt85@users.noreply.github.com>
Co-authored-by: Andrey Cheptsov <54148038+peterschmidt85@users.noreply.github.com>
|
@peterschmidt85 Incredible, you are so fast at reviewing, I apologize as I was just about to test and I think I inconvenienced you with my typo. Thank you very much for fixing my PR up! Looks like it builds successfully, and I'm going to run this image on our infra as well to test. Details
|
|
|
@peterschmidt85 Good catch. After working with Litestream on another project, it has a few caveats and is definitely still pre-v1. Perhaps going down the route of using PostgreSQL is a good option, but I was thinking it would be really nice to not have another PostgreSQL database to manage. Don't worry, I totally understand the risks of basically having a single server for I've written a short bash script to implement the
After deleting the container and restarting, it comes up correctly as well.
Perhaps in a follow-up PR it would be good to add additional arguments to allow Litestream args to be set from environment variables. |
peterschmidt85
left a comment
There was a problem hiding this comment.
From my side, it looks good. @r4victor please have a look too just in case!
|
@DragonStuff Merged. Please give it a thorough test, and let us know if all is good! |
@peterschmidt85, we did some testing overnight with a service running, with the dstack deployment on spot instances to make sure it gets interrupted a few times and everything seems to work as expected. We will keep this running for our staging environment and if we encounter any issues, I’ll make sure to make an issue and PR to fix it. Thanks again for your prompt assistance, dstack is awesome! 🥂 |
SSHTunnel.open() starts the ssh process with -f option, which causes it to become a daemon (it calls daemon(3) after authentication). Then, SSHTunnel.close() uses `ssh -O exit` to ask that daemon process to exit (the processes communicate via the control socket, -S option). The daemon exits, and then PID 1 should reap it. Before #3165, PID 1 was bash, which handles SIGCHLD, properly wait(2)ing children, but in that pull request exec was added, making `dstack server` PID 1. dstack does nothing with SIGCHLD (neither handles nor explicitly ignores it), thus the default disposition (ignore the signal but do not discard children) leads to an evergrowing number of unreaped zombies. Fixes: #3291
SSHTunnel.open() starts the ssh process with -f option, which causes it to become a daemon (it calls daemon(3) after authentication). Then, SSHTunnel.close() uses `ssh -O exit` to ask that daemon process to exit (the processes communicate via the control socket, -S option). The daemon exits, and then PID 1 should reap it. Before #3165, PID 1 was bash, which handles SIGCHLD, properly wait(2)ing children, but in that pull request exec was added, making `dstack server` PID 1. dstack does nothing with SIGCHLD (neither handles nor explicitly ignores it), thus the default disposition (ignore the signal but do not discard children) leads to an evergrowing number of unreaped zombies. Fixes: #3291


The SRE team at TableCheck is attempting to deploy dstack for our GPU workloads, but we are currently blocked due to an issue we have identified with EKS Pod Identity (OIDC) support and Litestream.
This pull request in Litestream adds support benbjohnson/litestream#683, but the version of litestream used in dstack's Docker images is quite old (v0.3.9) and doesn't include this support.
As a result, the Docker image will start with the following error from Litestream:
This pull request updates the version of Litestream to the latest version available in https://github.com/benbjohnson/litestream/releases.