-
Notifications
You must be signed in to change notification settings - Fork 244
Deb and rpm install sanity check #3126
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
218 changes: 218 additions & 0 deletions
218
.github/workflows/test_native_linux_packages_install.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,218 @@ | ||
| # Copyright Advanced Micro Devices, Inc. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| name: Test Native Linux Packages Install | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| package_install_url: | ||
| description: "Package installation URL (includes architecture subdirectory for RPM)." | ||
| required: true | ||
| type: string | ||
| release_type: | ||
| description: "Release Type (ci, dev, nightly, prerelease)." | ||
| required: true | ||
| type: string | ||
| gpg_key_url: | ||
| description: "GPG key URL for signed repos" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| os_profile: | ||
| description: OS profile (e.g., ubuntu2404, rhel10, sles16). Package type (deb/rpm) is derived from this. | ||
| required: true | ||
| type: string | ||
| artifact_group: | ||
| description: Artifact group to extract GPU architecture from (e.g., gfx94X-dcgpu). Default gfx94X-dcgpu. | ||
| required: false | ||
| type: string | ||
| default: "gfx94X-dcgpu" | ||
| install_prefix: | ||
| description: Installation prefix path (optional, defaults to /opt/rocm/core). | ||
| required: false | ||
| type: string | ||
| default: "/opt/rocm/core" | ||
| test_type: | ||
| description: "Test type: sanity (install + basic verification), full (install + basic + rdhc). If not set, script default is used." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| repository: | ||
| description: "Repository to checkout. Otherwise, defaults to `github.repository`" | ||
| type: string | ||
| required: false | ||
| ref: | ||
| description: "Branch, tag or SHA to checkout. Defaults to the reference or SHA that triggered the workflow" | ||
| type: string | ||
| required: false | ||
| workflow_dispatch: | ||
| inputs: | ||
| package_install_url: | ||
| description: "Package installation URL (includes architecture subdirectory for RPM)" | ||
| required: true | ||
| type: string | ||
| release_type: | ||
| description: "Release line (ci, dev, nightly, or prerelease)" | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - ci | ||
| - dev | ||
| - nightly | ||
| - prerelease | ||
| gpg_key_url: | ||
| description: "GPG key URL for signed repos" | ||
| type: string | ||
| default: "" | ||
| os_profile: | ||
| description: OS profile (package type deb/rpm is derived from this). | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - ubuntu2404 | ||
| - rhel10 | ||
| - sles16 | ||
| artifact_group: | ||
| description: Artifact group to extract GPU architecture from (e.g., gfx94X-dcgpu) | ||
| type: string | ||
| default: "gfx94X-dcgpu" | ||
| install_prefix: | ||
| description: Installation prefix path | ||
| type: string | ||
| default: "/opt/rocm/core" | ||
| required: false | ||
| test_type: | ||
| description: "Test type: sanity or full (optional; leave empty for script default)" | ||
| type: string | ||
| default: "" | ||
| repository: | ||
| description: "Repository to checkout. Otherwise, defaults to `github.repository`" | ||
| type: string | ||
| ref: | ||
| description: "Branch, tag or SHA to checkout. Defaults to the reference or SHA that triggered the workflow" | ||
| type: string | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| run-name: Test - Native Linux packages Install (${{ inputs.os_profile }}) | ||
|
|
||
| jobs: | ||
| prepare_install_context: | ||
| name: Prepare install context (package type, GPU arch, container image) | ||
| runs-on: ubuntu-24.04 | ||
| outputs: | ||
| pkg_type: ${{ steps.derive.outputs.pkg_type }} | ||
| gfx_arch: ${{ steps.derive.outputs.gfx_arch }} | ||
| container_image: ${{ steps.derive.outputs.container_image }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| repository: ${{ inputs.repository || github.repository }} | ||
| ref: ${{ inputs.ref || github.ref }} | ||
|
|
||
| - name: Derive package type, GPU architecture, and container image | ||
| id: derive | ||
| run: | | ||
| case "${{ inputs.os_profile }}" in | ||
| ubuntu*|debian*) PKG_TYPE="deb" ;; | ||
| *) PKG_TYPE="rpm" ;; | ||
| esac | ||
| echo "pkg_type=${PKG_TYPE}" >> $GITHUB_OUTPUT | ||
| python build_tools/packaging/linux/get_url_repo_params.py extract-gfx-arch \ | ||
| --artifact-group "${{ inputs.artifact_group }}" | ||
| python build_tools/packaging/linux/get_url_repo_params.py get-container-image \ | ||
| --os-profile "${{ inputs.os_profile }}" | ||
|
|
||
| test_native_linux_packages_install: | ||
| name: Test Native Linux Packages Installation - ${{ inputs.os_profile }} | ||
| needs: [prepare_install_context] | ||
| strategy: | ||
| fail-fast: false | ||
| runs-on: ${{ github.repository_owner == 'ROCm' && 'linux-gfx942-1gpu-ossci-rocm' || 'ubuntu-24.04' }} | ||
| container: | ||
| image: ${{ needs.prepare_install_context.outputs.container_image }} | ||
| options: --ipc host | ||
| --privileged | ||
| env: | ||
| REPO_URL: ${{ inputs.package_install_url }} | ||
| GPG_KEY_URL: ${{ inputs.gpg_key_url || '' }} | ||
| OS_PROFILE: ${{ inputs.os_profile }} | ||
| PKG_TYPE: ${{ needs.prepare_install_context.outputs.pkg_type }} | ||
| RELEASE_TYPE: ${{ inputs.release_type }} | ||
| GFX_ARCH: ${{ needs.prepare_install_context.outputs.gfx_arch }} | ||
| INSTALL_PREFIX: ${{ inputs.install_prefix || '/opt/rocm/core' }} | ||
| TEST_TYPE: ${{ inputs.test_type || 'sanity' }} | ||
| steps: | ||
| - name: Install System Prerequisites | ||
| run: | | ||
| echo "Installing prerequisites for ${{ env.PKG_TYPE }} on container" | ||
|
|
||
| if [ "${{ env.PKG_TYPE }}" = "deb" ]; then | ||
| apt update | ||
| apt install -y \ | ||
| wget \ | ||
| curl \ | ||
| ca-certificates \ | ||
| gpg \ | ||
| lsb-release | ||
| if [ "$TEST_TYPE" = "full" ]; then | ||
| echo "Extra OS packages for --test-type full (e.g. rdhc): pciutils, kmod, apt-utils" | ||
| apt install -y pciutils kmod apt-utils | ||
| fi | ||
| elif [[ "${{ inputs.os_profile }}" == sles* ]]; then | ||
| # SLES prerequisites (uses BCI base - zypper) | ||
| zypper refresh | ||
| zypper install -y \ | ||
| wget \ | ||
| curl \ | ||
| ca-certificates \ | ||
| gpg2 \ | ||
| lsb-release \ | ||
| update-alternatives | ||
| if [ "$TEST_TYPE" = "full" ]; then | ||
| echo "Extra OS packages for --test-type full on SLES (e.g. rdhc): pciutils, kmod" | ||
| zypper install -y pciutils kmod | ||
| fi | ||
| else | ||
| # rpm (non-SLES on UBI 10); --allowerasing for curl vs curl-minimal on UBI | ||
| dnf install -y --allowerasing \ | ||
| wget \ | ||
| curl \ | ||
| ca-certificates \ | ||
| gnupg2 \ | ||
| dnf-plugins-core | ||
| if [ "$TEST_TYPE" = "full" ]; then | ||
| echo "Extra OS packages for --test-type full (e.g. rdhc): pciutils, kmod" | ||
| dnf install -y --allowerasing pciutils kmod | ||
| fi | ||
| fi | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
nunnikri marked this conversation as resolved.
|
||
| with: | ||
| repository: ${{ inputs.repository || github.repository }} | ||
| ref: ${{ inputs.ref || github.ref }} | ||
|
|
||
| - name: Setup Python and install runtime | ||
| run: | | ||
| bash build_tools/packaging/linux/setup_python_cmd.sh \ | ||
| --os-profile "${{ inputs.os_profile }}" \ | ||
| --install-runtime \ | ||
| --output-format github | ||
|
|
||
| - name: Install Python Dependencies | ||
| run: | | ||
| # Use venv for all distros for consistency and future-proofing (PEP 668) | ||
| $PYTHON_CMD -m venv /tmp/test-venv | ||
| /tmp/test-venv/bin/python -m pip install --upgrade pip | ||
| /tmp/test-venv/bin/python -m pip install -r build_tools/packaging/linux/tests/requirements.txt | ||
| echo "PYTHON_CMD=/tmp/test-venv/bin/python" >> $GITHUB_ENV | ||
|
|
||
| - name: Package Installation Test | ||
| run: | | ||
| echo "TEST - OS:${{ inputs.os_profile }} REPO:${{ env.REPO_URL }} Arch:${{ env.GFX_ARCH }} Type:${{ env.RELEASE_TYPE }}" | ||
| $PYTHON_CMD -m pytest build_tools/packaging/linux/native_linux_package_install_test.py -vv --tb=long -s | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.