Skip to content

Commit 7a1aadc

Browse files
committed
headers
Signed-off-by: oliver könig <okoenig@nvidia.com>
1 parent 4a7831b commit 7a1aadc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

nemo_run/core/execution/dgxcloud.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ def status(self, job_id: str) -> Optional[DGXCloudState]:
347347
r_json = response.json()
348348
return DGXCloudState(r_json["phase"])
349349

350-
def _stream_url_sync(self, url: str, q: queue.Queue):
350+
def _stream_url_sync(self, url: str, headers: Dict[str, str], q: queue.Queue):
351351
"""Stream a single URL using requests and put chunks into the queue"""
352352
try:
353-
with requests.get(url, stream=True, verify=False) as response:
353+
with requests.get(url, stream=True, headers=headers, verify=False) as response:
354354
for line in response.iter_lines(decode_unicode=True):
355355
q.put(line)
356356
except Exception as e:
@@ -400,7 +400,12 @@ def fetch_logs(
400400
active_urls = set(urls)
401401

402402
# Start threads
403-
threads = [threading.Thread(target=self._stream_url_sync, args=(url, q)) for url in urls]
403+
threads = [
404+
threading.Thread(
405+
target=self._stream_url_sync, args=(url, self._default_headers(token=token), q)
406+
)
407+
for url in urls
408+
]
404409
for t in threads:
405410
t.start()
406411

0 commit comments

Comments
 (0)