35 #define AUTO_PLACEHOLDER "__auto__" 37 DEFINE_string(grpc_roots,
"/opt/cogrob/credentials/grpc_roots.pem",
38 "gRPC trusted root certificate store path.");
40 DEFINE_string(gcloud_cred,
"/opt/cogrob/credentials/gcloud_credentials.json",
41 "Google Cloud APIs credentials json path.");
44 "Google Cloud Platform project name.");
52 setenv(
"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH", FLAGS_grpc_roots.c_str(), 0);
53 setenv(
"GOOGLE_APPLICATION_CREDENTIALS", FLAGS_gcloud_cred.c_str(), 0);
57 std::string result = FLAGS_agent;
59 const int BUF_LEN = 1024;
60 char hostname[BUF_LEN];
61 hostname[BUF_LEN - 1] =
'\0';
62 gethostname(hostname, BUF_LEN - 1);
69 std::string result = FLAGS_gcloud_project;
72 if (agent_name.find(
"fetch") == 0 || agent_name.find(
"freight") == 0 ||
73 agent_name.find(
"hsr") == 0) {
74 result =
"cogrob-prod";
76 result =
"cogrob-devel";
std::string GetAgentName()
std::string GetGcloudProjectName()
DEFINE_string(grpc_roots,"/opt/cogrob/credentials/grpc_roots.pem","gRPC trusted root certificate store path.")
void PrepareGoogleCloudCredentials()