782dd075ef
Fix ordering of RHEL 8 build process Signed-off-by: Williams, Justin <Justin.Williams@amd.com>
292 satır
12 KiB
YAML
292 satır
12 KiB
YAML
name: Build and Install AMDSMI
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- amd-staging
|
|
push:
|
|
branches:
|
|
- amd-staging
|
|
|
|
jobs:
|
|
build-and-install-deb:
|
|
name: Build on Debian-based Systems
|
|
runs-on:
|
|
- self-hosted
|
|
- ${{ vars.RUNNER_TYPE }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- Ubuntu20
|
|
- Ubuntu22
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
clean: false
|
|
|
|
- name: Set Docker Image for Ubuntu20
|
|
if: matrix.os == 'Ubuntu20'
|
|
run: echo "DOCKER_IMAGE=${{ secrets.UBUNTU20_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
|
|
- name: Set Docker Image for Ubuntu22
|
|
if: matrix.os == 'Ubuntu22'
|
|
run: echo "DOCKER_IMAGE=${{ secrets.UBUNTU22_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
|
|
- name: Build and Install on ${{ matrix.os }}
|
|
run: |
|
|
# Define a host directory for test results
|
|
HOST_TEST_RESULTS_DIR=/tmp/test-results
|
|
# Ensure the host directory exists
|
|
mkdir -p $HOST_TEST_RESULTS_DIR
|
|
docker run --privileged -v ${{ github.workspace }}:/src:rw -v $HOST_TEST_RESULTS_DIR:/shared:rw $DOCKER_IMAGE /bin/bash -c "
|
|
set -e
|
|
cd /src
|
|
echo 'Inside Docker Container on ${{ matrix.os }}'
|
|
|
|
# Build AMD-SMI
|
|
BUILD_FOLDER=/src/build
|
|
DEB_BUILD='amd-smi-lib*99999-local_amd64.deb'
|
|
DEB_BUILD_TEST='amd-smi-lib-tests*99999-local_amd64.deb'
|
|
rm -rf \$BUILD_FOLDER
|
|
mkdir -p \$BUILD_FOLDER
|
|
cd \$BUILD_FOLDER
|
|
cmake .. -DBUILD_TESTS=ON -DENABLE_ESMI_LIB=ON
|
|
make -j \$(nproc)
|
|
make package
|
|
|
|
# Install AMD-SMI
|
|
apt install -y \$BUILD_FOLDER/\$DEB_BUILD
|
|
ln -s /opt/rocm/bin/amd-smi /usr/local/bin
|
|
|
|
# Check If Installed
|
|
echo 'Listing installed packages:'
|
|
python3 -m pip list | grep amd
|
|
python3 -m pip list | grep pip
|
|
python3 -m pip list | grep setuptools
|
|
echo 'Completed build and installation on ${{ matrix.os }}'
|
|
|
|
# Create the directory for test results
|
|
mkdir -p /shared/test-results/test-results-${{ matrix.os }}
|
|
|
|
# Run AMDSMI Tests
|
|
echo 'Running AMDSMI Tests'
|
|
/opt/rocm/share/amd_smi/tests/amdsmitst > /shared/test-results/test-results-${{ matrix.os }}/amdsmi_tests.log
|
|
echo 'Completed AMDSMI Testing'
|
|
|
|
# Run Python Unit Tests
|
|
echo 'Running Python Unit Testing'
|
|
cd /opt/rocm/share/amd_smi/tests/python_unittest
|
|
./integration_test.py -v > /shared/test-results/test-results-${{ matrix.os }}/integration_test_output.txt 2>&1
|
|
./unit_tests.py -v > /shared/test-results/test-results-${{ matrix.os }}/unit_test_output.txt 2>&1
|
|
echo 'Completed Python Unit Testing'
|
|
|
|
# Run Build Testing
|
|
echo 'Running Build Tests'
|
|
cd /src/build/example
|
|
./amd_smi_drm_ex > /shared/test-results/test-results-${{ matrix.os }}/amd_smi_drm_ex.log || echo 'amd_smi_drm_ex failed'
|
|
./amd_smi_esmi_ex > /shared/test-results/test-results-${{ matrix.os }}/amd_smi_esmi_ex.log || echo 'amd_smi_esmi_ex failed'
|
|
./amd_smi_nodrm_ex > /shared/test-results/test-results-${{ matrix.os }}/amd_smi_nodrm_ex.log || echo 'amd_smi_nodrm_ex failed'
|
|
echo 'Completed Build Testing'
|
|
"
|
|
|
|
# Artifacts disabled for now
|
|
# - name: Upload Test Results
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: test-results-${{ matrix.os }}
|
|
# path: /tmp/test-results/test-results/test-results-${{ matrix.os }}
|
|
# if-no-files-found: warn
|
|
|
|
- name: AMDSMI Test Results
|
|
run: |
|
|
echo "Displaying AMDSMI test results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amdsmi_tests.log || echo "No amdsmi test results found for ${{ matrix.os }}"
|
|
|
|
- name: Integration Test Results
|
|
run: |
|
|
echo "Displaying Integration test results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/integration_test_output.txt || echo "No integration test results found for ${{ matrix.os }}"
|
|
|
|
- name: Unit Test Results
|
|
run: |
|
|
echo "Displaying Unit Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/unit_test_output.txt || echo "No unit test results found for ${{ matrix.os }}"
|
|
|
|
- name: DRM EX Test Results
|
|
run: |
|
|
echo "Displaying DRM EX Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amd_smi_drm_ex.log || echo "No amd_smi_drm_ex.log found for ${{ matrix.os }}"
|
|
|
|
- name: NO-DRM EX Test Results
|
|
run: |
|
|
echo "Displaying NO-DRM EX Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amd_smi_nodrm_ex.log || echo "No amd_smi_nodrm_ex.log found for ${{ matrix.os }}"
|
|
|
|
- name: ESMI EX Test Results
|
|
run: |
|
|
echo "Displaying ESMI EX Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amd_smi_esmi_ex.log || echo "No amd_smi_esmi_ex.log found for ${{ matrix.os }}"
|
|
|
|
|
|
build-and-install-rpm:
|
|
name: Build on RPM-based Systems
|
|
runs-on:
|
|
- self-hosted
|
|
- ${{ vars.RUNNER_TYPE }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- SLES
|
|
- RHEL8
|
|
- RHEL9
|
|
- Mariner2
|
|
- AzureLinux3
|
|
- AlmaLinux8
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
clean: false
|
|
|
|
- name: Set Docker Image and Package Manager for SLES
|
|
if: matrix.os == 'SLES'
|
|
run: |
|
|
echo "DOCKER_IMAGE=${{ secrets.SLES_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
echo "PACKAGE_MANAGER=zypper" >> $GITHUB_ENV
|
|
- name: Set Docker Image and Package Manager for RHEL8
|
|
if: matrix.os == 'RHEL8'
|
|
run: |
|
|
echo "DOCKER_IMAGE=${{ secrets.RHEL8_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
echo "PACKAGE_MANAGER=dnf" >> $GITHUB_ENV
|
|
- name: Set Docker Image and Package Manager for RHEL9
|
|
if: matrix.os == 'RHEL9'
|
|
run: |
|
|
echo "DOCKER_IMAGE=${{ secrets.RHEL9_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
echo "PACKAGE_MANAGER=dnf" >> $GITHUB_ENV
|
|
- name: Set Docker Image and Package Manager for Mariner2
|
|
if: matrix.os == 'Mariner2'
|
|
run: |
|
|
echo "DOCKER_IMAGE=${{ secrets.MARINER2_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
echo "PACKAGE_MANAGER=dnf" >> $GITHUB_ENV
|
|
- name: Set Docker Image and Package Manager for AzureLinux3
|
|
if: matrix.os == 'AzureLinux3'
|
|
run: |
|
|
echo "DOCKER_IMAGE=${{ secrets.AZURELINUX3_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
echo "PACKAGE_MANAGER=dnf" >> $GITHUB_ENV
|
|
- name: Set Docker Image and Package Manager for AlmaLinux8
|
|
if: matrix.os == 'AlmaLinux8'
|
|
run: |
|
|
echo "DOCKER_IMAGE=${{ secrets.ALMALINUX8_DOCKER_IMAGE }}" >> $GITHUB_ENV
|
|
echo "PACKAGE_MANAGER=dnf" >> $GITHUB_ENV
|
|
- name: Build and Install on ${{ matrix.os }}
|
|
run: |
|
|
# Define a host directory for test results
|
|
HOST_TEST_RESULTS_DIR=/tmp/test-results
|
|
|
|
# Ensure the host directory exists
|
|
mkdir -p $HOST_TEST_RESULTS_DIR
|
|
docker run --privileged -v ${{ github.workspace }}:/src:rw -v $HOST_TEST_RESULTS_DIR:/shared:rw $DOCKER_IMAGE /bin/bash -c "
|
|
set -e
|
|
cd /src
|
|
echo 'Inside Docker Container on ${{ matrix.os }}'
|
|
|
|
# Build AMD-SMI
|
|
BUILD_FOLDER=/src/build
|
|
RPM_BUILD='amd-smi-lib-*99999-local*.rpm'
|
|
rm -rf \$BUILD_FOLDER
|
|
mkdir -p \$BUILD_FOLDER
|
|
cd \$BUILD_FOLDER
|
|
cmake .. -DCPACK_RPM_PACKAGE_RELOCATABLE=ON -DBUILD_TESTS=ON -DENABLE_ESMI_LIB=ON
|
|
make -j \$(nproc)
|
|
make package
|
|
|
|
# Adjust permissions of the build directory
|
|
chmod -R a+rw \$BUILD_FOLDER
|
|
|
|
# Install AMD-SMI
|
|
case '$PACKAGE_MANAGER' in
|
|
zypper)
|
|
timeout 10m sudo zypper --no-refresh --no-gpg-checks install -y \$BUILD_FOLDER/\$RPM_BUILD
|
|
;;
|
|
dnf)
|
|
timeout 10m dnf install -y --skip-broken --disablerepo=* \$BUILD_FOLDER/\$RPM_BUILD
|
|
;;
|
|
*)
|
|
echo 'Unsupported package manager: $PACKAGE_MANAGER'
|
|
exit 1
|
|
;;
|
|
esac
|
|
ln -s /opt/rocm/bin/amd-smi /usr/local/bin
|
|
|
|
# Check If Installed
|
|
echo 'Listing installed packages:'
|
|
python3 -m pip list | grep amd
|
|
python3 -m pip list | grep pip
|
|
python3 -m pip list | grep setuptools
|
|
echo 'Completed build and installation on ${{ matrix.os }}'
|
|
|
|
# Create the directory for test results
|
|
mkdir -p /shared/test-results/test-results-${{ matrix.os }}
|
|
|
|
# Run AMDSMI Tests
|
|
echo 'Running AMDSMI Tests'
|
|
/opt/rocm/share/amd_smi/tests/amdsmitst > /shared/test-results/test-results-${{ matrix.os }}/amdsmi_tests.log
|
|
echo 'Completed AMDSMI Testing'
|
|
|
|
# Run Python Unit Tests
|
|
echo 'Running Python Unit Testing'
|
|
cd /opt/rocm/share/amd_smi/tests/python_unittest
|
|
./integration_test.py -v > /shared/test-results/test-results-${{ matrix.os }}/integration_test_output.txt 2>&1
|
|
./unit_tests.py -v > /shared/test-results/test-results-${{ matrix.os }}/unit_test_output.txt 2>&1
|
|
echo 'Completed Python Unit Testing'
|
|
|
|
# Run Build Testing
|
|
echo 'Running Build Tests'
|
|
cd /src/build/example
|
|
./amd_smi_drm_ex > /shared/test-results/test-results-${{ matrix.os }}/amd_smi_drm_ex.log || echo 'amd_smi_drm_ex failed'
|
|
./amd_smi_esmi_ex > /shared/test-results/test-results-${{ matrix.os }}/amd_smi_esmi_ex.log || echo 'amd_smi_esmi_ex failed'
|
|
./amd_smi_nodrm_ex > /shared/test-results/test-results-${{ matrix.os }}/amd_smi_nodrm_ex.log || echo 'amd_smi_nodrm_ex failed'
|
|
echo 'Completed Build Testing'
|
|
"
|
|
|
|
# Artifacts disabled for now
|
|
# - name: Upload Test Results
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: test-results-${{ matrix.os }}
|
|
# path: /tmp/test-results/test-results/test-results-${{ matrix.os }}
|
|
# if-no-files-found: warn
|
|
|
|
- name: AMDSMI Test Results
|
|
run: |
|
|
echo "Displaying AMDSMI test results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amdsmi_tests.log || echo "No amdsmi test results found for ${{ matrix.os }}"
|
|
|
|
- name: Python Integration Test Results
|
|
run: |
|
|
echo "Displaying Integration test results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/integration_test_output.txt || echo "No integration test results found for ${{ matrix.os }}"
|
|
|
|
- name: Python Unit Test Results
|
|
run: |
|
|
echo "Displaying Unit Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/unit_test_output.txt || echo "No unit test results found for ${{ matrix.os }}"
|
|
|
|
- name: DRM EX Test Results
|
|
run: |
|
|
echo "Displaying DRM EX Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amd_smi_drm_ex.log || echo "No amd_smi_drm_ex.log found for ${{ matrix.os }}"
|
|
|
|
- name: NO-DRM EX Test Results
|
|
run: |
|
|
echo "Displaying NO-DRM EX Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amd_smi_nodrm_ex.log || echo "No amd_smi_nodrm_ex.log found for ${{ matrix.os }}"
|
|
|
|
- name: ESMI EX Test Results
|
|
run: |
|
|
echo "Displaying ESMI EX Test Results for ${{ matrix.os }}"
|
|
cat /tmp/test-results/test-results/test-results-${{ matrix.os }}/amd_smi_esmi_ex.log || echo "No amd_smi_esmi_ex.log found for ${{ matrix.os }}"
|