mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
resolves #69: job scripts as symlinks
Fixes some regressions introduced by the recent refactor
This commit is contained in:
parent
7cee824cee
commit
77b8c8d601
@ -142,7 +142,7 @@ std::list<std::string> Laminar::listKnownJobs() {
|
|||||||
std::list<std::string> res;
|
std::list<std::string> res;
|
||||||
KJ_IF_MAYBE(dir, fsHome->tryOpenSubdir(kj::Path{"cfg","jobs"})) {
|
KJ_IF_MAYBE(dir, fsHome->tryOpenSubdir(kj::Path{"cfg","jobs"})) {
|
||||||
for(kj::Directory::Entry& entry : (*dir)->listEntries()) {
|
for(kj::Directory::Entry& entry : (*dir)->listEntries()) {
|
||||||
if(entry.type == kj::FsNode::Type::FILE && entry.name.endsWith(".run")) {
|
if(entry.name.endsWith(".run")) {
|
||||||
res.emplace_back(entry.name.cStr(), entry.name.findLast('.').orDefault(0));
|
res.emplace_back(entry.name.cStr(), entry.name.findLast('.').orDefault(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ bool Laminar::loadConfiguration() {
|
|||||||
|
|
||||||
KJ_IF_MAYBE(nodeDir, fsHome->tryOpenSubdir(kj::Path{"cfg","nodes"})) {
|
KJ_IF_MAYBE(nodeDir, fsHome->tryOpenSubdir(kj::Path{"cfg","nodes"})) {
|
||||||
for(kj::Directory::Entry& entry : (*nodeDir)->listEntries()) {
|
for(kj::Directory::Entry& entry : (*nodeDir)->listEntries()) {
|
||||||
if(entry.type != kj::FsNode::Type::FILE || !entry.name.endsWith(".conf"))
|
if(!entry.name.endsWith(".conf"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
StringMap conf = parseConfFile((homePath/"cfg"/"nodes"/entry.name).toString(true).cStr());
|
StringMap conf = parseConfFile((homePath/"cfg"/"nodes"/entry.name).toString(true).cStr());
|
||||||
@ -505,15 +505,15 @@ bool Laminar::loadConfiguration() {
|
|||||||
node->name = nodeName;
|
node->name = nodeName;
|
||||||
node->numExecutors = conf.get<int>("EXECUTORS", 6);
|
node->numExecutors = conf.get<int>("EXECUTORS", 6);
|
||||||
|
|
||||||
std::string tags = conf.get<std::string>("TAGS");
|
std::string tagString = conf.get<std::string>("TAGS");
|
||||||
if(!tags.empty()) {
|
|
||||||
std::istringstream iss(tags);
|
|
||||||
std::set<std::string> tagList;
|
std::set<std::string> tagList;
|
||||||
|
if(!tagString.empty()) {
|
||||||
|
std::istringstream iss(tagString);
|
||||||
std::string tag;
|
std::string tag;
|
||||||
while(std::getline(iss, tag, ','))
|
while(std::getline(iss, tag, ','))
|
||||||
tagList.insert(tag);
|
tagList.insert(tag);
|
||||||
node->tags = tagList;
|
|
||||||
}
|
}
|
||||||
|
std::swap(node->tags, tagList);
|
||||||
|
|
||||||
knownNodes.insert(nodeName);
|
knownNodes.insert(nodeName);
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ bool Laminar::loadConfiguration() {
|
|||||||
|
|
||||||
KJ_IF_MAYBE(jobsDir, fsHome->tryOpenSubdir(kj::Path{"cfg","jobs"})) {
|
KJ_IF_MAYBE(jobsDir, fsHome->tryOpenSubdir(kj::Path{"cfg","jobs"})) {
|
||||||
for(kj::Directory::Entry& entry : (*jobsDir)->listEntries()) {
|
for(kj::Directory::Entry& entry : (*jobsDir)->listEntries()) {
|
||||||
if(entry.type != kj::FsNode::Type::FILE || !entry.name.endsWith(".conf"))
|
if(!entry.name.endsWith(".conf"))
|
||||||
continue;
|
continue;
|
||||||
StringMap conf = parseConfFile((homePath/"cfg"/"jobs"/entry.name).toString(true).cStr());
|
StringMap conf = parseConfFile((homePath/"cfg"/"jobs"/entry.name).toString(true).cStr());
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ bool Run::step() {
|
|||||||
|
|
||||||
// conf file env vars
|
// conf file env vars
|
||||||
for(kj::Path& file : env) {
|
for(kj::Path& file : env) {
|
||||||
StringMap vars = parseConfFile((rootPath/file).toString().cStr());
|
StringMap vars = parseConfFile((rootPath/file).toString(true).cStr());
|
||||||
for(auto& it : vars) {
|
for(auto& it : vars) {
|
||||||
setenv(it.first.c_str(), it.second.c_str(), true);
|
setenv(it.first.c_str(), it.second.c_str(), true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user