revise nodemanager logging for docker and gpu metrics initialization command

This commit is contained in:
FAREAST\chezhang 2018-05-08 12:03:48 +08:00
Родитель bf9d5bf9ff
Коммит 5d7ec8cfc6
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -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))