-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter out malformed nvidia-smi process_name XML tag #1910
base: main
Are you sure you want to change the base?
Filter out malformed nvidia-smi process_name XML tag #1910
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -8,23 +8,48 @@ | |||
from .utils import CWLObjectType | |||
|
|||
|
|||
def cuda_device_count() -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def cuda_device_count() -> str: | |
def cuda_device_count() -> int: |
and update the return
as well
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.