From 2fa0a78edb0af404c2db2bc12270ea95c3d645ad Mon Sep 17 00:00:00 2001 From: Dmitry Meyer Date: Tue, 4 Feb 2025 10:36:47 +0000 Subject: [PATCH] Use parsed `user` property --- src/dstack/api/_public/runs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dstack/api/_public/runs.py b/src/dstack/api/_public/runs.py index af54924fb..6097b689d 100644 --- a/src/dstack/api/_public/runs.py +++ b/src/dstack/api/_public/runs.py @@ -326,8 +326,9 @@ def attach( # TODO: get login name from runner in case it's not specified in the run configuration # (i.e. the default image user is used, and it is not root) - container_user = self._run.run_spec.configuration.user - if container_user is None: + if job.job_spec.user is not None and job.job_spec.user.username is not None: + container_user = job.job_spec.user.username + else: container_user = "root" self._ssh_attach = SSHAttach(