feat: handle hermit images + config nested in image#1135
feat: handle hermit images + config nested in image#1135fogti wants to merge 1 commit intohermit-os:mainfrom
Conversation
45664d4 to
5961c63
Compare
|
Somehow, it errornously interprets some file paths as directories now... |
5961c63 to
b3e24e7
Compare
|
Okay, I fixed the regressions (which were basically an |
In the short run, I'd say that it'd make sense to put the crate in the Uhyve repository (which we already do for I am not sure if we'd make the effort to somehow use our work in QEMU as well in the short run. |
|
Yes, put the crate into uhyve. We can split it off later if we want to. |
|
Does it make sense to put it into uhyve if we need it in |
b3e24e7 to
121639a
Compare
I mean, we need |
c647080 to
a369817
Compare
|
Since this is incubating in Uhyve and has a main focus on Uhyve (for now at least, as I understand it), I think putting it in this repo in the beginning would be fine. Any changes would also be more flexible, since they would not require cross-repo coordination. Once this matures, we can reevaluate this, of course. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1135 +/- ##
==========================================
- Coverage 76.36% 75.96% -0.41%
==========================================
Files 29 30 +1
Lines 3613 3798 +185
==========================================
+ Hits 2759 2885 +126
- Misses 854 913 +59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1dfc883 to
0c060d1
Compare
Agreed |
1bc7b5f to
2f28975
Compare
|
The most important TODO item is now: Introduce some caching mechanism which handles decompressing all the relevant images, and later allows us to reuse the decompressed images both for finding the included config file, extracting the included kernel, and the setup of file mapping. edit: The first part of this is solved now (I extracted a |
2f28975 to
2ac8970
Compare
hermit-image-reader/src/lib.rs
Outdated
| use alloc::vec::Vec; | ||
|
|
||
| /// We assume that all images are gzip-compressed | ||
| pub fn decompress_image(data: &[u8]) -> Result<Vec<u8>, compression::prelude::CompressionError> { |
There was a problem hiding this comment.
I'd propose a newtype around the Vec<u8> like tarbytes and a from(tarbytes) for the tar_parser
124bbc7 to
0125229
Compare
|
script for testing: #!/usr/bin/env bash
uhyve="$HOME/devel/uhyve"
kernel="fs_tests"
image="$(realpath ./$kernel.hermit)"
set -e
cd "$uhyve"
echo "=== building kernel $kernel ... ==="
pushd tests/test-kernels
HERMIT_LOG_LEVEL_FILTER=Debug cargo +nightly build -Zbuild-std=std,panic_abort --target=x86_64-unknown-hermit --bin "$kernel"
KERNEL_PATH="$(realpath target/x86_64-unknown-hermit/debug/$kernel)"
popd
echo "=== building image $image ... ==="
TMPD="$(mktemp -d)"
echo "setting up temporary directory $TMPD ..."
pushd "$TMPD"
cat > "$TMPD/"hermit_config.toml <<EOF
version = "1"
kernel = "$kernel"
[input]
kernel_args = []
app_args = ["testname=open_read", "filename=/root/hello_world.txt"]
env_vars = []
[requirements]
EOF
cp -t. "$KERNEL_PATH"
mkdir "$TMPD/root"
echo "Hello, world!" > "$TMPD/root/hello_world.txt"
rm -f "$image" && tar -czvf "$image" *
popd
rm -rf "$TMPD"
echo "$image"
echo "=== running image $image ... ==="
export RUST_LOG="${RUST_LOG:-debug}"
"$uhyve"/target/release/uhyve "$image"appears to work |
a2e293d to
bfaf058
Compare
|
Marked as draft because this depends on an experimental/version-controlled |
f35f947 to
4e967bf
Compare
|
Something breaks in strict file isolation, but it's weird... Unfortunately, I can't even reproduce this on my laptop, i.e. this is almost impossible for me to debug as-is. |
e136f4a to
b2f808a
Compare
b2f808a to
284e620
Compare
- fix(isolation): Fix resolution of archive root Without this fix, one gets the following error message: [WARN uhyvelib::isolation::filemap] In hermit image [REDACTED].hermit: unable to find file "." -> /root - Use experimental hermit-entry with image-reader PR applied
284e620 to
8a8269e
Compare
|
TODO: forward Hermit image as blob to the kernel (via paging / |
|
Blocked on #1256. |
This fixes the first part of #1015.
Open TODOs:
hermit-image-reader.hermit-image-reader.isolation::image::Cacheimplements a cache for decompressed + parsed hermit imageshermit-image-readercrate?tarfssupport (as part of image support) kernel#2009)The current state is basically "At least it compiles".
Note that it was made clear in discussions that iterating over the tar file 2 or 3 files (linear scan) is considered acceptable, when necessary to keep the amount of data to be passed to the kernel at a minimum).