From c0e92ac1ee924f75895b9aec40bb4460b32626db Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 3 Nov 2024 19:11:54 +0000 Subject: [PATCH 1/5] Fix pstree version detection on macos --- script/get-generic-sys-util/customize.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index c429066b6e..8e3598f1ec 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -11,7 +11,8 @@ def preprocess(i): automation = i['automation'] if env['CM_SYS_UTIL_NAME'] == "psmisc" and env.get('CM_HOST_OS_PACKAGE_MANAGER', '') == "brew": - env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-run.out 2>&1 | grep pstree" + env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-run.out 2>&1 | grep pstree:" + env['CM_SYS_UTIL_VERSION_RE'] = r"\\b(\\d+\\.\\d+(?:\\.\\d+)?)\\b" #Use VERSION_CMD and CHECK_CMD if no CHECK_CMD is set if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' and env.get('CM_SYS_UTIL_CHECK_CMD', '') == '': env['CM_SYS_UTIL_CHECK_CMD'] = env['CM_SYS_UTIL_VERSION_CMD'] From bc9e102ee7cbf31b16af33c3c947fd2b4e587ba5 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Mon, 4 Nov 2024 01:11:59 +0530 Subject: [PATCH 2/5] Fix onnx version for nvidia mlperf inference retinanet --- script/app-mlperf-inference-nvidia/_cm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/app-mlperf-inference-nvidia/_cm.yaml b/script/app-mlperf-inference-nvidia/_cm.yaml index a997ef8156..9102732e31 100644 --- a/script/app-mlperf-inference-nvidia/_cm.yaml +++ b/script/app-mlperf-inference-nvidia/_cm.yaml @@ -435,7 +435,7 @@ variations: - tags: get,generic-python-lib,_pycocotools - tags: get,generic-python-lib,_onnx-graphsurgeon - tags: get,generic-python-lib,_package.onnx - version: 1.13.1 + version: 1.14.1 - tags: get,generic-python-lib,_package.sympy sdxl: From fa071a00d2fa1fa1a1846b62a92f22b1c18ba8da Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 3 Nov 2024 19:56:25 +0000 Subject: [PATCH 3/5] Fix pstree version detect on macos --- script/get-generic-sys-util/customize.py | 5 +++-- script/get-generic-sys-util/detect.sh | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index 8e3598f1ec..65c41eaae1 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -13,12 +13,13 @@ def preprocess(i): if env['CM_SYS_UTIL_NAME'] == "psmisc" and env.get('CM_HOST_OS_PACKAGE_MANAGER', '') == "brew": env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-run.out 2>&1 | grep pstree:" env['CM_SYS_UTIL_VERSION_RE'] = r"\\b(\\d+\\.\\d+(?:\\.\\d+)?)\\b" + #Use VERSION_CMD and CHECK_CMD if no CHECK_CMD is set if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' and env.get('CM_SYS_UTIL_CHECK_CMD', '') == '': env['CM_SYS_UTIL_CHECK_CMD'] = env['CM_SYS_UTIL_VERSION_CMD'] if env.get('CM_GENERIC_SYS_UTIL_RUN_MODE', '') == "detect": - if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '': + if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '': r = automation.run_native_script({'run_script_input':i['run_script_input'], 'env':env, 'script_name':'detect'}) if r['return'] != 0: #detection failed, do install via prehook_deps print("detection failed, going for installation") @@ -131,7 +132,7 @@ def postprocess(i): version_env_key = f"CM_{env['CM_SYS_UTIL_NAME'].upper()}_VERSION" - if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" or env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"]: + if (env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '') and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" or env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"]: automation = i['automation'] r = automation.run_native_script({'run_script_input':i['run_script_input'], 'env':env, 'script_name':'detect'}) if r['return'] > 0 and str(env.get('CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in [ "1", "yes", "true" ] and str(env.get('CM_TMP_FAIL_SAFE', '')).lower() not in [ "1", "yes", "true" ]: diff --git a/script/get-generic-sys-util/detect.sh b/script/get-generic-sys-util/detect.sh index 330a10806f..90ef1312ba 100644 --- a/script/get-generic-sys-util/detect.sh +++ b/script/get-generic-sys-util/detect.sh @@ -1,6 +1,8 @@ #!/bin/bash if [[ -n "${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}" ]]; then - eval "${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}" + cmd="${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}" + echo $cmd + eval $cmd test $? -eq 0 || exit $? else if [[ -n "${CM_SYS_UTIL_VERSION_CMD}" ]]; then From 62fe3a6bbfcd7c1d92231d03e99724fa87cb35b7 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 3 Nov 2024 20:04:58 +0000 Subject: [PATCH 4/5] Fix version check for get-generic-sys-util install failures --- script/get-generic-sys-util/customize.py | 4 ++-- script/get-generic-sys-util/run.sh | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index 65c41eaae1..0d15e14d2c 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -11,7 +11,7 @@ def preprocess(i): automation = i['automation'] if env['CM_SYS_UTIL_NAME'] == "psmisc" and env.get('CM_HOST_OS_PACKAGE_MANAGER', '') == "brew": - env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-run.out 2>&1 | grep pstree:" + env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-ver.out 2>&1 | grep pstree:" env['CM_SYS_UTIL_VERSION_RE'] = r"\\b(\\d+\\.\\d+(?:\\.\\d+)?)\\b" #Use VERSION_CMD and CHECK_CMD if no CHECK_CMD is set @@ -132,7 +132,7 @@ def postprocess(i): version_env_key = f"CM_{env['CM_SYS_UTIL_NAME'].upper()}_VERSION" - if (env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '') and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" or env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"]: + if (env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '') and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" or env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"] and env.get('CM_GET_GENERIC_SYS_UTIL_INSTALL_FAILED', '') != 'yes': automation = i['automation'] r = automation.run_native_script({'run_script_input':i['run_script_input'], 'env':env, 'script_name':'detect'}) if r['return'] > 0 and str(env.get('CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in [ "1", "yes", "true" ] and str(env.get('CM_TMP_FAIL_SAFE', '')).lower() not in [ "1", "yes", "true" ]: diff --git a/script/get-generic-sys-util/run.sh b/script/get-generic-sys-util/run.sh index 7e8afaf10a..de14fe9d03 100644 --- a/script/get-generic-sys-util/run.sh +++ b/script/get-generic-sys-util/run.sh @@ -8,6 +8,7 @@ if ! eval "$cmd"; then echo "Command failed with status $?" if [[ "${CM_TMP_FAIL_SAFE}" == 'yes' ]]; then # Exit safely if fail-safe is enabled + echo "CM_GET_GENERIC_SYS_UTIL_INSTALL_FAILED=yes" > tmp-run.out echo "Fail-safe is enabled, exiting with status 0" exit 0 else From 12b70e646c7fdacd7fec035eb5998e141153b3ce Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Sun, 3 Nov 2024 20:26:57 +0000 Subject: [PATCH 5/5] Fix version detection only for install mode --- script/get-generic-sys-util/customize.py | 7 ++++--- script/get-generic-sys-util/detect.sh | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/script/get-generic-sys-util/customize.py b/script/get-generic-sys-util/customize.py index 0d15e14d2c..df852f624d 100644 --- a/script/get-generic-sys-util/customize.py +++ b/script/get-generic-sys-util/customize.py @@ -11,8 +11,9 @@ def preprocess(i): automation = i['automation'] if env['CM_SYS_UTIL_NAME'] == "psmisc" and env.get('CM_HOST_OS_PACKAGE_MANAGER', '') == "brew": - env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-ver.out 2>&1 | grep pstree:" + env['CM_SYS_UTIL_VERSION_CMD_OVERRIDE'] = "brew info pstree > tmp-ver.out 2>&1" env['CM_SYS_UTIL_VERSION_RE'] = r"\\b(\\d+\\.\\d+(?:\\.\\d+)?)\\b" + env['CM_TMP_VERSION_DETECT_GROUP_NUMBER'] = 0 #Use VERSION_CMD and CHECK_CMD if no CHECK_CMD is set if env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' and env.get('CM_SYS_UTIL_CHECK_CMD', '') == '': @@ -132,10 +133,10 @@ def postprocess(i): version_env_key = f"CM_{env['CM_SYS_UTIL_NAME'].upper()}_VERSION" - if (env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '') and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" or env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"] and env.get('CM_GET_GENERIC_SYS_UTIL_INSTALL_FAILED', '') != 'yes': + if (env.get('CM_SYS_UTIL_VERSION_CMD', '') != '' or env.get('CM_SYS_UTIL_VERSION_CMD_OVERRIDE', '') != '') and (env['CM_GENERIC_SYS_UTIL_RUN_MODE'] == "install" and env.get(version_env_key, '') == '') and str(env.get('CM_TMP_GENERIC_SYS_UTIL_PACKAGE_INSTALL_IGNORED', '')).lower() not in ["yes", "1", "true"] and env.get('CM_GET_GENERIC_SYS_UTIL_INSTALL_FAILED', '') != 'yes': automation = i['automation'] r = automation.run_native_script({'run_script_input':i['run_script_input'], 'env':env, 'script_name':'detect'}) - if r['return'] > 0 and str(env.get('CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in [ "1", "yes", "true" ] and str(env.get('CM_TMP_FAIL_SAFE', '')).lower() not in [ "1", "yes", "true" ]: + if r['return'] > 0 and str(env.get('CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE', '')).lower() not in [ "1", "yes", "true" ]: return {'return': 1, 'error': 'Version detection failed after installation. Please check the provided version command or use env.CM_GENERIC_SYS_UTIL_IGNORE_VERSION_DETECTION_FAILURE=yes to ignore the error.'} r = detect_version(i) diff --git a/script/get-generic-sys-util/detect.sh b/script/get-generic-sys-util/detect.sh index 90ef1312ba..2c35837992 100644 --- a/script/get-generic-sys-util/detect.sh +++ b/script/get-generic-sys-util/detect.sh @@ -1,4 +1,5 @@ #!/bin/bash + if [[ -n "${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}" ]]; then cmd="${CM_SYS_UTIL_VERSION_CMD_OVERRIDE}" echo $cmd