Repository navigation
A dull, cranky wrapper for Buildah and Skopeo. #7171
Replies: 2 comments 2 replies
|
Cleanup in buildah wasn't really well thought-out for a long time, but we recently merged changes to lean in on using Go's context package to coordinate cancellation and cleanup, and to tie that to the interrupt/hangup/terminate signals at the CLI. It's definitely helped with a whole class of problems that would crop up when a build failed unexpectedly or received an interrupt signal, so I think you'll be okay sending it a SIGTERM. The big caveat there is that we haven't cut a new release branch since we merged that change, but I expect that to change in the next week or two. |
|
@nalind |
Uh oh!
There was an error while loading. Please reload this page.
I am developing a container build workflow tool—one that I can actually be satisfied with—that wraps
buildahandskopeoto isolate container storage on a strictly per-project basis.https://github.com/ryuichi-ichinose/dull
However, as I've been learning while building this tool, I feel I've reached the limits of my own understanding (even after arguing with an LLM).
Let me ask you a few questions.
@nalind Process cleanup
I want to make sure my approach to cleaning up
buildahchild processes is sane. Assumingbuildahproperly cleans up its own inner container processes when it receives a signal, I am deliberately not using a process group kill. Instead, I just send aSIGTERMdirectly to thebuildahchild process, falling back toSIGKILLafter a timeout.You can see this approach in
src/engine/process.rsinside theDropimplementation forChildGuard, combined withPR_SET_PDEATHSIGinsrc/engine/buildah.rspre_exec.Is focusing solely on the direct
buildahchild sufficient here?@rhatdan SELinux labeling in isolated storage
For the per-project isolated storage directory, I'm directly applying
system_u:object_r:container_var_lib_t:s0viaxattr::set. Since this is temporary, I also print a warning to the user showing thesemanage fcontextandrestoreconcommands they need to run to persist it across relabels.You can see this in
src/venv.rs.Is this the right approach and label for a per-project storage directory living in a user's workspace?
Please let me know if I'm making any completely unnatural assumptions about how
buildahandskopeoshould be driven as an underlying engine. Once I have confirmation on this, I will start implementing the test cases.As for the overall design philosophy, it's a tool at least worth making fun of.
All reactions