Skip to content

Commit

Permalink
Add torchx session id as Environment variable (#974)
Browse files Browse the repository at this point in the history
Summary:

This diff passes the torchx_session_id as an environment variable.

In penv_python, I will fetch this id and log it into logging table.
With the session id, it is possible to join the logging table of penv_python with the logging table of torchx.

Reviewed By: tonykao8080

Differential Revision: D66387522
  • Loading branch information
yikaiMeta authored and facebook-github-bot committed Nov 26, 2024
1 parent 26cb186 commit 4cc21b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchx/runner/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
ENV_TORCHX_TRACKERS,
tracker_config_env_var_name,
)
from torchx.util.session import get_session_id_or_create_new, TORCHX_INTERNAL_SESSION_ID

from torchx.util.types import none_throws
from torchx.workspace.api import PkgInfo, WorkspaceBuilder, WorkspaceMixin
Expand Down Expand Up @@ -390,6 +391,7 @@ def dryrun(
role.env[ENV_TORCHX_JOB_ID] = make_app_handle(
scheduler, self._name, macros.app_id
)
role.env[TORCHX_INTERNAL_SESSION_ID] = get_session_id_or_create_new()

if parent_run_id:
role.env[ENV_TORCHX_PARENT_RUN_ID] = parent_run_id
Expand Down

0 comments on commit 4cc21b0

Please sign in to comment.