-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f58f82e
commit 05bf4f5
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Test all of the docker images. | ||
# | ||
|
||
import argparse | ||
import multiprocessing | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
import image_names | ||
|
||
parser = argparse.ArgumentParser(description = 'Batch testing of PLplot in various linux distros using Docker') | ||
|
||
parser.add_argument('--max_processes', dest='maxp', type=int, required=False, default=2, | ||
help = "The maximum number of processes to run in parallel.") | ||
|
||
args = parser.parse_args() | ||
|
||
|
||
def mp_worker(docker_image): | ||
print("Starting", docker_image) | ||
cmd = ["docker", "run", docker_image] | ||
out = subprocess.check_output(cmd, stderr = subprocess.STDOUT) | ||
with open(docker_image.split("/")[1] + ".txt", "wb") as outfp: | ||
outfp.write(out) | ||
print("Finished", docker_image) | ||
|
||
docker_images = [] | ||
for elt in image_names.names: | ||
docker_images.append(elt[0]) | ||
|
||
pool = multiprocessing.Pool(args.maxp) | ||
pool.map(mp_worker, docker_images) |