From 8e2ec03da98ba66bd948e61262d7a1fcbaeffee1 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 8 Oct 2024 12:41:56 +0000 Subject: [PATCH] assume that the hermit environment is already part of the OCI image --- .github/workflows/ci.yml | 11 ----------- src/create.rs | 31 +------------------------------ 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac46b57c..9f016224 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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": { } }' \ diff --git a/src/create.rs b/src/create.rs index 837a11b2..f39b24a3 100644 --- a/src/create.rs +++ b/src/create.rs @@ -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::( - 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;