mirror of
https://github.com/wassname/ray.git
synced 2026-08-11 11:24:51 +08:00
Use proper session directory for debug_string.txt (#4960)
This commit is contained in:
committed by
Robert Nishihara
parent
6f48992322
commit
1e2b649580
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user