Skip to content

Commit

Permalink
Wrap container-image fetch eio with run_eio
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris committed Mar 29, 2024
1 parent 3d4e307 commit 7bcbe32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/container_image_extract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ end) = struct
in
of_oci_manifest manifest

let fetch ~log:_ ~rootfs base =
let fetch_with_eio ~log:_ ~rootfs base =
let module Ci = Container_image in
let open Container_image_spec in
Logs.info (fun f -> f "Fetching %s" base);
Expand All @@ -100,7 +100,10 @@ end) = struct
let digest = Descriptor.digest descriptor in
let single_image = Ci.Image.with_digest digest img in
Ci.checkout ~only_rootfs:true ~cache ~root single_image;
Lwt.return @@ get_environment_variables_from_manifest ~cache manifest img
get_environment_variables_from_manifest ~cache manifest img

let fetch ~log ~rootfs base =
Lwt_eio.run_eio @@ fun () -> fetch_with_eio ~log ~rootfs base
end

let make_fetcher ?(progress=true) ~fs ~net domain_mgr =
Expand Down
2 changes: 1 addition & 1 deletion lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
(public_name obuilder)
(preprocess (pps ppx_sexp_conv))
(flags (:standard -w -69))
(libraries fpath lwt lwt.unix fmt yojson tar-unix sexplib sqlite3 astring logs sha obuilder-spec cmdliner extunix container-image xdg))
(libraries lwt_eio fpath lwt lwt.unix fmt yojson tar-unix sexplib sqlite3 astring logs sha obuilder-spec cmdliner extunix container-image xdg))

0 comments on commit 7bcbe32

Please sign in to comment.