when testing on fermicloud814 we discovered a bug in NerscSFApi which hyunwoo helped me fix.
I tried to push it to decisionengine_modules repo but it seems I don't have the permissions.
This is the diff
[timm@snowball decisionengine_modules]$ git diff master
diff --git a/src/decisionengine_modules/NERSC/sources/NerscSFApi.py b/src/decisionengine_modules/NERSC/sources/NerscSFApi.py
index 5d38532..a084b3a 100644
--- a/src/decisionengine_modules/NERSC/sources/NerscSFApi.py
+++ b/src/decisionengine_modules/NERSC/sources/NerscSFApi.py
@@ -6,7 +6,7 @@ Get allocation info from Nersc SuperFacilityAPI
"""
import json
def check_accesstoken(self, nersc_user):
@@ -62,14 +62,14 @@ class NerscSFApi(Source.Source):
except KeyError:
self.logger.error(f"Unknown user '{nersc_user}', exiting")
return None
print(nersc_user)
rawfile = params_dict["rawfile"]
pemfile = params_dict["private_key"]
clientidfile = params_dict["client_id_file"]
with open(clientidfile) as cifile:
client_id = cifile.read()
client_id = client_id.rstrip()
atoken = None
if not os.path.exists(rawfile):
self.logger.debug(f"{rawfile} does not exist. Need to generate")
else:
@@ -77,28 +77,36 @@ class NerscSFApi(Source.Source):
with open(rawfile) as afile:
atoken = afile.read()
atoken = atoken.rstrip()
when testing on fermicloud814 we discovered a bug in NerscSFApi which hyunwoo helped me fix. I tried to push it to decisionengine_modules repo but it seems I don't have the permissions.
This is the diff
[timm@snowball decisionengine_modules]$ git diff master diff --git a/src/decisionengine_modules/NERSC/sources/NerscSFApi.py b/src/decisionengine_modules/NERSC/sources/NerscSFApi.py index 5d38532..a084b3a 100644 --- a/src/decisionengine_modules/NERSC/sources/NerscSFApi.py +++ b/src/decisionengine_modules/NERSC/sources/NerscSFApi.py @@ -6,7 +6,7 @@ Get allocation info from Nersc SuperFacilityAPI """ import json
-# import time +import time import os
import jwt @@ -36,7 +36,7 @@ class NerscSFApi(Source.Source): self.logger = self.logger.bind( class_module=name.split(".")[-1], )
self.localmap = {"uscms": "m2612", "fife": "m4599", "dunepro": "m3249" } self.keys_list = ["hours_given", "hours_used", "id", "project_hours_given", "project_hours_used", "repo_name"]
def check_accesstoken(self, nersc_user): @@ -62,14 +62,14 @@ class NerscSFApi(Source.Source): except KeyError: self.logger.error(f"Unknown user '{nersc_user}', exiting") return None