-
Notifications
You must be signed in to change notification settings - Fork 2
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
Ubuntu
committed
Sep 8, 2024
1 parent
9793aa7
commit def047d
Showing
2 changed files
with
81 additions
and
12 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
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,66 @@ | ||
import sys, os | ||
from exputils import * | ||
|
||
fjson=sys.argv[1] | ||
RUNID=sys.argv[2] | ||
|
||
# 0: start from the profiling phase | ||
# 1 or any other input: start from the 2nd iteration (profiling folder already exists) | ||
START_ITER=sys.argv[3] | ||
|
||
|
||
def changeConfigFileOnScheduling(policy): | ||
file = open('aws/flink-conf.yaml', 'r') | ||
lines = file.readlines() | ||
file.close() | ||
|
||
file = open('aws/flink-conf.yaml', 'w') | ||
|
||
if policy == "custom": | ||
for line in lines: | ||
if "jobmanager.scheduler: Custom" in line: | ||
file.write("jobmanager.scheduler: Custom\n") | ||
elif "cluster.evenly-spread-out-slots: true" in line: | ||
file.write("#cluster.evenly-spread-out-slots: true\n") | ||
else: | ||
file.write(line) | ||
elif policy == "even": | ||
for line in lines: | ||
if "jobmanager.scheduler: Custom" in line: | ||
file.write("#jobmanager.scheduler: Custom\n") | ||
elif "cluster.evenly-spread-out-slots: true" in line: | ||
file.write("cluster.evenly-spread-out-slots: true\n") | ||
else: | ||
file.write(line) | ||
elif policy == "random": | ||
for line in lines: | ||
if "jobmanager.scheduler: Custom" in line: | ||
file.write("#jobmanager.scheduler: Custom\n") | ||
elif "cluster.evenly-spread-out-slots: true" in line: | ||
file.write("#cluster.evenly-spread-out-slots: true\n") | ||
else: | ||
file.write(line) | ||
else: | ||
file.close() | ||
sys.exit("policy input error") | ||
file.close() | ||
|
||
if START_ITER == '0': | ||
changeConfigFileOnScheduling("custom") | ||
os.system("python3 runds2placement.py "+fjson+" start profile 0 custom") | ||
else: | ||
|
||
changeConfigFileOnScheduling("custom") | ||
RUNID_custom = RUNID + "_custom" | ||
for rx in range(5): | ||
os.system("python3 runds2placement.py "+fjson+" start "+RUNID_custom+str(rx)+" "+START_ITER + " custom") | ||
|
||
changeConfigFileOnScheduling("even") | ||
RUNID_even = RUNID + "_even" | ||
for rx in range(5): | ||
os.system("python3 runds2placement.py "+fjson+" start "+RUNID_even+str(rx)+" "+START_ITER + " even") | ||
|
||
changeConfigFileOnScheduling("random") | ||
RUNID_random = RUNID + "_random" | ||
for rx in range(5): | ||
os.system("python3 runds2placement.py "+fjson+" start "+RUNID_random+str(rx)+" "+START_ITER + " random") |