revise nodemanager logging for docker and gpu metrics initialization command
This commit is contained in:
Родитель
bf9d5bf9ff
Коммит
5d7ec8cfc6
|
@ -25,10 +25,13 @@ Monitor::Monitor(const std::string& nodeName, const std::string& netName, int in
|
|||
std::get<0>(this->metricData[3]) = 0;
|
||||
std::get<0>(this->metricData[12]) = 1;
|
||||
|
||||
Logger::Info("Initializing GPU driver.");
|
||||
Logger::Info("Checking nvidia-smi...");
|
||||
std::string output;
|
||||
this->gpuInitRet = System::ExecuteCommandOut(output, "nvidia-smi -pm 1");
|
||||
Logger::Info("Initialize GPU ret code {0}", this->gpuInitRet);
|
||||
this->gpuInitRet = System::ExecuteCommandOut(output, "nvidia-smi -pm 1 2>/dev/null");
|
||||
if (this->gpuInitRet != 0)
|
||||
{
|
||||
Logger::Warn("GPU metrics will not be collected.");
|
||||
}
|
||||
|
||||
this->collectors["\\Processor\\% Processor Time"] = std::make_shared<MetricCollectorBase>([this] (const std::string& instanceName)
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
. common.sh
|
||||
|
||||
docker version > /dev/nul
|
||||
docker version >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Cleaning up docker containers..."
|
||||
containers=$(docker ps -a -q -f name=^/$(GetContainerName))
|
||||
|
|
Загрузка…
Ссылка в новой задаче