Skip to content
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

add audit wheel to CI/CD for visibility of many_linux conformance #1114

Closed
43 changes: 37 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ jobs:
build-shared-libs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [x86_64, aarch64]
os: [ubuntu-latest] # Keep only one OS
arch: [x86_64] # Keep only one architecture
exclude:
- os: windows-latest # This probably requires arm64 Windows agents
arch: aarch64
- os: ubuntu-latest # Temporary. Takes too long, not ready yet.
arch: aarch64
runs-on: ${{ matrix.os }} # One day, we could run them on native agents. Azure supports this now but it's planned only for Q3 2023 for hosted agents
steps:
# Check out code
Expand Down Expand Up @@ -80,12 +82,14 @@ jobs:
build-shared-libs-cuda:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
arch: [x86_64, aarch64]
os: [ubuntu-latest]
arch: [x86_64]
cuda_version: ['12.1.0']
exclude:
- os: windows-latest # This probably requires arm64 Windows agents
arch: aarch64
- os: ubuntu-latest # Temporary. Takes too long, not ready yet.
arch: aarch64
runs-on: ${{ matrix.os }} # One day, we could run them on native agents. Azure supports this now but it's planned only for Q3 2023 for hosted agents
steps:
# Check out code
Expand Down Expand Up @@ -150,12 +154,14 @@ jobs:
- build-shared-libs-cuda
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]
python-version: ["3.9"]
arch: [x86_64, aarch64]
exclude:
- os: windows-latest # This probably requires arm64 Windows agents
arch: aarch64
- os: ubuntu-latest # Temporary. Takes too long, not ready yet.
arch: aarch64
runs-on: ${{ matrix.os }}
steps:
# Check out code
Expand Down Expand Up @@ -198,6 +204,31 @@ jobs:
name: bdist_wheel_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.python-version }}
path: dist/bitsandbytes-*.whl
retention-days: 7

audit-wheels:
needs: build-wheels
runs-on: ubuntu-latest
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
steps:
- uses: actions/checkout@v4
- name: Download all wheel artifacts
uses: actions/download-artifact@v2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't use download-artifact@v2 with upload-artifact@v4, which is probably why you're not getting anything here :)

with:
path: dist/
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip
- name: Show auditwheel information
run: |
sudo apt-get update && sudo apt-get install -y tree
tree
echo $GITHUB_STEP_SUMMARY
pip install -q auditwheel && python ./scripts/auditwheel_show.py
cat $GITHUB_STEP_SUMMARY

publish:
needs: build-wheels
runs-on: ubuntu-latest
Expand Down
33 changes: 33 additions & 0 deletions scripts/auditwheel_show.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import glob
import os
import subprocess


def append_to_summary(content):
print(content + "\n") # only for debugging now
with open(os.getenv("GITHUB_STEP_SUMMARY"), "a") as summary_file:
summary_file.write(content + "\n")


subprocess.run(["pip", "install", "-q", "auditwheel"])

wheel_files = glob.glob("**/*.whl", recursive=True)
print(wheel_files) # only for debugging now

if not wheel_files:
append_to_summary("No wheel files found in `dist/` directory.")
exit(0)

for whl in wheel_files:
append_to_summary("---")
append_to_summary("### 🎡 Auditing wheel: `" + whl + "`")

audit_wheel_output = subprocess.run(
["auditwheel", "show", whl], capture_output=True, text=True
)

if audit_wheel_output.stdout:
append_to_summary(audit_wheel_output.stdout)

if audit_wheel_output.stderr:
append_to_summary("**Error:**\n```\n" + audit_wheel_output.stderr + "```")
Loading