Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plan classes with negative host_summary_regex matching #4069

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions sched/plan_class_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ bool PLAN_CLASS_SPEC::check(
}
return false;
}
if (have_host_summary_regex_negative
&& (regexec(&(host_summary_regex_negative), g_reply->host.serialnum, 0, NULL, 0) == 0)
) {
if (config.debug_version_select) {
log_messages.printf(MSG_NORMAL,
"[version] plan_class_spec: host summary '%s' matched negative regexp\n",
g_reply->host.serialnum
);
}
return false;
}

// OS version
//
Expand Down Expand Up @@ -1074,6 +1085,14 @@ int PLAN_CLASS_SPEC::parse(XML_PARSER& xp) {
have_host_summary_regex = true;
continue;
}
if (xp.parse_str("host_summary_regex_negative", buf, sizeof(buf))) {
if (regcomp(&(host_summary_regex_negative), buf, REG_EXTENDED|REG_NOSUB) ) {
log_messages.printf(MSG_CRITICAL, "BAD HOST SUMMARY REGEXP (negative): %s\n", buf);
return ERR_XML_PARSE;
}
have_host_summary_regex_negative = true;
continue;
}
if (xp.parse_int("user_id", user_id)) continue;
if (xp.parse_double("infeasible_random", infeasible_random)) continue;
if (xp.parse_double("min_os_version", min_os_version)) continue;
Expand Down Expand Up @@ -1189,6 +1208,7 @@ PLAN_CLASS_SPEC::PLAN_CLASS_SPEC() {
min_core_client_version = 0;
max_core_client_version = 0;
have_host_summary_regex = false;
have_host_summary_regex_negative = false;
user_id = 0;
infeasible_random = 0;
min_wu_id=0;
Expand Down
2 changes: 2 additions & 0 deletions sched/plan_class_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ struct PLAN_CLASS_SPEC {
int max_core_client_version;
// for non-compute-intensive, or override for GPU apps
bool have_host_summary_regex;
bool have_host_summary_regex_negative;
regex_t host_summary_regex;
regex_t host_summary_regex_negative;
int user_id;
double infeasible_random;
long min_wu_id;
Expand Down