Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
flux-jobspec: Add environment to jobspec, support srun --export option #2227
Add support in
I think I got exception handling for
$ src/cmd/flux jobspec srun --export=SOUP hostname util: ERROR: 'SOUP'
Maybe something to look into there regarding generic exception handling in the
Ah, one problem is likely this:
diff --git a/src/bindings/python/flux/util.py b/src/bindings/python/flux/util.py index 9989eded4..081687ffa 100644 --- a/src/bindings/python/flux/util.py +++ b/src/bindings/python/flux/util.py @@ -73,7 +73,7 @@ class CLIMain(object): def __call__(self, main_func): logging.basicConfig( - level=logging.INFO, format="%(module)s: %(levelname)s: %(message)s" + level=logging.INFO, format="%(name)s: %(levelname)s: %(message)s" ) exit_code = 0 try:
I'll add a fix for that here.
Nevermind. I backed out that change. I clearly don't understand how the python logger works. The patch above fixed a contrived case I hit that issued a log message prefixed with
$ ../src/cmd/flux jobspec srun -t foo myApp __main__: ERROR: invalid time limit string format. Acceptable formats include minutes[:seconds], [days-]hours:minutes:seconds
This is fixed by the following obvious change, but I'm not sure if its the python way of doing things:
diff --git a/src/cmd/flux-jobspec.py b/src/cmd/flux-jobspec.py index cfb642e61..979318250 100755 --- a/src/cmd/flux-jobspec.py +++ b/src/cmd/flux-jobspec.py @@ -222,7 +222,7 @@ def get_slurm_common_parser(): return slurm_parser -logger = logging.getLogger(__name__) +logger = logging.getLogger("flux-jobspec") @util.CLIMain(logger)
(Also not sure if I'm off on the wrong track. Since the problem is only contrived for now, I'll just leave it at that)
Add current environment to attributes.system.environment per RFC14 and 24. Support the srun(1) --export option to control which environment variables are exported. Default is all.
Problem: a typo in the jq expression was causing jq to assign to the key instead of testing its value. Fix the test to use `==` instead of `=`.
@@ Coverage Diff @@ ## master #2227 +/- ## ========================================== + Coverage 80.7% 80.72% +0.02% ========================================== Files 202 202 Lines 32295 32295 ========================================== + Hits 26064 26071 +7 + Misses 6231 6224 -7