зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1532236 Improve logging and timeouts in partials generation r=mtabara
Differential Revision: https://phabricator.services.mozilla.com/D21909 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
06f53c0bdb
Коммит
da5338fa4b
|
@ -156,26 +156,28 @@ async def run_command(cmd, cwd='/', env=None, label=None, silent=False):
|
||||||
env = dict()
|
env = dict()
|
||||||
process = await asyncio.create_subprocess_shell(cmd,
|
process = await asyncio.create_subprocess_shell(cmd,
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
stderr=asyncio.subprocess.STDOUT,
|
stderr=asyncio.subprocess.PIPE,
|
||||||
cwd=cwd, env=env)
|
cwd=cwd, env=env)
|
||||||
stdout, stderr = await process.communicate()
|
if label:
|
||||||
|
label = "{}: ".format(label)
|
||||||
|
else:
|
||||||
|
label = ""
|
||||||
|
|
||||||
await process.wait()
|
async def read_output(stream, label, printcmd):
|
||||||
|
while True:
|
||||||
|
line = await stream.readline()
|
||||||
|
if line == b'':
|
||||||
|
break
|
||||||
|
printcmd("%s%s", label, line.decode('utf-8'))
|
||||||
|
|
||||||
if silent:
|
if silent:
|
||||||
return
|
await process.wait()
|
||||||
|
else:
|
||||||
if not stderr:
|
await asyncio.gather(
|
||||||
stderr = ""
|
read_output(process.stdout, label, log.info),
|
||||||
if not stdout:
|
read_output(process.stderr, label, log.warn)
|
||||||
stdout = ""
|
)
|
||||||
|
await process.wait()
|
||||||
label = "{}: ".format(label)
|
|
||||||
|
|
||||||
for line in stdout.splitlines():
|
|
||||||
log.debug("%s%s", label, line.decode('utf-8'))
|
|
||||||
for line in stderr.splitlines():
|
|
||||||
log.warn("%s%s", label, line.decode('utf-8'))
|
|
||||||
|
|
||||||
|
|
||||||
async def unpack(work_env, mar, dest_dir):
|
async def unpack(work_env, mar, dest_dir):
|
||||||
|
|
|
@ -122,7 +122,7 @@ def make_task_description(config, jobs):
|
||||||
'implementation': 'docker-worker',
|
'implementation': 'docker-worker',
|
||||||
'docker-image': {'in-tree': 'funsize-update-generator'},
|
'docker-image': {'in-tree': 'funsize-update-generator'},
|
||||||
'os': 'linux',
|
'os': 'linux',
|
||||||
'max-run-time': 3600,
|
'max-run-time': 600,
|
||||||
'chain-of-trust': True,
|
'chain-of-trust': True,
|
||||||
'taskcluster-proxy': True,
|
'taskcluster-proxy': True,
|
||||||
'env': {
|
'env': {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче