containers WIP
This commit is contained in:
parent
57cb1e3dd7
commit
308e8a0fcf
2 changed files with 5 additions and 4 deletions
|
|
@ -285,14 +285,15 @@ def run_mutual_inductance(ctx, target_hosts, job_file):
|
|||
host_log = lambda log_name: ctx.obj['log_dir'] / f'{case_name}-{log_name}-{case_id}.log'
|
||||
mesh_log = host_log('mesh') # host path
|
||||
sim_log = host_log('sim') # host path
|
||||
mesh_abs = '/var/tmp/mesh'
|
||||
try:
|
||||
args = mesh_args(db, coil_id, 'mutual', mesh_file, str(workdir / 'tmp_pcb.kicad_pcb'), **kwargs)
|
||||
res = subprocess.run(['ssh', host, 'podman', 'run', '-v', './mesh:/mesh:rw', 'nice-coils-runner', *args], check=True, capture_output=True, text=True)
|
||||
res = subprocess.run(['ssh', host, 'podman', 'run', '-v', f'{mesh_abs}:/mesh:rw', 'nice-coils-runner', *args], check=True, capture_output=True, text=True)
|
||||
mesh_log.write_text(res.stdout + res.stderr)
|
||||
|
||||
try:
|
||||
tqdm.tqdm.write(f'Processing {mesh_file} on {host}')
|
||||
res = subprocess.run(['ssh', host, 'podman', 'run', '-v', './mesh:/mesh:rw', 'nice-coils-runner', 'python', '-m', 'coil_parasitics', 'mutual-inductance', '--sim-dir', workdir, mesh_file], check=True, capture_output=True, text=True)
|
||||
res = subprocess.run(['ssh', host, 'podman', 'run', '-v', f'{mesh_abs}:/mesh:rw', 'nice-coils-runner', 'python', '-m', 'coil_parasitics', 'mutual-inductance', '--sim-dir', workdir, mesh_file], check=True, capture_output=True, text=True)
|
||||
sim_log.write_text(res.stdout + res.stderr)
|
||||
|
||||
try:
|
||||
|
|
@ -300,7 +301,7 @@ def run_mutual_inductance(ctx, target_hosts, job_file):
|
|||
'ElmerGrid_stderr.log',
|
||||
'ElmerSolver_stdout.log',
|
||||
'ElmerSolver_stderr.log']:
|
||||
subprocess.run(['scp', f'{host}:mesh/{workdir.name}/{fn}', str(host_log(Path(fn).stem))], check=True, capture_output=True, text=True)
|
||||
subprocess.run(['scp', f'{host}:{mesh_abs}/{workdir.name}/{fn}', str(host_log(Path(fn).stem))], check=True, capture_output=True, text=True)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f'Error copying simulation logs, rc={e.returncode}', file=sys.stderr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue