-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_app.py
More file actions
71 lines (48 loc) · 1.77 KB
/
run_app.py
File metadata and controls
71 lines (48 loc) · 1.77 KB
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
70
71
#This script clones charm and builds charm with different options
# clone charm
from charm_header import *
#os.system("git clone charmgit:charm charm");
# cd into it and build charm with options
#os.chdir("charm");
#print 'basedir is' + str(basedirs[key])
# Now change the directory
#os.chdir(basedirs[key]);
print ("key is " + str(key))
os.chdir(appdirs[key])
suffix="prod"
simType="simple"
print ("app dir is" + str(appdirs[key]))
print ('basebuild is' + str(basebuilds[key]))
for basebuild in basebuilds[key]:
for archopt_str in archopts_str:
archStr = str(basedirs[key]) + "/" + basebuild + archmap[key]
mode = "nonsmp"
if(archopt_str != ""):
archStr += "-" + archopt_str
mode = "smp"
archStr += "-" + suffix
charmHome = archStr
buildStr = "make clean test CHARM_HOME=" + charmHome
print (buildStr)
os.system(buildStr)
outputDir = appdirs[key] + "/output/"
print (outputDir)
os.chdir(outputDir)
dirs = [d for d in os.listdir('.') if os.path.isdir(d)]
print ("dirs is " + str(dirs))
latest = sorted(dirs, key=lambda x: os.path.getctime(x), reverse=True)[0]
#l_subdirs = [d for d in os.listdir(outputDir) if os.path.isdir(d)]
#latest_subdir = max(all_subdirs, key=os.path.getmtime)
outputFinal = outputDir + latest
tarFile = key + "_" + basebuild + "_" + mode+ ".tar.gz"
tarCommand = "tar -czvf " + tarFile + " " + latest
#print archStr
print (latest)
print (tarCommand)
os.system(tarCommand)
os.chdir(appdirs[key])
currentDir = os.getcwd()
print("Current directory is " + currentDir)
compareCommand = appdirs[key] + "/scripts/evaluateOutput.sh " + outputDir + tarFile + " " + simType + " " + str(appdirs[key])
print (compareCommand)
os.system(compareCommand)