diff --git a/src/hosted/NodeAllocator.cc b/src/hosted/NodeAllocator.cc index e951452f..d7c65cd6 100644 --- a/src/hosted/NodeAllocator.cc +++ b/src/hosted/NodeAllocator.cc @@ -75,13 +75,13 @@ std::string ebbrt::NodeAllocator::RunCmd(std::string cmd) { ebbrt::NodeAllocator::DockerContainer::~DockerContainer() { if (!cid_.empty()) { std::cerr << "removing container: " << cid_.substr(0, 12) << std::endl; - RunCmd("docker stop " + cid_); - RunCmd("docker rm -f " + cid_); + RunCmd(base_+" stop " + cid_); + RunCmd(base_+" rm -f " + cid_); } } std::string ebbrt::NodeAllocator::DockerContainer::GetIp() { - auto cip = RunCmd("docker inspect -f '{{range " + auto cip = RunCmd(base_+" inspect -f '{{range " ".NetworkSettings.Networks}}{{.IPAddress}}{{end}}' " + cid_ ); assert(cip != ""); @@ -100,13 +100,13 @@ std::string ebbrt::NodeAllocator::DockerContainer::Start() { std::cerr << "| host:" << host_ << std::endl; } std::cerr << "| cid: " << cid_.substr(0, 12) << std::endl; - std::cerr << "| log: docker logs " << cid_.substr(0, 12) << std::endl; + std::cerr << "| log: " << base_ << " logs " << cid_.substr(0, 12) << std::endl; return cid_; } std::string ebbrt::NodeAllocator::DockerContainer::StdOut() { ebbrt::kbugon(cid_.empty()); - return RunCmd("docker logs " + cid_); + return RunCmd(base_+" logs " + cid_); } ebbrt::NodeAllocator::Session::Session(bai::tcp::socket socket, @@ -307,7 +307,6 @@ ebbrt::NodeAllocator::AllocateNode(std::string binary_path, RunCmd("scp -q -o UserKnownHostsFile=/dev/null -o " "StrictHostKeyChecking=no " + binary_path + " root@" + cip + ":/root/img.elf"); - /* kick start vm */ RunCmd("ssh -q -o UserKnownHostsFile=/dev/null -o " "StrictHostKeyChecking=no root@"+cip+" 'touch /tmp/signal'"); diff --git a/src/hosted/PoolAllocator.cc b/src/hosted/PoolAllocator.cc index 9ebaa79f..86022bd6 100644 --- a/src/hosted/PoolAllocator.cc +++ b/src/hosted/PoolAllocator.cc @@ -46,6 +46,7 @@ void ebbrt::PoolAllocator::AllocateNode(int i) { std::string node = (specified_nodes) ? nodes_[i % nodes_.size()] : std::string(); + args.constraint_node = node; auto nd = ebbrt::node_allocator->AllocateNode(binary_path_, args); nd.NetworkId().Then(