Skip to content

Commit

Permalink
utils: added option to disable docker use
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Dec 6, 2017
1 parent 10bdfc4 commit 9d778c4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/utils/repo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ let to_term ?(precious = []) ~outdir items =
|> app (pure (generate outdir))
|> fun init -> List.fold precious ~init ~f:use

let build ?np ?mem ?logger ?keep_all ?precious ?bistro_dir ~outdir repo =
Term.run ?np ?mem ?logger ?keep_all ?bistro_dir (to_term ~outdir ?precious repo)
let build ?np ?mem ?logger ?keep_all ?use_docker ?precious ?bistro_dir ~outdir repo =
Term.run ?np ?mem ?logger ?keep_all ?use_docker ?bistro_dir (to_term ~outdir ?precious repo)

let dry_run ?precious repo =
Term.dry_run (to_term ~outdir:"res" ?precious repo)
Expand Down
1 change: 1 addition & 0 deletions lib/utils/repo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ val build :
?mem:[`GB of int] ->
?logger:Scheduler.logger ->
?keep_all:bool ->
?use_docker:bool ->
?precious:Bistro.any_workflow list ->
?bistro_dir:string ->
outdir:string -> t -> unit
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/term.ml
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ let has_error traces =

let create
?(np = 1) ?mem:(`GB mem = `GB 1) ?logger ?(keep_all = true)
?(bistro_dir = "_bistro")
?(use_docker = true) ?(bistro_dir = "_bistro")
app
=
let open Lwt in
let allocator = Allocator.create ~np ~mem:(mem * 1024) in
let workflows = to_workflow_list app in
let dag, goals, precious = Scheduler.compile workflows in
let config = Task.config ~db_path:bistro_dir ~use_docker:true ~keep_all ~precious in
let config = Task.config ~db_path:bistro_dir ~use_docker ~keep_all ~precious in
Scheduler.(run ?logger ~goals config allocator dag) >>= fun traces ->
(
match logger with
Expand All @@ -180,8 +180,8 @@ let create
)
else Ok (eval config.Task.db app)

let run ?np ?mem ?logger ?keep_all ?bistro_dir app =
let thread = create ?np ?mem ?logger ?keep_all ?bistro_dir app in
let run ?np ?mem ?logger ?keep_all ?use_docker ?bistro_dir app =
let thread = create ?np ?mem ?logger ?keep_all ?use_docker ?bistro_dir app in
match Lwt_main.run thread with
| Ok x -> x
| Error msg ->
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/term.mli
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ val create :
?mem:[`GB of int] ->
?logger:Scheduler.logger ->
?keep_all:bool ->
?use_docker:bool ->
?bistro_dir:string ->
'a t -> ('a, string) result Lwt.t

Expand All @@ -32,6 +33,7 @@ val run :
?mem:[`GB of int] ->
?logger:Scheduler.logger ->
?keep_all:bool ->
?use_docker:bool ->
?bistro_dir:string ->
'a t -> 'a

Expand Down

0 comments on commit 9d778c4

Please sign in to comment.