Skip to content

Commit 648913c

Browse files
authored
Add torchx session id as Environment variable
Differential Revision: D66387522 Pull Request resolved: #974
1 parent 26cb186 commit 648913c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

torchx/runner/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
ENV_TORCHX_TRACKERS,
4040
tracker_config_env_var_name,
4141
)
42+
from torchx.util.session import get_session_id_or_create_new, TORCHX_INTERNAL_SESSION_ID
4243

4344
from torchx.util.types import none_throws
4445
from torchx.workspace.api import PkgInfo, WorkspaceBuilder, WorkspaceMixin
@@ -390,6 +391,7 @@ def dryrun(
390391
role.env[ENV_TORCHX_JOB_ID] = make_app_handle(
391392
scheduler, self._name, macros.app_id
392393
)
394+
role.env[TORCHX_INTERNAL_SESSION_ID] = get_session_id_or_create_new()
393395

394396
if parent_run_id:
395397
role.env[ENV_TORCHX_PARENT_RUN_ID] = parent_run_id

0 commit comments

Comments
 (0)