Skip to content

Commit

Permalink
benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: dentiny <[email protected]>
  • Loading branch information
dentiny committed Jan 10, 2025
1 parent c0ab349 commit 010be12
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions src/ray/raylet/worker_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1318,25 +1318,29 @@ void WorkerPool::StartNewWorker(
pop_worker_request->runtime_env_info.serialized_runtime_env();

if (!IsRuntimeEnvEmpty(serialized_runtime_env)) {
// create runtime env.
GetOrCreateRuntimeEnv(
serialized_runtime_env,
pop_worker_request->runtime_env_info.runtime_env_config(),
pop_worker_request->job_id,
[this, start_worker_process_fn, pop_worker_request](
bool successful,
const std::string &serialized_runtime_env_context,
const std::string &setup_error_message) {
if (successful) {
start_worker_process_fn(pop_worker_request, serialized_runtime_env_context);
} else {
process_failed_runtime_env_setup_failed_++;
pop_worker_request->callback(
nullptr,
PopWorkerStatus::RuntimeEnvCreationFailed,
/*runtime_env_setup_error_message*/ setup_error_message);
}
});
// // create runtime env.
// GetOrCreateRuntimeEnv(
// serialized_runtime_env,
// pop_worker_request->runtime_env_info.runtime_env_config(),
// pop_worker_request->job_id,
// [this, start_worker_process_fn, pop_worker_request](
// bool successful,
// const std::string &serialized_runtime_env_context,
// const std::string &setup_error_message) {
// if (successful) {
// start_worker_process_fn(pop_worker_request,
// serialized_runtime_env_context);
// } else {
// process_failed_runtime_env_setup_failed_++;
// pop_worker_request->callback(
// nullptr,
// PopWorkerStatus::RuntimeEnvCreationFailed,
// /*runtime_env_setup_error_message*/ setup_error_message);
// }
// });

// Directly skip task level runtime env setup.
start_worker_process_fn(pop_worker_request, "");
} else {
start_worker_process_fn(pop_worker_request, "");
}
Expand Down Expand Up @@ -1759,6 +1763,11 @@ void WorkerPool::GetOrCreateRuntimeEnv(const std::string &serialized_runtime_env
}

void WorkerPool::DeleteRuntimeEnvIfPossible(const std::string &serialized_runtime_env) {
// Skip runtime env deletion for task.
if (serialized_runtime_env.find("FOO") != std::string::npos) {
return;
}

RAY_LOG(DEBUG) << "DeleteRuntimeEnvIfPossible " << serialized_runtime_env;
if (!IsRuntimeEnvEmpty(serialized_runtime_env)) {
runtime_env_agent_client_->DeleteRuntimeEnvIfPossible(
Expand Down

0 comments on commit 010be12

Please sign in to comment.