Navigation Menu

Skip to content

Commit

Permalink
Use proper session directory for debug_string.txt (ray-project#4960)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmoritz authored and robertnishihara committed Jun 11, 2019
1 parent 6f48992 commit 1e2b649
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/ray/services.py
Expand Up @@ -1194,6 +1194,7 @@ def start_raylet(redis_address,
"--java_worker_command={}".format(java_worker_command),
"--redis_password={}".format(redis_password or ""),
"--temp_dir={}".format(temp_dir),
"--session_dir={}".format(session_dir),
]
process_info = start_ray_process(
command,
Expand Down
3 changes: 3 additions & 0 deletions src/ray/raylet/main.cc
Expand Up @@ -22,6 +22,7 @@ DEFINE_string(python_worker_command, "", "Python worker command.");
DEFINE_string(java_worker_command, "", "Java worker command.");
DEFINE_string(redis_password, "", "The password of redis.");
DEFINE_string(temp_dir, "", "Temporary directory.");
DEFINE_string(session_dir, "", "The path of this ray session directory.");
DEFINE_bool(disable_stats, false, "Whether disable the stats.");
DEFINE_string(stat_address, "127.0.0.1:8888", "The address that we report metrics to.");
DEFINE_bool(enable_stdout_exporter, false,
Expand Down Expand Up @@ -61,6 +62,7 @@ int main(int argc, char *argv[]) {
const std::string java_worker_command = FLAGS_java_worker_command;
const std::string redis_password = FLAGS_redis_password;
const std::string temp_dir = FLAGS_temp_dir;
const std::string session_dir = FLAGS_session_dir;
const bool disable_stats = FLAGS_disable_stats;
const std::string stat_address = FLAGS_stat_address;
const bool enable_stdout_exporter = FLAGS_enable_stdout_exporter;
Expand Down Expand Up @@ -132,6 +134,7 @@ int main(int argc, char *argv[]) {
node_manager_config.max_lineage_size = RayConfig::instance().max_lineage_size();
node_manager_config.store_socket_name = store_socket_name;
node_manager_config.temp_dir = temp_dir;
node_manager_config.session_dir = session_dir;

// Configuration for the object manager.
ray::ObjectManagerConfig object_manager_config;
Expand Down
3 changes: 2 additions & 1 deletion src/ray/raylet/node_manager.cc
Expand Up @@ -2334,7 +2334,8 @@ void NodeManager::ForwardTask(

void NodeManager::DumpDebugState() const {
std::fstream fs;
fs.open(temp_dir_ + "/debug_state.txt", std::fstream::out | std::fstream::trunc);
fs.open(initial_config_.session_dir + "/debug_state.txt",
std::fstream::out | std::fstream::trunc);
fs << DebugString();
fs.close();
}
Expand Down
2 changes: 2 additions & 0 deletions src/ray/raylet/node_manager.h
Expand Up @@ -48,6 +48,8 @@ struct NodeManagerConfig {
std::string store_socket_name;
/// The path to the ray temp dir.
std::string temp_dir;
/// The path of this ray session dir.
std::string session_dir;
};

class NodeManager {
Expand Down

0 comments on commit 1e2b649

Please sign in to comment.