Repository navigation
Sandbox execution on Linux - #2241
Conversation
cc3d5b1 to
f4ee8d8
Compare
f4ee8d8 to
e43aeff
Compare
e43aeff to
6611cfd
Compare
6611cfd to
826050e
Compare
826050e to
de32f62
Compare
de32f62 to
4a88afc
Compare
4a88afc to
dfec500
Compare
dfec500 to
b6dbbc3
Compare
b6dbbc3 to
ca60c58
Compare
ca60c58 to
2a41f12
Compare
824e9d7 to
dcc15e7
Compare
dcc15e7 to
0d9e8bf
Compare
0d9e8bf to
61f29cc
Compare
61f29cc to
97f429c
Compare
|
Don't know why the mongo store tests are failing, they work locally. |
|
They were apparently depending on the fact that sandboxing was broken in Bazel due to the apparmor_restrict_unprivileged_userns setting. I have re-broken this for the Bazel runs, but it's still enabled for the Cargo version to ensure it's an actually tested code path. |
|
I've refactored into a separate module and written full safety comments for each unsafe call. I'm happy with this now, it will absolutely resolve the issue of #225 if it's activated. |
|
/build-image nativelink-worker-init |
|
/build-image |
|
Image built and pushed! |
|
Image built and pushed! |
|
I've updated this to send SIGTERM when namespaced to avoid the zombie issue. |
When executing on Linux there are issues with running as the init process and not reaping children. This is incompatible with the Tokio runtime. Therefore, in the pre_exec we fork a new process which becomes the init process for that execution. We can do this by making use of user namespacing. Since we're namespacing anyway, include the UTS and IPC namespaces to isolate the execution even more and make it more reproducible.
|
I've created zombie tests and also made sure the kill signal is raised correctly from the child. So that's nice. Also, the rebase fix-up is complete too. All ready to merge now. |
Description
When executing on Linux there are issues with running as the init process and not reaping children. This is incompatible with the Tokio runtime.
Therefore, in the pre_exec we fork a new process which becomes the init process for that execution. We can do this by making use of user namespacing. Since we're namespacing anyway, include the UTS and IPC namespaces to isolate the execution even more and make it more reproducible.
Type of change
Please delete options that aren't relevant.
How Has This Been Tested?
Tests are passing with and without the activation of the feature.
Checklist
bazel test //...passes locallygit amendsee some docsThis change is