Implement the rdc_lib API to support the job stats

Add the function to start and stop the job recording.
Add the function to get the job stats for each GPU and summary of multiple GPUs
Add the function to remove the jobs.

Add a class RdcLogger which can control the log level using the environment variable RDC_LOG.
This is similar to GRPC_VERBOSITY gRPC. When the customer has the issues, he can enable the verbose
log to help us to troubleshoot the issues.

Add the -u support in the rdci group, fieldgroup and dmon for connecting to rdcd without authentication.

Change-Id: I22c591823c1ee6485db106b911bed8271d1b2769
此提交包含在:
Bill(Shuzhou) Liu authored and Chris Freehill committed 2020-08-17 14:07:25 -05:00
1 父節點 16bce67835
當前提交 a547dc7efd
26 file changed
+805 -102

No files matched your search

+10 -2
查看文件
@@ -58,6 +58,7 @@ void RdciDmonSubSystem::parse_cmd_opts(int argc, char ** argv) {
const struct option long_options[] = {
{"host", required_argument, nullptr, HOST_OPTIONS },
{"help", optional_argument, nullptr, 'h' },
{"unauth", optional_argument, nullptr, 'u' },
{"list", optional_argument, nullptr, 'l' },
{"field-group-id", required_argument, nullptr, 'f' },
{"field-id", required_argument, nullptr, 'e' },
@@ -73,7 +74,7 @@ void RdciDmonSubSystem::parse_cmd_opts(int argc, char ** argv) {
std::string gpu_indexes;
std::string field_ids;
while ((opt = getopt_long(argc, argv, "hlf:g:c:d:e:i:",
while ((opt = getopt_long(argc, argv, "hluf:g:c:d:e:i:",
long_options, &option_index)) != -1) {
switch (opt) {
case HOST_OPTIONS:
@@ -82,9 +83,12 @@ void RdciDmonSubSystem::parse_cmd_opts(int argc, char ** argv) {
case 'h':
dmon_ops_ = DMON_HELP;
return;
case 'u':
use_auth_ = false;
break;
case 'l':
dmon_ops_ = DMON_LIST_FIELDS;
return;
break;
case 'f':
if (!IsNumber(optarg)) {
show_help();
@@ -130,6 +134,10 @@ void RdciDmonSubSystem::parse_cmd_opts(int argc, char ** argv) {
}
}
if (dmon_ops_ == DMON_LIST_FIELDS) {
return;
}
if (options_.find(OPTIONS_FIELD_GROUP_ID) == options_.end()) {
if (field_ids == "") {
show_help();
+5 -1
查看文件
@@ -40,6 +40,7 @@ void RdciFieldGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
const struct option long_options[] = {
{"host", required_argument, nullptr, HOST_OPTIONS },
{"help", optional_argument, nullptr, 'h' },
{"unauth", optional_argument, nullptr, 'u' },
{"list", optional_argument, nullptr, 'l' },
{"group", required_argument, nullptr, 'g'},
{"create", required_argument, nullptr, 'c' },
@@ -52,7 +53,7 @@ void RdciFieldGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
int option_index = 0;
int opt = 0;
while ((opt = getopt_long(argc, argv, "hlif:c:g:d:",
while ((opt = getopt_long(argc, argv, "hluif:c:g:d:",
long_options, &option_index)) != -1) {
switch (opt) {
case HOST_OPTIONS:
@@ -61,6 +62,9 @@ void RdciFieldGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
case 'h':
field_group_ops_ = FIELD_GROUP_HELP;
return;
case 'u':
use_auth_ = false;
break;
case 'l':
field_group_ops_ = FIELD_GROUP_LIST;
break;
+5 -1
查看文件
@@ -40,6 +40,7 @@ void RdciGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
const struct option long_options[] = {
{"host", required_argument, nullptr, HOST_OPTIONS },
{"help", optional_argument, nullptr, 'h' },
{"unauth", optional_argument, nullptr, 'u' },
{"list", optional_argument, nullptr, 'l' },
{"group", required_argument, nullptr, 'g'},
{"create", required_argument, nullptr, 'c' },
@@ -52,7 +53,7 @@ void RdciGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
int option_index = 0;
int opt = 0;
while ((opt = getopt_long(argc, argv, "hlic:g:a:d:",
while ((opt = getopt_long(argc, argv, "hluic:g:a:d:",
long_options, &option_index)) != -1) {
switch (opt) {
case HOST_OPTIONS:
@@ -61,6 +62,9 @@ void RdciGroupSubSystem::parse_cmd_opts(int argc, char ** argv) {
case 'h':
group_ops_ = GROUP_HELP;
return;
case 'u':
use_auth_ = false;
break;
case 'l':
group_ops_ = GROUP_LIST;
break;