Skip to content
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

Fixes for get-platform-details #441

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-nvidia-mlperf-implementation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: MLPerf Inference Nvidia implementations

on:
schedule:
- cron: "23 20 * * *" #to be adjusted
- cron: "25 21 * * *" #to be adjusted

jobs:
build_nvidia:
Expand Down
23 changes: 18 additions & 5 deletions script/get-generic-sys-util/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#!/bin/bash
# Safe execution of a command stored in a variable
cmd="${CM_SYS_UTIL_INSTALL_CMD}"
echo "$cmd"

cmd=${CM_SYS_UTIL_INSTALL_CMD}
echo $cmd
eval $cmd
test $? -eq 0 || exit $?
# Execute the command and capture the exit status directly
if ! eval "$cmd"; then
echo "Command failed with status $?"
if [[ "${CM_TMP_FAIL_SAFE}" == 'yes' ]]; then
# Exit safely if fail-safe is enabled
echo "Fail-safe is enabled, exiting with status 0"
exit 0
else
# Otherwise exit with the actual error status
exit $?
fi
else
#echo "Command succeeded"
exit 0
fi
5 changes: 4 additions & 1 deletion script/get-platform-details/_cm.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
"linux"
]
},
"tags": "get,sys-util,generic,_linux-tools"
"tags": "get,sys-util,generic,_linux-tools",
"env": {
"CM_TMP_FAIL_SAFE": "yes"
}
}
],
"tags": [
Expand Down
6 changes: 3 additions & 3 deletions script/get-platform-details/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ echo "------------------------------------------------------------" >> $OUTPUT_F

echo "14. cpupower frequency-info" >> $OUTPUT_FILE
eval "cpupower frequency-info" >> $OUTPUT_FILE
test $? -eq 0 || exit $?
test $? -eq 0 || echo "FAILED: cpupower frequency-info" >> $OUTPUT_FILE
echo "------------------------------------------------------------" >> $OUTPUT_FILE

echo "15. sysctl" >> $OUTPUT_FILE
Expand Down Expand Up @@ -120,7 +120,7 @@ echo "------------------------------------------------------------" >> $OUTPUT_F
echo "21. dmidecode" >> $OUTPUT_FILE
if [[ ${CM_SUDO_USER} == "yes" ]]; then
eval "${CM_SUDO} dmidecode" >> $OUTPUT_FILE
test $? -eq 0 || exit $?
test $? -eq 0 || echo "FAILED: dmidecode" >> $OUTPUT_FILE
else
echo "Requires SUDO permission" >> $OUTPUT_FILE
fi
Expand All @@ -129,7 +129,7 @@ echo "------------------------------------------------------------" >> $OUTPUT_F
echo "22. BIOS" >> $OUTPUT_FILE
if [[ ${CM_SUDO_USER} == "yes" ]]; then
eval "${CM_SUDO} dmidecode -t bios" >> $OUTPUT_FILE
test $? -eq 0 || exit $?
test $? -eq 0 || echo "FAILED: dmidecode -t bios" >> $OUTPUT_FILE
else
echo "Requires SUDO permission" >> $OUTPUT_FILE
fi
Expand Down
Loading