Skip to content

Commit

Permalink
Merge pull request #441 from GATEOverflow/mlperf-inference
Browse files Browse the repository at this point in the history
Fixes for get-platform-details
  • Loading branch information
arjunsuresh authored Oct 30, 2024
2 parents 2a07468 + a5eff8e commit 31f0902
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
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

0 comments on commit 31f0902

Please sign in to comment.