add lab6
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Run real, sequential Docker profiles; restore normal settings on exit."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
for workers in (1, 2, 4):
|
||||
env = dict(os.environ, WORKER_CONCURRENCY=str(workers),
|
||||
WORKER_PREFETCH=str(workers), MAX_PENDING_JOBS='32')
|
||||
subprocess.run(['docker', 'compose', 'up', '-d', '--no-deps', '--wait',
|
||||
'worker', 'api-a', 'api-b'], cwd=ROOT, env=env, check=True)
|
||||
for size in (512, 2400):
|
||||
subprocess.run([sys.executable, 'scripts/track1.py',
|
||||
'--run-name', f'real-c{workers}-p{workers}-s{size}',
|
||||
'--workers', str(workers), '--prefetch', str(workers),
|
||||
'--max-pending', '32', '--images', '160',
|
||||
'--concurrency', '16', '--size', str(size),
|
||||
'--require-backpressure'], cwd=ROOT, check=True)
|
||||
finally:
|
||||
subprocess.run(['docker', 'compose', 'up', '-d', '--no-deps', '--wait',
|
||||
'worker', 'api-a', 'api-b'], cwd=ROOT, check=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user