Revert "[SWDEV-482058] Updated Packaging for offline installs"

Revert submission 1125402

Reason for revert: Packaging a tar archive of 3rd party sources
Reverted Changes:
I8908451c0:[SWDEV-482058] Updated Packaging for offline insta...
I764c8bf01:[SWDEV-469278] Lowered PyYAML post install script ...

Change-Id: Ib32fa5b9351b1cfc2a8d453e744c0d00209359eb


[ROCm/amdsmi commit: 9924574cbe]
Этот коммит содержится в:
Dmitrii Galantsev
2024-09-20 14:17:20 -04:00
коммит произвёл Maisam Arif
родитель aee9386a04
Коммит 4fbcdc5862
8 изменённых файлов: 62 добавлений и 57 удалений
-2
Просмотреть файл
@@ -287,8 +287,6 @@ GPU: 1
### Resolved issues
- **Improved Offline install process & lowered dependency for PyYAML**.
- **Fixed CPX not showing total number of logical GPUs**.
- Updates were made to `amdsmi_init()` and `amdsmi_get_gpu_bdf_id(..)`. In order to display all logical devices, we needed a way to provide order to GPU's enumerated. This was done
by adding a partition_id within the BDF optional pci_id bits.
+27 -18
Просмотреть файл
@@ -159,24 +159,6 @@ do_install_amdsmi_python_lib() {
fi
unset pip_version
# Install setuptools wheel (offline install)
echo "Checking for amdsmi_offline.tar.gz..."
offline_packages_tar_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/amdsmi_offline.tar.gz
if [ -z "$offline_packages_tar_path" ]; then
echo "Error: amdsmi_offline.tar.gz not found. Not installing amdsmi offline packages..."
else
echo "Extracting amdsmi_offline.tar.gz..."
offline_packages_target_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/
tar -xzvf $offline_packages_tar_path -C $offline_packages_target_path
offline_packages_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/offline_packages
echo "Installing/Upgrading amdsmi offline packages..."
python3 -m pip install --upgrade --upgrade-strategy only-if-needed --no-index --find-links="$offline_packages_path" setuptools
unset offline_packages_path
unset offline_packages_target_path
fi
unset offline_packages_tar_path
# Check PyYAML dependency, typically should not execute
pyyaml_version=$(pip show pyyaml | grep -Po '(?<=Version: )[0-9]')
if [[ "$pyyaml_version" -lt 3 ]]; then
@@ -185,6 +167,33 @@ do_install_amdsmi_python_lib() {
fi
unset pyyaml_version
# Install setuptools wheel (offline install)
# Function to find the tarball
find_tarball() {
find / -name "amdsmi_offline.tar.gz" 2>/dev/null | head -n 1
}
# Locate the tarball
tarball_path=$(find_tarball)
if [ -z "$tarball_path" ]; then
echo "Error: amdsmi_offline.tar.gz not found."
exit 1
fi
# Extract directory from tarball path
base_dir=$(dirname "$tarball_path")
# Navigate to the directory containing the tarball
cd "$base_dir" || exit
# Unpack the tarball
tar -xzvf amdsmi_offline.tar.gz
# Install setuptools offline (if needed)
cd offline_packages || exit
python3 -m pip install --upgrade --upgrade-strategy only-if-needed --no-index --find-links=. setuptools
# install python library at @CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi
local python_lib_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@
python3 -m pip install "$python_lib_path" --quiet --disable-pip-version-check --no-build-isolation
+1 -5
Просмотреть файл
@@ -13,13 +13,9 @@ rm_ldconfig() {
rm_leftovers() {
# remove pyc files generated by python
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/__pycache__"
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi/__pycache__"
# remove CLI folder packages folder
if test -e "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli*"; then
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli*"
fi
# remove build and egg files
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi.egg-info"
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/build"
+28 -19
Просмотреть файл
@@ -158,25 +158,7 @@ do_install_amdsmi_python_lib() {
fi
unset pip_version
# Install setuptools wheel (offline install)
echo "Checking for amdsmi_offline.tar.gz..."
offline_packages_tar_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/amdsmi_offline.tar.gz
if [ -z "$offline_packages_tar_path" ]; then
echo "Error: amdsmi_offline.tar.gz not found. Not installing amdsmi offline packages..."
else
echo "Extracting amdsmi_offline.tar.gz..."
offline_packages_target_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/
tar -xzvf $offline_packages_tar_path -C $offline_packages_target_path
offline_packages_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/offline_packages
echo "Installing/Upgrading amdsmi offline packages..."
python3 -m pip install --upgrade --upgrade-strategy only-if-needed --no-index --find-links="$offline_packages_path" setuptools
unset offline_packages_path
unset offline_packages_target_path
fi
unset offline_packages_tar_path
# Check PyYAML dependency, typically should not execute
# Check PyYAML dependency
local pyyaml_version
pyyaml_version=$(pip show pyyaml | grep -Po '(?<=Version: )[0-9]')
if [[ "$pyyaml_version" -lt 3 ]]; then
@@ -185,6 +167,33 @@ do_install_amdsmi_python_lib() {
fi
unset pyyaml_version
# Install setuptools wheel (offline install)
# Function to find the tarball
find_tarball() {
find / -name "amdsmi_offline.tar.gz" 2>/dev/null | head -n 1
}
# Locate the tarball
tarball_path=$(find_tarball)
if [ -z "$tarball_path" ]; then
echo "Error: amdsmi_offline.tar.gz not found."
exit 1
fi
# Extract directory from tarball path
base_dir=$(dirname "$tarball_path")
# Navigate to the directory containing the tarball
cd "$base_dir" || exit
# Unpack the tarball
tar -xzvf amdsmi_offline.tar.gz
# Install setuptools offline (if needed)
cd offline_packages || exit
python3 -m pip install --upgrade --upgrade-strategy only-if-needed --no-index --find-links=. setuptools
# install python library at @CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi
local python_lib_path=@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@
python3 -m pip install "$python_lib_path" --quiet --disable-pip-version-check --no-build-isolation
+1 -5
Просмотреть файл
@@ -2,13 +2,9 @@
rm_leftovers() {
# remove pyc files generated by python
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/__pycache__"
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi/__pycache__"
# remove CLI folder packages folder
if test -e "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli*"; then
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli*"
fi
# remove build and egg files
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/amdsmi.egg-info"
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@SHARE_INSTALL_PREFIX@/build"
-3
Просмотреть файл
@@ -24,7 +24,6 @@ add_custom_command(
${PY_PACKAGE_DIR}/amdsmi_cli_exceptions.py
${PY_PACKAGE_DIR}/rocm_version.py
${PY_PACKAGE_DIR}/BDF.py
${PY_PACKAGE_DIR}/amdsmi_offline.tar.gz
${PY_PACKAGE_DIR}/README.md
${PY_PACKAGE_DIR}/Release_Notes.md
DEPENDS amdsmi_cli
@@ -39,7 +38,6 @@ add_custom_command(
COMMAND ln -Pf ${CMAKE_CURRENT_SOURCE_DIR}/amdsmi_cli_exceptions.py ${PY_PACKAGE_DIR}/
COMMAND ln -Pf ${CMAKE_CURRENT_SOURCE_DIR}/rocm_version.py ${PY_PACKAGE_DIR}/
COMMAND ln -Pf ${CMAKE_CURRENT_SOURCE_DIR}/BDF.py ${PY_PACKAGE_DIR}/
COMMAND ln -Pf ${CMAKE_CURRENT_SOURCE_DIR}/amdsmi_offline.tar.gz ${PY_PACKAGE_DIR}/
COMMAND ln -Pf ${CMAKE_CURRENT_SOURCE_DIR}/README.md ${PY_PACKAGE_DIR}/
COMMAND ln -Pf ${CMAKE_CURRENT_SOURCE_DIR}/Release_Notes.md ${PY_PACKAGE_DIR}/)
@@ -58,7 +56,6 @@ add_custom_target(
${PY_PACKAGE_DIR}/amdsmi_cli_exceptions.py
${PY_PACKAGE_DIR}/rocm_version.py
${PY_PACKAGE_DIR}/BDF.py
${PY_PACKAGE_DIR}/amdsmi_offline.tar.gz
${PY_PACKAGE_DIR}/README.md
${PY_PACKAGE_DIR}/Release_Notes.md)
+5 -5
Просмотреть файл
@@ -37,7 +37,7 @@ import amdsmi_cli_exceptions
class CustomDumper(yaml.Dumper):
def represent_dict_preserve_order(self, data):
return self.represent_dict(data.items())
def has_sort_keys_option(): # to check if sort_keys is available
def has_sort_keys_option(): # to check if sort_keys is available
return 'sort_keys' in inspect.signature(yaml.dump).parameters
class AMDSMILogger():
@@ -212,14 +212,14 @@ class AMDSMILogger():
json_string = json.dumps(capitalized_json, indent=4)
if has_sort_keys_option():
if has_sort_keys_option():
yaml_data = yaml.safe_load(json_string)
yaml_output = yaml.dump(yaml_data, sort_keys=False, allow_unicode=True)
else:
yaml_output = yaml.dump(yaml_data, sort_keys=False, allow_unicode=True)
else:
CustomDumper.add_representer(dict, CustomDumper.represent_dict_preserve_order)
yaml_data = yaml.safe_load(json_string)
yaml_output = yaml.dump(yaml_data, Dumper=CustomDumper, allow_unicode=True, default_flow_style=False)
# Remove a key line if it is a spacer
yaml_output = yaml_output.replace("AMDSMI_SPACING_REMOVAL:\n", "")
yaml_output = yaml_output.replace("'", "") # Remove ''
Двоичный файл не отображается.