1414
1515
1616class DockerRunner (ABC ):
17+ WORKSPACE = "/workspace/PySymGym"
18+ RUNSTRAT_RESULTS = f"{ WORKSPACE } /tools/runstrat/results"
19+ RUNSTRAT_RESOURCES = f"{ WORKSPACE } /tools/runstrat/resources"
20+ COMPSTRAT_STRAT = f"{ WORKSPACE } /tools/compstrat/strat"
21+ COMPSTRAT_RESULTS = f"{ WORKSPACE } /tools/compstrat/results"
22+ COMPSTRAT_RESOURCES = f"{ WORKSPACE } /tools/compstrat/resources"
23+ MAPS_PATH = f"{ WORKSPACE } /maps/DotNet/Maps/Root/bin/Release/net8.0"
24+
25+ TIMEOUT = "120"
26+
1727 def run (self , uid ) -> None :
1828 cmd = self ._docker_cmd (uid ) + self ._tool_cmd ()
1929 subprocess .run (cmd , check = True )
@@ -40,10 +50,9 @@ class RunstratBaseline(DockerRunner):
4050 def _volumes (self , uid ) -> list [str ]:
4151 return [
4252 "-v" ,
43- f"{ get_thread_filepath (uid , RESULTS_DIR )} :/workspace/PySymGym/tools/runstrat/results " ,
53+ f"{ get_thread_filepath (uid , RESULTS_DIR )} :{ self . RUNSTRAT_RESULTS } " ,
4454 "-v" ,
45- f"{ get_thread_filepath (uid , LAUNCH_INFO_FILE )} "
46- f":/workspace/PySymGym/tools/runstrat/resources/launch_info.csv" ,
55+ f"{ get_thread_filepath (uid , LAUNCH_INFO_FILE )} :{ self .RUNSTRAT_RESOURCES } /launch_info.csv" ,
4756 ]
4857
4958 def _tool_cmd (self ) -> list [str ]:
@@ -52,28 +61,26 @@ def _tool_cmd(self) -> list[str]:
5261 "-s" ,
5362 "ExecutionTreeContributedCoverage" ,
5463 "-t" ,
55- "120" ,
64+ self . TIMEOUT ,
5665 "-ps" ,
57- "/workspace/PySymGym" ,
66+ self . WORKSPACE ,
5867 "-sd" ,
59- "runstrat/results /artifacts_run_baseline" ,
68+ f" { self . RUNSTRAT_RESULTS } /artifacts_run_baseline" ,
6069 "-as" ,
61- "/workspace/PySymGym/maps/DotNet/Maps/Root/bin/Release/net8.0" ,
62- "runstrat/resources /launch_info.csv" ,
70+ self . MAPS_PATH ,
71+ f" { self . RUNSTRAT_RESOURCES } /launch_info.csv" ,
6372 ]
6473
6574
6675class RunstratAI (DockerRunner ):
6776 def _volumes (self , uid ) -> list [str ]:
6877 return [
6978 "-v" ,
70- f"{ get_thread_filepath (uid , RESULTS_DIR )} :/workspace/PySymGym/tools/runstrat/results " ,
79+ f"{ get_thread_filepath (uid , RESULTS_DIR )} :{ self . RUNSTRAT_RESULTS } " ,
7180 "-v" ,
72- f"{ get_thread_filepath (uid , LAUNCH_INFO_FILE )} "
73- f":/workspace/PySymGym/tools/runstrat/resources/launch_info.csv" ,
81+ f"{ get_thread_filepath (uid , LAUNCH_INFO_FILE )} :{ self .RUNSTRAT_RESOURCES } /launch_info.csv" ,
7482 "-v" ,
75- f"{ get_thread_filepath (uid , MODEL_ONNX_FILE )} "
76- f":/workspace/PySymGym/tools/runstrat/resources/model.onnx" ,
83+ f"{ get_thread_filepath (uid , MODEL_ONNX_FILE )} :{ self .RUNSTRAT_RESOURCES } /model.onnx" ,
7784 ]
7885
7986 def _tool_cmd (self ) -> list [str ]:
@@ -82,31 +89,28 @@ def _tool_cmd(self) -> list[str]:
8289 "-s" ,
8390 "AI" ,
8491 "-mp" ,
85- "/workspace/PySymGym/tools/runstrat/resources /model.onnx" ,
92+ f" { self . RUNSTRAT_RESOURCES } /model.onnx" ,
8693 "-t" ,
87- "120" ,
94+ self . TIMEOUT ,
8895 "-ps" ,
89- "/workspace/PySymGym" ,
96+ self . WORKSPACE ,
9097 "-sd" ,
91- "runstrat/results /artifacts_run_ai" ,
98+ f" { self . RUNSTRAT_RESULTS } /artifacts_run_ai" ,
9299 "-as" ,
93- "/workspace/PySymGym/maps/DotNet/Maps/Root/bin/Release/net8.0" ,
94- "runstrat/resources /launch_info.csv" ,
100+ self . MAPS_PATH ,
101+ f" { self . RUNSTRAT_RESOURCES } /launch_info.csv" ,
95102 ]
96103
97104
98105class Compstrat (DockerRunner ):
99106 def _volumes (self , uid ) -> list [str ]:
100107 return [
101108 "-v" ,
102- f"{ get_thread_filepath (uid , ARTIFACTS_AI_CSV_FILE )} "
103- ":/workspace/PySymGym/tools/compstrat/strat/ai_strat" ,
109+ f"{ get_thread_filepath (uid , ARTIFACTS_AI_CSV_FILE )} :{ self .COMPSTRAT_STRAT } /ai_strat" ,
104110 "-v" ,
105- f"{ get_thread_filepath (uid , ARTIFACTS_BASELINE_CSV_FILE )} "
106- ":/workspace/PySymGym/tools/compstrat/strat/baseline_strat" ,
111+ f"{ get_thread_filepath (uid , ARTIFACTS_BASELINE_CSV_FILE )} :{ self .COMPSTRAT_STRAT } /baseline_strat" ,
107112 "-v" ,
108- f"{ get_thread_filepath (uid , COMPSTRAT_RESULTS_DIR )} "
109- ":/workspace/PySymGym/tools/compstrat/results" ,
113+ f"{ get_thread_filepath (uid , COMPSTRAT_RESULTS_DIR )} :{ self .COMPSTRAT_RESULTS } " ,
110114 ]
111115
112116 def _tool_cmd (self ) -> list [str ]:
@@ -115,15 +119,15 @@ def _tool_cmd(self) -> list[str]:
115119 "-s1" ,
116120 "BASELINE" ,
117121 "-r1" ,
118- "/workspace/PySymGym/tools/compstrat/strat /baseline_strat" ,
122+ f" { self . COMPSTRAT_STRAT } /baseline_strat" ,
119123 "-s2" ,
120124 "AI" ,
121125 "-r2" ,
122- "/workspace/PySymGym/tools/compstrat/strat /ai_strat" ,
126+ f" { self . COMPSTRAT_STRAT } /ai_strat" ,
123127 "-cp" ,
124- "/workspace/PySymGym/tools/compstrat/resources /compare_confs.yaml" ,
128+ f" { self . COMPSTRAT_RESOURCES } /compare_confs.yaml" ,
125129 "--savedir" ,
126- "/workspace/PySymGym/tools/compstrat/results" ,
130+ self . COMPSTRAT_RESULTS ,
127131 ]
128132
129133
0 commit comments