This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Make executable names configurable #7118
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ using bpo::options_description; | |
using bpo::variables_map; | ||
using public_key_type = fc::crypto::public_key; | ||
using private_key_type = fc::crypto::private_key; | ||
using namespace eosio::launcher::config; | ||
|
||
const string block_dir = "blocks"; | ||
const string shared_mem_dir = "state"; | ||
|
@@ -490,18 +491,18 @@ launcher_def::set_options (bpo::options_description &cfg) { | |
("shape,s",bpo::value<string>(&shape)->default_value("star"),"network topology, use \"star\" \"mesh\" or give a filename for custom") | ||
("p2p-plugin", bpo::value<string>()->default_value("net"),"select a p2p plugin to use (either net or bnet). Defaults to net.") | ||
("genesis,g",bpo::value<string>()->default_value("./genesis.json"),"set the path to genesis.json") | ||
("skip-signature", bpo::bool_switch(&skip_transaction_signatures)->default_value(false), "nodeos does not require transaction signatures.") | ||
("nodeos", bpo::value<string>(&eosd_extra_args), "forward nodeos command line argument(s) to each instance of nodeos, enclose arg(s) in quotes") | ||
("specific-num", bpo::value<vector<uint>>()->composing(), "forward nodeos command line argument(s) (using \"--specific-nodeos\" flag) to this specific instance of nodeos. This parameter can be entered multiple times and requires a paired \"--specific-nodeos\" flag each time it is used") | ||
("specific-nodeos", bpo::value<vector<string>>()->composing(), "forward nodeos command line argument(s) to its paired specific instance of nodeos(using \"--specific-num\"), enclose arg(s) in quotes") | ||
("spcfc-inst-num", bpo::value<vector<uint>>()->composing(), "Specify a specific version installation path (using \"--spcfc-inst-nodeos\" flag) for launching this specific instance of nodeos. This parameter can be entered multiple times and requires a paired \"--spcfc-inst-nodeos\" flag each time it is used") | ||
("spcfc-inst-nodeos", bpo::value<vector<string>>()->composing(), "Provide a specific version installation path to its paired specific instance of nodeos(using \"--spcfc-inst-num\")") | ||
("skip-signature", bpo::bool_switch(&skip_transaction_signatures)->default_value(false), (string(node_executable_name) + " does not require transaction signatures.").c_str()) | ||
(node_executable_name, bpo::value<string>(&eosd_extra_args), ("forward " + string(node_executable_name) + " command line argument(s) to each instance of " + string(node_executable_name) + ", enclose arg(s) in quotes").c_str()) | ||
("specific-num", bpo::value<vector<uint>>()->composing(), ("forward " + string(node_executable_name) + " command line argument(s) (using \"--specific-" + string(node_executable_name) + "\" flag) to this specific instance of " + string(node_executable_name) + ". This parameter can be entered multiple times and requires a paired \"--specific-" + string(node_executable_name) +"\" flag each time it is used").c_str()) | ||
(("specific-" + string(node_executable_name)).c_str(), bpo::value<vector<string>>()->composing(), ("forward " + string(node_executable_name) + " command line argument(s) to its paired specific instance of " + string(node_executable_name) + "(using \"--specific-num\"), enclose arg(s) in quotes").c_str()) | ||
("spcfc-inst-num", bpo::value<vector<uint>>()->composing(), ("Specify a specific version installation path (using \"--spcfc-inst-"+ string(node_executable_name) + "\" flag) for launching this specific instance of " + string(node_executable_name) + ". This parameter can be entered multiple times and requires a paired \"--spcfc-inst-" + string(node_executable_name) + "\" flag each time it is used").c_str()) | ||
(("spcfc-inst-" + string(node_executable_name)).c_str(), bpo::value<vector<string>>()->composing(), ("Provide a specific version installation path to its paired specific instance of " + string(node_executable_name) + "(using \"--spcfc-inst-num\")").c_str()) | ||
("delay,d",bpo::value<int>(&start_delay)->default_value(0),"seconds delay before starting each node after the first") | ||
("boot",bpo::bool_switch(&boot)->default_value(false),"After deploying the nodes and generating a boot script, invoke it.") | ||
("nogen",bpo::bool_switch(&nogen)->default_value(false),"launch nodes without writing new config files") | ||
("host-map",bpo::value<string>(),"a file containing mapping specific nodes to hosts. Used to enhance the custom shape argument") | ||
("servers",bpo::value<string>(),"a file containing ip addresses and names of individual servers to deploy as producers or non-producers ") | ||
("per-host",bpo::value<int>(&per_host)->default_value(0),"specifies how many nodeos instances will run on a single host. Use 0 to indicate all on one.") | ||
("per-host",bpo::value<int>(&per_host)->default_value(0),("specifies how many " + string(node_executable_name) + " instances will run on a single host. Use 0 to indicate all on one.").c_str()) | ||
("network-name",bpo::value<string>(&network.name)->default_value("testnet_"),"network name prefix used in GELF logging source") | ||
("enable-gelf-logging",bpo::value<bool>(&gelf_enabled)->default_value(true),"enable gelf logging appender in logging configuration file") | ||
("gelf-endpoint",bpo::value<string>(&gelf_endpoint)->default_value("10.160.11.21:12201"),"hostname:port or ip:port of GELF endpoint") | ||
|
@@ -578,8 +579,8 @@ launcher_def::initialize (const variables_map &vmap) { | |
server_ident_file = vmap["servers"].as<string>(); | ||
} | ||
|
||
retrieve_paired_array_parameters(vmap, "specific-num", "specific-nodeos", specific_nodeos_args); | ||
retrieve_paired_array_parameters(vmap, "spcfc-inst-num", "spcfc-inst-nodeos", specific_nodeos_installation_paths); | ||
retrieve_paired_array_parameters(vmap, "specific-num", "specific-" + string(node_executable_name), specific_nodeos_args); | ||
retrieve_paired_array_parameters(vmap, "spcfc-inst-num", "spcfc-inst-" + string(node_executable_name), specific_nodeos_installation_paths); | ||
|
||
using namespace std::chrono; | ||
system_clock::time_point now = system_clock::now(); | ||
|
@@ -645,9 +646,9 @@ launcher_def::initialize (const variables_map &vmap) { | |
|
||
if (vmap.count("specific-num")) { | ||
const auto specific_nums = vmap["specific-num"].as<vector<uint>>(); | ||
const auto specific_args = vmap["specific-nodeos"].as<vector<string>>(); | ||
const auto specific_args = vmap["specific-" + string(node_executable_name)].as<vector<string>>(); | ||
if (specific_nums.size() != specific_args.size()) { | ||
cerr << "ERROR: every specific-num argument must be paired with a specific-nodeos argument" << endl; | ||
cerr << "ERROR: every specific-num argument must be paired with a specific-" << node_executable_name << " argument" << endl; | ||
exit (-1); | ||
} | ||
// don't include bios | ||
|
@@ -1538,7 +1539,7 @@ launcher_def::launch (eosd_def &instance, string >s) { | |
bfs::path reerr_sl = dd / "stderr.txt"; | ||
bfs::path reerr_base = bfs::path("stderr." + launch_time + ".txt"); | ||
bfs::path reerr = dd / reerr_base; | ||
bfs::path pidf = dd / "nodeos.pid"; | ||
bfs::path pidf = dd / bfs::path(string(node_executable_name) + ".pid"); | ||
host_def* host; | ||
try { | ||
host = deploy_config_files (*instance.node); | ||
|
@@ -1557,7 +1558,7 @@ launcher_def::launch (eosd_def &instance, string >s) { | |
install_path = specific_nodeos_installation_paths[node_num] + "/"; | ||
} | ||
} | ||
string eosdcmd = install_path + "programs/nodeos/nodeos "; | ||
string eosdcmd = install_path + "programs/nodeos/" + string(node_executable_name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you lost a trailing space here, and it might be why tests are failing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, I applied it. |
||
if (skip_transaction_signatures) { | ||
eosdcmd += "--skip-transaction-signatures "; | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately changing these config names will mean that the python test scripts will not operate when node_executable_name is not 'nodeos'
maybe these two config items should be renamed to something else that doesn't include "nodeos"? (to avoid having to preprocess all the various python scripts with whatever is configured)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the scripts you mentioned, and I guess there can be another cases which contain hard-coded these options. I don't like this way much, but what about adding new option like
-node-exec
, but also leaving-nodeos
for backward compatibility?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
come to think of it, those scripts won't work before your change anyways because of hardcoded "nodeos", "keosd", etc in the scripts too. Would be nice to take care of that in the future, but I think PR is ready as-is