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
Jobspec emission script #1920
Adds a python script that emits jobspec json based on the common resource mananger CLI args:
Tests are added that validate the jobspec output against the full jobspec schema and the minimal schema that we whiteboarded. As part of these tests, I tweaked the
I have not added tests for the minimal json schema. As low hanging fruit, it would be good to feed some of the more complex jobspecs through and ensure they fail validation. Potentially more useful would be to hand construct some simple jobspecs that still fail.
This is a useful and illustrative tool @SteVwonder! Thanks!
This reminded me of a question I had about python's
This isn't important for a test program, because
Ouch! Great catch! I didn't realize
EDIT: black formatting fixes coming shortly
@@ Coverage Diff @@ ## master #1920 +/- ## ========================================== + Coverage 80.08% 80.09% +<.01% ========================================== Files 195 195 Lines 35080 35109 +29 ========================================== + Hits 28094 28120 +26 - Misses 6986 6989 +3
split `validate_input` into `validate_input` and `validate_inputfile` to support validating both files on the filesystem and file-like objects (i.e., stdin) Two minor refactors include: Use `.format` to ensure that the string representations of the objects are formatted and printed properly. Previously was erroring out with: `TypeError: cannot concatenate 'str' and 'exceptions.ValueError' objects`. ensure files are closed by using a context manager
the script emits jobspec based on the common resource mananger CLI args: `-N` (number of nodes), `-n` (number of tasks), `-c` (cores per task), and a command