Bug fixing
This commit is contained in:
parent
d6ca2b6d15
commit
8bb25a2c6a
4
PKGBUILD
4
PKGBUILD
@ -1,6 +1,6 @@
|
||||
pkgname=saturn-discover
|
||||
pkgver=1.3
|
||||
pkgrel=4
|
||||
pkgver=1.6
|
||||
pkgrel=7
|
||||
arch=('any')
|
||||
source=('saturnDiscoverDeamon.py' 'saturnDiscover.service' 'saturnDiscover')
|
||||
md5sums=('SKIP' 'SKIP' 'SKIP')
|
||||
|
@ -150,7 +150,7 @@ elif (sys.argv[1] == "lookup"):
|
||||
if (sys.argv[2] == "hostmac"):
|
||||
nodes = loadHosts()
|
||||
|
||||
for node in nodes:
|
||||
for node in nodes.values():
|
||||
if node["ip"] == sys.argv[3] or node["name"] == sys.argv[3]:
|
||||
print(node["mac"])
|
||||
exit(0)
|
||||
|
@ -82,6 +82,10 @@ def loadHosts():
|
||||
if host["type"] == "master":
|
||||
MASTER = host
|
||||
|
||||
def updateVersion(val):
|
||||
with open("/etc/slurm-llnl/confVer", "w") as outfile:
|
||||
outfile.write(str(val))
|
||||
|
||||
def updateHosts():
|
||||
with open("/etc/slurm-llnl/hosts.json", "w") as outfile:
|
||||
json.dump(HOSTS, outfile)
|
||||
@ -89,7 +93,10 @@ def updateHosts():
|
||||
def generateSlurmConfig(source, target):
|
||||
if MASTER is None:
|
||||
return
|
||||
|
||||
selfInfoData = selfInfo()
|
||||
|
||||
# TODO RealMemory={int(selfInfoData["rams"] / (1024.**2))} Gres={",".join(selfInfoData["res"])} Gres={",".join(selfInfoData["res"])}
|
||||
hosts = f"NodeName={socket.gethostname()} NodeAddr={get_ip()} CPUs={os.cpu_count()} State=UNKNOWN\n" # first is my self
|
||||
noMasterHosts = ""
|
||||
for host in HOSTS.values():
|
||||
@ -170,9 +177,13 @@ while True:
|
||||
os.system("mount -a")
|
||||
|
||||
os.system("cp -f /clusterfs/config/munge.key /etc/munge/munge.key")
|
||||
os.system("cat /clusterfs/config/maintenance.pub >> /home/maintenance/.ssh/authorized_keys")
|
||||
|
||||
generateSlurmConfig("/clusterfs/config/slurm.conf.template", "/etc/slurm-llnl/slurm.conf")
|
||||
|
||||
if int(tryReadFile("/etc/slurm-llnl/confVer", 0)) < data["version"]:
|
||||
updateVersion(data["version"])
|
||||
|
||||
# reset all services
|
||||
os.system("systemctl restart munge")
|
||||
os.system("systemctl restart slurmd")
|
||||
|
Loading…
x
Reference in New Issue
Block a user