Skip to content

Commit

Permalink
skip plugin creation
Browse files Browse the repository at this point in the history
Signed-off-by: dentiny <dentinyhao@gmail.com>
  • Loading branch information
dentiny committed Jan 12, 2025
1 parent 1b8f3b1 commit 5ceece3
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions python/ray/_private/runtime_env/agent/runtime_env_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from ray._private.gcs_utils import GcsAioClient
from ray._private.runtime_env.plugin import (
RuntimeEnvPlugin,
create_for_plugin_if_needed,
# create_for_plugin_if_needed,
)
from ray._private.utils import get_or_create_event_loop
from ray._private.runtime_env.plugin import RuntimeEnvPluginManager
Expand Down Expand Up @@ -305,34 +305,34 @@ async def _setup_runtime_env(
runtime_env: RuntimeEnv,
runtime_env_config: RuntimeEnvConfig,
):
log_files = runtime_env_config.get("log_files", [])
# log_files = runtime_env_config.get("log_files", [])
# Use a separate logger for each job.
per_job_logger = self.get_or_create_logger(request.job_id, log_files)
# per_job_logger = self.get_or_create_logger(request.job_id, log_files)
context = RuntimeEnvContext(env_vars=runtime_env.env_vars())

# First create working dir...
working_dir_ctx = self._plugin_manager.plugins[WorkingDirPlugin.name]
await create_for_plugin_if_needed(
runtime_env,
working_dir_ctx.class_instance,
working_dir_ctx.uri_cache,
context,
per_job_logger,
)
# working_dir_ctx = self._plugin_manager.plugins[WorkingDirPlugin.name]
# await create_for_plugin_if_needed(
# runtime_env,
# working_dir_ctx.class_instance,
# working_dir_ctx.uri_cache,
# context,
# per_job_logger,
# )

# Then within the working dir, create the other plugins.
working_dir_uri_or_none = runtime_env.working_dir_uri()
with self._working_dir_plugin.with_working_dir_env(working_dir_uri_or_none):
"""Run setup for each plugin unless it has already been cached."""
for (
plugin_setup_context
) in self._plugin_manager.sorted_plugin_setup_contexts():
plugin = plugin_setup_context.class_instance
if plugin.name != WorkingDirPlugin.name:
uri_cache = plugin_setup_context.uri_cache
await create_for_plugin_if_needed(
runtime_env, plugin, uri_cache, context, per_job_logger
)
# working_dir_uri_or_none = runtime_env.working_dir_uri()
# with self._working_dir_plugin.with_working_dir_env(
# working_dir_uri_or_none):
# """Run setup for each plugin unless it has already been cached."""
# for plugin_setup_context in
# self._plugin_manager.sorted_plugin_setup_contexts():
# plugin = plugin_setup_context.class_instance
# if plugin.name != WorkingDirPlugin.name:
# uri_cache = plugin_setup_context.uri_cache
# await create_for_plugin_if_needed(
# runtime_env, plugin, uri_cache, context, per_job_logger
# )
return context

async def _create_runtime_env_with_retry(
Expand Down

0 comments on commit 5ceece3

Please sign in to comment.