Skip to content

Commit a5df98e

Browse files
authored
Merge branch 'master' into skip_gpu_reservation
2 parents e2b7b1c + 084506c commit a5df98e

File tree

16 files changed

+350
-79
lines changed

16 files changed

+350
-79
lines changed

cuebot/src/main/java/com/imageworks/spcue/DispatchFrame.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public class DispatchFrame extends FrameEntity implements FrameInterface {
5050
// The Operational System this frame is expected to run in
5151
public String os;
5252

53-
// Memory requirement for this frame in bytes
53+
// Memory requirement for this frame in Kb
5454
private long minMemory;
5555

56-
// Soft limit to be enforced for this frame in bytes
56+
// Soft limit to be enforced for this frame in Kb
5757
public long softMemoryLimit;
5858

59-
// Hard limit to be enforced for this frame in bytes
59+
// Hard limit to be enforced for this frame in Kb
6060
public long hardMemoryLimit;
6161

6262
public void setMinMemory(long minMemory) {

cuebot/src/main/java/com/imageworks/spcue/DispatchHost.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class DispatchHost extends Entity
3030

3131
public String facilityId;
3232
public String allocationId;
33+
public String allocationName;
3334
public LockState lockState;
3435
public HardwareState hardwareState;
3536

cuebot/src/main/java/com/imageworks/spcue/SortableShow.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,25 @@ public class SortableShow implements Comparable<SortableShow> {
2727

2828
private static final Logger logger = LogManager.getLogger(SortableShow.class);
2929

30-
private String show;
30+
private String show_id;
31+
private String show_name;
3132
private float tier;
3233

3334
private Map<String, long[]> failed = new ConcurrentHashMap<String, long[]>();
3435
private Set<AllocationInterface> failedAllocs = new HashSet<AllocationInterface>();
3536

36-
public SortableShow(String show, float value) {
37-
this.show = show;
37+
public SortableShow(String show_id, String show_name, float value) {
38+
this.show_id = show_id;
39+
this.show_name = show_name;
3840
this.tier = value;
3941
}
4042

43+
public String getShowName() {
44+
return show_name;
45+
}
46+
4147
public String getShowId() {
42-
return show;
48+
return show_id;
4349
}
4450

4551
public float getValue() {
@@ -96,7 +102,7 @@ public int compareTo(SortableShow o) {
96102

97103
@Override
98104
public int hashCode() {
99-
return show.hashCode();
105+
return show_id.hashCode();
100106
};
101107

102108
@Override

cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,12 +1244,16 @@ private static final String replaceQueryForFifo(String query) {
12441244
"SELECT " +
12451245
"vs_waiting.pk_show, " +
12461246
"s.float_tier, " +
1247-
"s.int_burst " +
1247+
"s.int_burst, " +
1248+
"show.str_name as str_show_name " +
12481249
"FROM " +
12491250
"subscription s, " +
1250-
"vs_waiting " +
1251+
"vs_waiting, " +
1252+
"show " +
12511253
"WHERE " +
12521254
"vs_waiting.pk_show = s.pk_show " +
1255+
"AND " +
1256+
"s.pk_show = show.pk_show " +
12531257
"AND " +
12541258
"s.pk_alloc = ? " +
12551259
"AND " +

cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatcherDaoJdbc.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public String mapRow(ResultSet rs, int rowNum) throws SQLException {
7272

7373
private static final RowMapper<SortableShow> SHOW_MAPPER = new RowMapper<SortableShow>() {
7474
public SortableShow mapRow(ResultSet rs, int rowNum) throws SQLException {
75-
return new SortableShow(rs.getString("pk_show"), rs.getFloat("float_tier"));
75+
return new SortableShow(rs.getString("pk_show"), rs.getString("str_show_name"),
76+
rs.getFloat("float_tier"));
7677
}
7778
};
7879

@@ -120,11 +121,25 @@ public List<SortableShow> getShows() {
120121
* Choose between different scheduling strategies
121122
*/
122123
private SchedulingMode schedulingMode;
124+
private Set<String> exclusionList;
123125

124126
@Autowired
125127
public DispatcherDaoJdbc(Environment env) {
126128
this.schedulingMode = SchedulingMode.valueOf(
127129
env.getProperty("dispatcher.scheduling_mode", String.class, "PRIORITY_ONLY"));
130+
131+
// Parse the exclusion list from environment variable
132+
// Expected format: "show1:allocation1,show2:allocation2"
133+
String exclusionListStr = env.getProperty("dispatcher.exclusion_list", String.class, "");
134+
this.exclusionList = new LinkedHashSet<String>();
135+
if (!exclusionListStr.isEmpty()) {
136+
for (String item : exclusionListStr.split(",")) {
137+
String trimmedItem = item.trim();
138+
if (!trimmedItem.isEmpty()) {
139+
this.exclusionList.add(trimmedItem);
140+
}
141+
}
142+
}
128143
}
129144

130145
@Override
@@ -178,8 +193,23 @@ private Set<String> findDispatchJobs(DispatchHost host, int numJobs, boolean shu
178193
}
179194

180195
long loopTime = System.currentTimeMillis();
196+
// Filter out shows/allocs that are being dispatched by the new scheduler
197+
// A list of show_name:alloc_name is read from the env to define which jobs
198+
// should not be dispatched by Cuebot's dispatcher
181199
for (SortableShow s : shows) {
182200
long lastTime = System.currentTimeMillis();
201+
202+
// Check if this show:allocation combination is in the exclusion list
203+
if (!exclusionList.isEmpty()) {
204+
String showName = s.getShowName();
205+
String exclusionKey = showName + ":" + host.allocationName;
206+
if (exclusionList.contains(exclusionKey)) {
207+
logger.info("skipping show " + showName + " on allocation "
208+
+ host.allocationName + " due to exclusion list");
209+
continue;
210+
}
211+
}
212+
183213
if (s.isSkipped(host.tags, (long) host.cores, host.memory)) {
184214
logger.info("skipping show " + s.getShowId());
185215
continue;

0 commit comments

Comments
 (0)