Skip to content

Commit

Permalink
[Jobs] Disable deduplication for logs (#4388)
Browse files Browse the repository at this point in the history
Disable dedup
  • Loading branch information
Michaelvll authored Nov 20, 2024
1 parent 789a9ea commit 50d7bc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 7 additions & 0 deletions sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ def add_prologue(self, job_id: int) -> None:
import time
from typing import Dict, List, Optional, Tuple, Union
# Set the environment variables to avoid deduplicating logs and
# scheduler events. This should be set in driver code, since we are
# not using `ray job submit` anymore, and the environment variables
# from the ray cluster is not inherited.
os.environ['RAY_DEDUP_LOGS'] = '0'
os.environ['RAY_SCHEDULER_EVENTS'] = '0'
import ray
import ray.util as ray_util
Expand Down
9 changes: 0 additions & 9 deletions sky/provision/instance_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,8 @@ def start_ray_on_head_node(cluster_name: str, custom_resource: Optional[str],
for key, value in cluster_info.custom_ray_options.items():
ray_options += f' --{key}={value}'

# Unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY to avoid using credentials
# from environment variables set by user. SkyPilot's ray cluster should use
# the `~/.aws/` credentials, as that is the one used to create the cluster,
# and the autoscaler module started by the `ray start` command should use
# the same credentials. Otherwise, `ray status` will fail to fetch the
# available nodes.
# Reference: https://github.com/skypilot-org/skypilot/issues/2441
cmd = (
f'{constants.SKY_RAY_CMD} stop; '
'unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY; '
'RAY_SCHEDULER_EVENTS=0 RAY_DEDUP_LOGS=0 '
# worker_maximum_startup_concurrency controls the maximum number of
# workers that can be started concurrently. However, it also controls
Expand Down Expand Up @@ -372,7 +364,6 @@ def start_ray_on_worker_nodes(cluster_name: str, no_restart: bool,
# Unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY, see the comment in
# `start_ray_on_head_node`.
cmd = (
f'unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY; '
'RAY_SCHEDULER_EVENTS=0 RAY_DEDUP_LOGS=0 '
f'{constants.SKY_RAY_CMD} start --disable-usage-stats {ray_options} || '
'exit 1;' + _RAY_PRLIMIT)
Expand Down

0 comments on commit 50d7bc0

Please sign in to comment.