forked from dotnet/performance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontainer_benchmarks_ci.py
69 lines (58 loc) · 1.96 KB
/
container_benchmarks_ci.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python3
from os import path
import util
import subprocess
import time
import logging
logging.basicConfig(level=logging.INFO, format="[%(asctime)s][%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M")
logger = logging.getLogger(__name__)
if __name__ == "__main__":
script_dir = path.dirname(path.realpath(__file__))
benchmark_dir = path.normpath(path.join(script_dir, '..', 'src', 'benchmarks', 'other', 'docker'))
benchmark_reports_dir = path.normpath(path.join(benchmark_dir, 'reports'))
logger.info("Installing dotnet cli")
dotnet_exe = util.aquire_dotnet()
logger.info("Running dotnet containers benchmark")
util.cmd([dotnet_exe, 'run'], cwd=benchmark_dir, stdout=None, stderr=None)
logger.info("Generating submission metadata")
util.generate_metadata(
name='Container Size Benchmark',
user_email='[email protected]'
)
logger.info("Generating machine data")
util.generate_machinedata()
logger.info("Generating build data")
timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ')
util.generate_build(
branch='master',
number=timestamp,
timestamp=timestamp,
type='rolling',
repository='https://github.com/dotnet/performance'
)
logger.info("Generating measurement json file")
util.generate_measurement_csv(
datafile=path.join(benchmark_reports_dir, 'benchview.csv'),
metric='size',
unit='bytes',
ascending=False,
)
logger.info("Generating submission json file")
config = util.docker_info(
"ServerVersion",
"OperatingSystem",
"OSType",
"Architecture"
)
util.generate_submission(
group="Containers",
type="rolling",
config_name="docker",
config=config,
arch=config["Architecture"],
machinepool='perfsnake',
)
logger.info("Uploading submission to BenchView")
util.upload(
container="dotnetcli"
)