Skip to content
1 change: 1 addition & 0 deletions python/ray/dashboard/modules/job/job_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _exec_entrypoint(self, env: dict, logs_path: str) -> subprocess.Popen:
# Open in append mode to avoid overwriting runtime_env setup logs for the
# supervisor actor, which are also written to the same file.
with open(logs_path, "a") as logs_file:
logs_file.write(f"Running entrypoint for job {self._job_id}: {self._entrypoint}\n")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
logs_file.write(f"Running entrypoint for job {self._job_id}: {self._entrypoint}\n")
logs_file.write(f"Running entrypoint for job '{self._job_id}': {self._entrypoint}\n")

child_process = subprocess.Popen(
self._entrypoint,
shell=True,
Expand Down
7 changes: 4 additions & 3 deletions python/ray/dashboard/modules/job/tests/test_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ async def test_runtime_env_setup_logged_to_job_driver_logs(
gcs_client = ray._private.worker.global_worker.gcs_client
job_manager = JobManager(gcs_client, tmp_path)

entrypoint = "echo hello 1"
job_id = await job_manager.submit_job(
entrypoint="echo hello 1", submission_id="test_runtime_env_setup_logs"
entrypoint=entrypoint, submission_id="test_runtime_env_setup_logs"
)
await async_wait_for_condition(
check_job_succeeded, job_manager=job_manager, job_id=job_id
Expand All @@ -347,10 +348,10 @@ async def test_runtime_env_setup_logged_to_job_driver_logs(
ray._private.worker._global_node.get_logs_dir_path(),
f"job-driver-{job_id}.log",
)
start_message = "Runtime env is setting up."
with open(job_driver_log_path, "r") as f:
logs = f.read()
assert start_message in logs
assert "Runtime env is setting up." in logs
assert f"Running entrypoint for job {job_id}: {entrypoint}" in logs


@pytest.mark.asyncio
Expand Down