Filter out malformed nvidia-smi process_name XML tag#1910
Filter out malformed nvidia-smi process_name XML tag#1910jfennick wants to merge 2 commits intocommon-workflow-language:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1910 +/- ##
==========================================
- Coverage 83.98% 82.86% -1.12%
==========================================
Files 46 46
Lines 8190 8200 +10
Branches 2174 2138 -36
==========================================
- Hits 6878 6795 -83
- Misses 840 903 +63
- Partials 472 502 +30
|
67683da to
7945f7d
Compare
7945f7d to
2988ed4
Compare
8c77a20 to
081818d
Compare
|
FYI, as I discuss in the block comment in the code, to fix the immediate problem the only change necessary is But in an attempt to prevent future problems, I have instead removed all tags except the tags that are actually used. Let me know which version you prefer. |
7bb1989 to
ebaeb74
Compare
Head branch was pushed to by a user without write access
db7dc3b to
df408bd
Compare
There was a problem hiding this comment.
2023-10-03T19:27:36.5351674Z cwltool/context.py:46: initilizer ==> initializer
2023-10-03T19:27:36.5352997Z tests/test_toolargparse.py:183: desription ==> description
2023-10-03T19:27:36.5354037Z tests/test_toolargparse.py:192: desription ==> description
2023-10-03T19:27:36.5354867Z tests/wf/schemadef-bug-1473.cwl:452: cylces ==> cycles
2023-10-03T19:27:36.5441419Z Probable typo foun. Run "make codespell-fix" to accept suggested fixes, or add the word to the ignore list in setup.cfg
df408bd to
239ce5a
Compare
| from .utils import CWLObjectType | ||
|
|
||
|
|
||
| def cuda_device_count() -> str: |
There was a problem hiding this comment.
| def cuda_device_count() -> str: | |
| def cuda_device_count() -> int: |
and update the return as well
| cmd = "nvidia-smi -q -x | grep cuda_version" | ||
| try: | ||
| out = subprocess.check_output(["nvidia-smi", "-q", "-x"]) # nosec | ||
| out = subprocess.check_output(cmd, shell=True) # nosec |
There was a problem hiding this comment.
I would prefer that instead of using a subshell it captures the output and does the substring search in Python. For a simple substring search this really is as simple as something like:
out = subprocess.check_output(["nvidia-smi", "-q", "-x"])
if "cuda_version" not in out:
raise ...
There was a problem hiding this comment.
Actually instead of using minidom, to pull a single tag it would be easier to just use a regular expression to look for <cuda_version>.
No description provided.