-
Notifications
You must be signed in to change notification settings - Fork 125
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
Jailer configuration API cleanup and improved logging with Debug log level #255
Conversation
Squashed commits e4b889f + 61d91a7 into a single one, preserving both commit messages:
On the branch are now 8 commits: the 6 previous ones + 1 merge + 1 new squashed commit.
It seems like something has gone wrong though, now there are 23 commits on the branch? |
Sorry. The "signed-off" line is called Developers Certificate of Origin (DCO) and you should sign with your name, not mine. Helm's blog post would be helpful to understand the meaning. I'm not so sure how did you get the 23 commits. You could clean up your branch by |
5d0696c
to
1ebbada
Compare
Thanks for clarifying! I've cleaned up the pull request and changed the "signed-off" lines. |
Awesome! Can you take a look this test failure? I think you may need to update the test. |
Sure, I've updated the tests - seems fine now. |
Sorry for the late review. The overall change looks good! Regarding commits, I think you could organize them better. For example, 1ebbada undos a258d73. How about combining both of them together? The last three changes are all about tests. If you have a logical distinction between them, it would be better to combine them together. http://gitforteams.com/resources/commit-granularity.html would be good read regarding the granularity of Git commits. |
d296f18
to
3064ce6
Compare
…er, simplify API and code Signed-off-by: Philipp Mieden <[email protected]>
Signed-off-by: Philipp Mieden <[email protected]>
Signed-off-by: Philipp Mieden <[email protected]>
Signed-off-by: Philipp Mieden <[email protected]>
3064ce6
to
a171aa1
Compare
No problemo, I'll take this as a free git rebase masterclass ;-) Combined the log message and test update commits into a single one! |
Looks great. Thanks for the contribution! |
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263) * Fix Benchmark Goroutine (firecracker-microvm#259) * Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255) * Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253) * Fixed error that was not being test against in `TestWait` (firecracker-microvm#251) * Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230) * Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225) * Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218) Signed-off-by: Debian <[email protected]>
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263) * Fix Benchmark Goroutine (firecracker-microvm#259) * Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255) * Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253) * Fixed error that was not being test against in `TestWait` (firecracker-microvm#251) * Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230) * Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225) * Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218) Signed-off-by: Debian <[email protected]>
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263) * Fix Benchmark Goroutine (firecracker-microvm#259) * Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255) * Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253) * Fixed error that was not being test against in `TestWait` (firecracker-microvm#251) * Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230) * Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225) * Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218) Signed-off-by: Debian <[email protected]>
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263) * Fix Benchmark Goroutine (firecracker-microvm#259) * Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255) * Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253) * Fixed error that was not being test against in `TestWait` (firecracker-microvm#251) * Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230) * Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225) * Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218) Signed-off-by: Debian <[email protected]> Signed-off-by: xibz <[email protected]>
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263) * Fix Benchmark Goroutine (firecracker-microvm#259) * Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255) * Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253) * Fixed error that was not being test against in `TestWait` (firecracker-microvm#251) * Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230) * Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225) * Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218) Signed-off-by: xibz <[email protected]>
Jailer configuration API cleanup
This pull request
The rootfs parameter is superfluous, because all the information required to assemble it is already contained in the configuration structure.
Furthermore its name is misleading: rootfs indicates that the root filesystem image should be passed (which will obviously fail), whereas actually the path to the jailed filesystem root on the host is desired.
I think it is cleaner to build this path when it's needed, then to duplicate the configuration information by generating it there.
This is an example JailerConfig initialisation with the updated API:
The following code is used in the LinkFilesHandler to create the rootfs path that points to the correct place in the jail:
The following function has been removed and replaced with a direct invocation of os.Link():
The cfg parameter is always unused and therefore superfluous.
The order of parameters is flipped in the function signature: dst, src VS os.Link(src, dst)
I therefore propose to simplify this call by invoking os.Link(src, dst) and returning the resulting error directly.
When using the Debug log level, the final arguments passed to shell are now logged for easier troubleshooting.
This has been implemented in startVMM:
cc @ppartarr
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.