Skip to content

Commit 1fdf2f6

Browse files
mc-nvnv-braf
andauthored
Ensure temp log file is created (#727) (#728)
Co-authored-by: Brian Raf <[email protected]>
1 parent 874a62a commit 1fdf2f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

model_analyzer/triton/server/server_docker.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
from model_analyzer.constants import LOGGER_NAME
1616
import docker
1717
import logging
18+
import tempfile
19+
from io import TextIOWrapper
1820
from multiprocessing.pool import ThreadPool
21+
from subprocess import DEVNULL
1922

2023
from .server import TritonServer
2124
from model_analyzer.model_analyzer_exceptions \
@@ -65,6 +68,7 @@ def __init__(self, image, config, gpus, log_path, mounts, labels, shm_size,
6568
self._tritonserver_image = image
6669
self._tritonserver_container = None
6770
self._log_path = log_path
71+
self._log_file = DEVNULL
6872
self._mounts = mounts
6973
self._labels = labels if labels else {}
7074
self._gpus = gpus
@@ -168,6 +172,8 @@ def start(self, env=None):
168172
self._log_pool.apply_async(self._logging_worker)
169173
except OSError as e:
170174
raise TritonModelAnalyzerException(e)
175+
else:
176+
self._log_file = tempfile.NamedTemporaryFile()
171177

172178
def _logging_worker(self):
173179
"""

0 commit comments

Comments
 (0)