Source code for pycif.plugins.platforms.docker_cif.jobs
import subprocess
import os
from logging import info
[docs]
def submit_job(self, exe, job_file):
"""Run *exe* as a blocking subprocess (no scheduler; jobs execute inline).
Args:
self (Plugin): platform plugin instance.
exe (str): shell command to execute.
job_file (str): used to set the working directory (``dirname``).
Returns:
str: stdout from the process (typically empty for pyCIF sub-runs).
"""
process = subprocess.Popen(
exe.split(),
cwd=os.path.dirname(job_file),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
stdout, stderr = process.communicate()
info(
"The following stderr was return by the present job: \n"
+ stderr.decode('utf-8').strip()
)
return stdout.decode('utf-8').strip()
[docs]
def check_jobs(self, list_jobs):
"""Always return ``True`` — jobs run synchronously, so they are always done.
Args:
self (Plugin): platform plugin instance.
list_jobs: unused; accepted for interface consistency.
Returns:
bool: always ``True``.
"""
return True