"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "15dc57d8456ccd320b8d9328f57768c7d3ce23cb"
Unverified Commit c8a176e2 authored by Jakob Görgen's avatar Jakob Görgen
Browse files

symphony/runner/simbricks/runner: attach artifact to db run object once simulation finished

parent 9aa93461
...@@ -56,9 +56,10 @@ async def amain(): ...@@ -56,9 +56,10 @@ async def amain():
print('No valid run, sleeping') print('No valid run, sleeping')
await asyncio.sleep(5) await asyncio.sleep(5)
continue continue
print(f'Preparing run {run_obj["id"]}') run_id = run_obj["id"]
run_workdir = workdir / f'run-{run_obj["id"]}' print(f'Preparing run {run_id}')
run_workdir = workdir / f'run-{run_id}'
run_workdir.mkdir(parents=True) run_workdir.mkdir(parents=True)
inst_obj = await sb_client.get_instantiation(run_obj['instantiation_id']) inst_obj = await sb_client.get_instantiation(run_obj['instantiation_id'])
...@@ -76,14 +77,16 @@ async def amain(): ...@@ -76,14 +77,16 @@ async def amain():
inst.preserve_tmp_folder = False inst.preserve_tmp_folder = False
inst.create_checkpoint = True inst.create_checkpoint = True
print(f'Starting run {run_obj["id"]}') print(f'Starting run {run_id}')
await rc.update_run(run_obj['id'], 'running', '') await rc.update_run(run_id, 'running', '')
out = await run_instantiation(inst) out = await run_instantiation(inst)
if inst.create_artifact:
await sb_client.set_run_artifact(run_id, inst.artifact_name)
print(f'Finished run {run_obj["id"]}') print(f'Finished run {run_id}')
await rc.update_run(run_obj['id'], 'completed', json.dumps(out)) await rc.update_run(run_id, 'completed', json.dumps(out))
def main(): def main():
asyncio.run(amain()) asyncio.run(amain())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment