parent
0560a16b73
commit
a092200840
@ -111,22 +111,8 @@ async def cli_async() -> int:
|
|||||||
os.path.join(head.directory, "depcache.sqlite3")
|
os.path.join(head.directory, "depcache.sqlite3")
|
||||||
)
|
)
|
||||||
|
|
||||||
# eprint("Checking dependency cache…")
|
kitchen = Kitchen(head, dep_cache)
|
||||||
# start_ts = time.monotonic()
|
await kitchen.prepare_to_cook()
|
||||||
# depchecks = await run_dep_checks(head, dep_cache, order)
|
|
||||||
# end_ts = time.monotonic()
|
|
||||||
# eprint(f"Checking finished in {end_ts - start_ts:.3f} s.") # TODO show counts
|
|
||||||
#
|
|
||||||
# for epoch, items in enumerate(order):
|
|
||||||
# print(f"----- Course {epoch} -----")
|
|
||||||
#
|
|
||||||
# for item in items:
|
|
||||||
# if isinstance(item, Recipe):
|
|
||||||
# state = depchecks[item].label.name
|
|
||||||
# print(f" > recipe ({state}) {item}")
|
|
||||||
# elif isinstance(item, tuple):
|
|
||||||
# kind, ident, extra = item
|
|
||||||
# print(f" - we now have {kind} {ident} {dict(extra)}")
|
|
||||||
|
|
||||||
eprint("Ready to cook? [y/N]: ", end="")
|
eprint("Ready to cook? [y/N]: ", end="")
|
||||||
if argp.yes:
|
if argp.yes:
|
||||||
@ -136,17 +122,6 @@ async def cli_async() -> int:
|
|||||||
eprint("Stopping.")
|
eprint("Stopping.")
|
||||||
return 101
|
return 101
|
||||||
|
|
||||||
kitchen = Kitchen(head, dep_cache)
|
|
||||||
|
|
||||||
# for epoch, epoch_items in enumerate(order):
|
|
||||||
# print(f"Cooking Course {epoch} of {len(order)}")
|
|
||||||
# await kitchen.run_epoch(
|
|
||||||
# epoch_items, depchecks, concurrency_limit_per_host=8
|
|
||||||
# )
|
|
||||||
#
|
|
||||||
# for sous in hosts: TODO this is not definitely safe
|
|
||||||
# await dep_cache.sweep_old(sous)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await kitchen.cook_all()
|
await kitchen.cook_all()
|
||||||
finally:
|
finally:
|
||||||
|
@ -173,13 +173,9 @@ class Kitchen:
|
|||||||
|
|
||||||
return await self._chanproheads[hostuser]
|
return await self._chanproheads[hostuser]
|
||||||
|
|
||||||
async def cook_all(self):
|
async def prepare_to_cook(self):
|
||||||
await self._emit_fridge_resources()
|
await self._emit_fridge_resources()
|
||||||
|
|
||||||
num_workers = 8
|
|
||||||
|
|
||||||
self._sleeper_slots = num_workers - 1
|
|
||||||
|
|
||||||
for vertex in self.head.dag.vertices:
|
for vertex in self.head.dag.vertices:
|
||||||
if isinstance(vertex, Recipe):
|
if isinstance(vertex, Recipe):
|
||||||
rec_meta = self.head.dag.recipe_meta[vertex]
|
rec_meta = self.head.dag.recipe_meta[vertex]
|
||||||
@ -201,6 +197,10 @@ class Kitchen:
|
|||||||
)
|
)
|
||||||
self._cookable.put_nowait(vertex)
|
self._cookable.put_nowait(vertex)
|
||||||
|
|
||||||
|
async def cook_all(self):
|
||||||
|
num_workers = 8
|
||||||
|
self._sleeper_slots = num_workers - 1
|
||||||
|
|
||||||
workers = []
|
workers = []
|
||||||
workers_routines = []
|
workers_routines = []
|
||||||
for _ in range(num_workers):
|
for _ in range(num_workers):
|
||||||
|
Loading…
Reference in New Issue
Block a user