Skip to content

Commit

Permalink
Integrated configuration with changes from spcl#25
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnappo committed Apr 4, 2023
1 parent 3a5af0f commit f0f8809
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 42 deletions.
2 changes: 0 additions & 2 deletions server/executor_manager/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ int main(int argc, char ** argv)

// Read executor manager settings
std::ifstream in_cfg{opts.json_config};
///*
rfaas::executor_manager::Settings settings = rfaas::executor_manager::Settings::deserialize(in_cfg);

rfaas::executor_manager::Manager mgr{settings, opts.skip_rm};
instance = &mgr;
mgr.start();
//*/

spdlog::info("Executor manager is closing down");
std::this_thread::sleep_for(std::chrono::seconds(1));
Expand Down
56 changes: 16 additions & 40 deletions server/executor_manager/executor_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ namespace rfaas::executor_manager {
argv.emplace_back(config.get_executor_path());

additional_args = {
"/opt/bin/executor",
"-a", client_addr.c_str(),
"-p", client_port.c_str(),
"--polling-mgr", "thread",
Expand All @@ -171,46 +172,13 @@ namespace rfaas::executor_manager {
};

} else if(sandbox_type == SandboxType::DOCKER) {
//const char * argv[] = {
// "docker_rdma_sriov", "run",
// "--rm",
// "--net=mynet", "-i", //"-it",
// // FIXME: make configurable
// "--ip=148.187.105.220",
// // FIXME: make configurable
// "--volume", "/users/mcopik/projects/rdma/repo/build_repo2:/opt",
// // FIXME: make configurable
// "rdma-test",
// "/opt/bin/executor",
// "-a", client_addr.c_str(),
// "-p", client_port.c_str(),
// "--polling-mgr", "thread",
// "-r", executor_repetitions.c_str(),
// "-x", executor_recv_buf.c_str(),
// "-s", client_in_size.c_str(),
// "--pin-threads", "true",
// "--fast", client_cores.c_str(),
// "--warmup-iters", executor_warmups.c_str(),
// "--max-inline-data", executor_max_inline.c_str(),
// "--func-size", client_func_size.c_str(),
// "--timeout", client_timeout.c_str(),
// "--mgr-address", conn.addr.c_str(),
// "--mgr-port", mgr_port.c_str(),
// "--mgr-secret", mgr_secret.c_str(),
// "--mgr-buf-addr", mgr_buf_addr.c_str(),
// "--mgr-buf-rkey", mgr_buf_rkey.c_str(),
// nullptr
//};
argv = {
"docker_rdma_sriov", "run",
"--rm",
"--net=mynet", "-i", //"-it",
// FIXME: make configurable
"--ip=148.187.105.250",
// FIXME: make configurable
"--volume", "/users/mcopik/projects/rdma/repo/build_repo2:/opt",
// FIXME: make configurable
"rdma-test",
"docker_rdma_sriov", "run", "--rm", "-i"
};
DockerConfiguration config = std::get<DockerConfiguration>(*exec.sandbox_config);
config.generate_args(argv);

additional_args = {
"/opt/bin/executor",
"-a", client_addr.c_str(),
"-p", client_port.c_str(),
Expand All @@ -229,8 +197,15 @@ namespace rfaas::executor_manager {
"--mgr-secret", mgr_secret.c_str(),
"--mgr-buf-addr", mgr_buf_addr.c_str(),
"--mgr-buf-rkey", mgr_buf_rkey.c_str(),
#ifdef USE_GNI_AUTH
"--authentication-cookie", authentication_cookie.c_str(),
#endif
nullptr
};

} else if(sandbox_type == SandboxType::SINGULARITY) {
// Handle Singularity case
SingularityConfiguration config = std::get<SingularityConfiguration>(*exec.sandbox_config);
}

std::vector<const char*> cstrings_argv;
Expand All @@ -244,7 +219,8 @@ namespace rfaas::executor_manager {
SPDLOG_DEBUG("Executor launch arguments");
for(const char* str : cstrings_argv)
if(str)
SPDLOG_DEBUG(str);
std::cout<<str<<std::endl;
//SPDLOG_DEBUG(str);

int ret = execvp(cstrings_argv.data()[0], const_cast<char**>(&cstrings_argv.data()[0]));
if(ret == -1) {
Expand Down
13 changes: 13 additions & 0 deletions server/executor_manager/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,18 @@ namespace rfaas::executor_manager {
return path / "executor";
}

void DockerConfiguration::generate_args(std::vector<std::string> & args) const {
std::string ip_arg = "--ip=" + ip;
std::string volume_arg = volume + ":/opt";
std::string net_arg = "--net=" + network;
std::string registry_port = std::to_string(this->registry_port);
std::string docker_image = registry_ip + ":" + registry_port + "/" + image;

args.emplace_back(net_arg);
args.emplace_back(ip_arg);
args.emplace_back("--volume");
args.emplace_back(volume_arg);
args.emplace_back(docker_image);
}
}

2 changes: 2 additions & 0 deletions server/executor_manager/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace rfaas::executor_manager {
CEREAL_NVP(registry_ip), CEREAL_NVP(registry_port)
);
}

void generate_args(std::vector<std::string> & args) const;
};

struct SarusConfiguration {
Expand Down

0 comments on commit f0f8809

Please sign in to comment.