Skip to content

Commit

Permalink
assume that the hermit environment is already part of the OCI image
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Oct 8, 2024
1 parent c1dc525 commit 8e2ec03
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,8 @@ jobs:
sudo crictl version
- name: Pull images
run: |
docker pull ghcr.io/hermit-os/hermit_env:latest
docker pull ghcr.io/hermit-os/rusty_demo:latest
sudo crictl pull ghcr.io/hermit-os/rusty_demo:latest
- name: Setup Hermit environment
run: |
docker export $(docker create ghcr.io/hermit-os/hermit_env:latest) > hermit-env.tar
sudo mkdir -p /run/runh/hermit
sudo tar -xf hermit-env.tar -C /run/runh/hermit
- name: Setup rootfs
run: |
docker export $(docker create ghcr.io/hermit-os/rusty_demo:latest) > runh-image.tar
mkdir -p /home/runner/runh-image/rootfs
tar -xf runh-image.tar -C /home/runner/runh-image/rootfs
- name: Create CRI configurations
run: |
echo '{ "metadata": { "name": "hermit-sandbox", "namespace": "default", "attempt": 1, "uid": "hdishd83djaidwnduwk28bcsb" }, "log_directory": "/tmp", "linux": { } }' \
Expand Down
31 changes: 1 addition & 30 deletions src/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,36 +170,7 @@ pub fn create_container(
});

//Setup file system
let rootfs_path_abs = if is_hermit_container {
let overlay_root = container_dir.join("rootfs");
let overlay_workdir = overlay_root.join("work");
let overlay_upperdir = overlay_root.join("diff");
let overlay_mergeddir = overlay_root.join("merged");
mounts::create_all_dirs(&overlay_workdir);
mounts::create_all_dirs(&overlay_upperdir);
mounts::create_all_dirs(&overlay_mergeddir);
let datastr = format!(
"lowerdir={}:{},upperdir={},workdir={}",
hermit::get_environment_path(&project_dir, &hermit_env)
.as_os_str()
.to_str()
.unwrap(),
bundle_rootfs_path_abs.as_os_str().to_str().unwrap(),
overlay_upperdir.as_os_str().to_str().unwrap(),
overlay_workdir.as_os_str().to_str().unwrap()
);
nix::mount::mount::<str, PathBuf, str, str>(
Some("overlay"),
&overlay_mergeddir,
Some("overlay"),
nix::mount::MsFlags::empty(),
Some(datastr.as_str()),
)
.unwrap_or_else(|err| panic!("Could not create overlay-fs at {:?}: {}", overlay_root, err));
Cow::from(overlay_mergeddir.canonicalize().unwrap())
} else {
Cow::from(&bundle_rootfs_path_abs)
};
let rootfs_path_abs = Cow::from(&bundle_rootfs_path_abs);

//Pass spec file
let mut config = bundle;
Expand Down

0 comments on commit 8e2ec03

Please sign in to comment.