Skip to content

Commit

Permalink
Revert "Revert "[core] add runtime env info to task spec debug string (
Browse files Browse the repository at this point in the history
…ray-project#20668)" (ray-project#20697)

## Why are these changes needed?
- fix compiling error and revert the revert.
  • Loading branch information
SongGuyang authored Nov 25, 2021
1 parent cd2b83a commit 454b7bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/ray/common/task/task_spec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,23 @@ std::string TaskSpecification::DebugString() const {
<< "}";
}

// Print runtime env.
if (HasRuntimeEnv()) {
const auto &runtime_env_info = RuntimeEnvInfo();
stream << ", serialized_runtime_env=" << SerializedRuntimeEnv();
const auto &uris = runtime_env_info.uris();
if (uris.size() > 0) {
stream << ", runtime_env_uris=";
for (const auto &uri : uris) {
stream << uri << ":";
}
// Erase the last ":"
stream.seekp(-1, std::ios_base::end);
}
stream << ", runtime_env_eager_install="
<< runtime_env_info.runtime_env_eager_install();
}

return stream.str();
}

Expand Down
4 changes: 3 additions & 1 deletion src/ray/core_worker/core_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ std::vector<rpc::ObjectReference> CoreWorker::SubmitTask(
task_options.serialized_runtime_env);
builder.SetNormalTaskSpec(max_retries, retry_exceptions);
TaskSpecification task_spec = builder.Build();
RAY_LOG(DEBUG) << "Submit task " << task_spec.DebugString();
RAY_LOG(DEBUG) << "Submitting normal task " << task_spec.DebugString();
std::vector<rpc::ObjectReference> returned_refs;
if (options_.is_local_mode) {
returned_refs = ExecuteTaskLocalMode(task_spec);
Expand Down Expand Up @@ -1614,6 +1614,7 @@ Status CoreWorker::CreateActor(const RayFunction &function,
<< "Actor " << actor_id << " already exists";
*return_actor_id = actor_id;
TaskSpecification task_spec = builder.Build();
RAY_LOG(DEBUG) << "Submitting actor creation task " << task_spec.DebugString();
if (options_.is_local_mode) {
// TODO(suquark): Should we consider namespace in local mode? Currently
// it looks like two actors with two different namespaces become the
Expand Down Expand Up @@ -1791,6 +1792,7 @@ std::vector<rpc::ObjectReference> CoreWorker::SubmitActorTask(

// Submit task.
TaskSpecification task_spec = builder.Build();
RAY_LOG(DEBUG) << "Submitting actor task " << task_spec.DebugString();
std::vector<rpc::ObjectReference> returned_refs;
if (options_.is_local_mode) {
returned_refs = ExecuteTaskLocalMode(task_spec, actor_id);
Expand Down

0 comments on commit 454b7bd

Please sign in to comment.