let configured ~(run_program : Machine.Make_fun.t) ~host ~install_path () =
let open KEDSL in
let conf =
com ~install_path "create --name %s --file %s/%s"
env_name install_path config in
let make =
run_program
~requirements:[
`Internet_access;
`Self_identification ["conda"; "configuration"];
]
Program.(
sh conf
&& shf "source %s %s" (activate ~install_path) env_name
&& chain (List.map ~f:(shf "pip install %s") [
"pyomo";
"six";
"packaging";
])
)
in
let edges = [
depends_on (installed ~run_program ~host ~install_path);
depends_on (cfg_exists ~run_program ~host ~install_path);
] in
let biokepi_env =
Command.shell ~host (com ~install_path "env list | grep %s" env_name) in
let product =
object method is_done = Some (`Command_returns (biokepi_env, 0)) end in
workflow_node product ~make ~name:"Conda is configured." ~edges