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

Update build wheels job to test the wheels #56

Merged
merged 43 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
abed843
Update build wheels job to test the wheels
bmhowe23 Jan 17, 2025
d6a35cd
Skip more steps if prior run was provided
bmhowe23 Jan 17, 2025
7eb2907
Update wheel name used by test script
bmhowe23 Jan 17, 2025
9bdbde7
Fix path
bmhowe23 Jan 17, 2025
63e8b93
Build wheels for appropriate Python version
bmhowe23 Jan 17, 2025
58ec167
Remove Python installation into manylinux
bmhowe23 Jan 17, 2025
3bfe9a1
Remove continue-on-error
bmhowe23 Jan 17, 2025
c2c2c9a
Add qec-lib-plugins
bmhowe23 Jan 17, 2025
84e696c
Use getCUDAQLibraryPath instead of DECODER_PLUGIN_DIR
bmhowe23 Jan 17, 2025
58b6f99
Try again
bmhowe23 Jan 17, 2025
9f6790d
Update and use getCUDAQXLibraryPath
bmhowe23 Jan 18, 2025
35c14df
Rename variable
bmhowe23 Jan 18, 2025
3545bdb
Be more precise with lib names
bmhowe23 Jan 18, 2025
f5317df
Formatting
bmhowe23 Jan 18, 2025
0e3e87a
Add Debug
bmhowe23 Jan 18, 2025
b7c9ad6
More debug
bmhowe23 Jan 18, 2025
7070990
Fix RPATH problem that was causing bad auditwheel grafting
bmhowe23 Jan 18, 2025
bb7b874
Cleanup
bmhowe23 Jan 18, 2025
5bbd9fc
Use unique_ptr and use more namespaces
bmhowe23 Jan 18, 2025
1eac4ae
More cleanup
bmhowe23 Jan 18, 2025
a39f31c
Restore Python cleanup
bmhowe23 Jan 18, 2025
7d43a3b
Build CUDA-Q wheels from source (needed to test CUDA-QX wheels)
bmhowe23 Jan 18, 2025
4b50c6c
Fix duplicate artifact upload error
bmhowe23 Jan 18, 2025
2f52cb8
Update test script to use custom-built CUDA-Q wheels
bmhowe23 Jan 18, 2025
ea34239
artifacts_from_run updates
bmhowe23 Jan 18, 2025
629920b
artifacts_from_run updates
bmhowe23 Jan 18, 2025
7ae5056
artifacts_from_run: provide token
bmhowe23 Jan 18, 2025
00a8297
More tokens
bmhowe23 Jan 18, 2025
a36a515
Token debug
bmhowe23 Jan 18, 2025
1200ad3
test_wheels debug
bmhowe23 Jan 18, 2025
e56c0c0
Fix test_wheels wheel name
bmhowe23 Jan 18, 2025
2143901
Update dependency on cuda-quantum for wheel
bmhowe23 Jan 18, 2025
2aefae0
Fix download
bmhowe23 Jan 18, 2025
5309859
Update conditional logic
bmhowe23 Jan 18, 2025
323ac49
Update conditional logic - 2
bmhowe23 Jan 18, 2025
9841a11
Update conditional logic - 3
bmhowe23 Jan 18, 2025
537dcc8
Add retention-days
bmhowe23 Jan 19, 2025
0346bad
Use smaller runners to be more resource friendly
bmhowe23 Jan 19, 2025
8a83f43
Cleanup
bmhowe23 Jan 19, 2025
366c021
Remove commented out / unneeded code
bmhowe23 Jan 19, 2025
9bb4b6c
Add option to use released CUDA-Q wheels instead of building
bmhowe23 Jan 19, 2025
6f24503
Update runs-on
bmhowe23 Jan 19, 2025
74837ea
Address PR comments
bmhowe23 Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/actions/get-cudaq-version/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ runs:

- name: Install jq
run: |
if [ -x "$(command -v apt-get)" ]; then
apt-get update
apt-get install -y --no-install-recommends jq
elif [ -x "$(command -v dnf)" ]; then
dnf install -y --nobest --setopt=install_weak_deps=False jq
if [ ! -x "$(command -v jq)" ]; then
if [ -x "$(command -v apt-get)" ]; then
apt-get update
apt-get install -y --no-install-recommends jq
elif [ -x "$(command -v dnf)" ]; then
dnf install -y --nobest --setopt=install_weak_deps=False jq
fi
fi

shell: bash
Expand Down
155 changes: 155 additions & 0 deletions .github/actions/get-cudaq-wheels/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Get CUDAQ wheels
description: 'Either restore CUDAQ wheels from cache or build them'

inputs:
repo:
description: 'CUDAQ repository.'
required: true
ref:
description: 'The branch, tag or SHA to checkout.'
required: true
token:
description: 'CUDAQ repository access token.'
default: ''
required: false
pr-number:
description: 'Unique pull request identifier.'
default: ''
required: false
save-build:
description: 'Indicates whether to save the build'
default: 'false'
required: false
lookup-only:
description: 'Check if a cache entry exists without downloading the cache'
default: 'false'
required: false
platform:
description: 'Platform (amd64 or arm64)'
default: ''
required: true
outputs:
found-cache:
description: 'A boolean value to indicate that a cache entry was found.'
value: ${{ steps.check-cache.outputs.valid }}

runs:
using: "composite"
steps:
# ==========================================================================
# Try to restore from cache
# ==========================================================================

- name: Create CUDAQ wheel cache key
id: cudaq-wheels-key
env:
# This are a list of files that when changed should require a new cudaq build
to_hash: |
.github/actions/get-cudaq-wheels/**
.cudaq_version
run: |
hash=${{ hashFiles(format('{0}', env.to_hash)) }}
echo "main=cudaq-wheels-${{ inputs.platform }}-${{ inputs.ref }}-$hash" >> $GITHUB_OUTPUT
if [[ -n "${{ inputs.pr-number }}" ]]; then
echo "pr=-pr${{ inputs.pr-number }}" >> $GITHUB_OUTPUT
fi
sudo mkdir /cudaq-wheels && sudo chmod 777 /cudaq-wheels
shell: bash --noprofile --norc -euo pipefail {0}

- name: Try to restoring CUDAQ wheels from cache
id: restore-cudaq-wheels
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: false
path: /cudaq-wheels
key: ${{ steps.cudaq-wheels-key.outputs.main }}${{ steps.cudaq-wheels-key.outputs.pr }}
restore-keys: ${{ steps.cudaq-wheels-key.outputs.main }}
lookup-only: ${{ inputs.lookup-only }}

# The restore action could find a partial match using the `restore-keys`. In such cases
# it would still report `cache-hit` as false, but would load the cache from the partial
# one. Thus, we need to check whether the cache is valid by other means.
- name: Check if cache is valid
id: check-cache
run: |
if [[ "${{ steps.restore-cudaq-wheels.outputs.cache-matched-key }}" == "" ]]; then
echo "valid=false" >> $GITHUB_OUTPUT
else
echo "valid=true" >> $GITHUB_OUTPUT
fi
shell: bash --noprofile --norc -euo pipefail {0}

# ==========================================================================
# Build CUDAQ wheels
# ==========================================================================

- name: Login to GitHub CR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Get CUDAQ code
if: steps.check-cache.outputs.valid == 'false' && inputs.lookup-only == 'false'
uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
path: cudaq
set-safe-directory: true

- name: Set up context for buildx
run: |
docker context create builder_context
shell: bash --noprofile --norc -euo pipefail {0}

- name: Set up buildx runner
uses: docker/setup-buildx-action@v3
with:
endpoint: builder_context
driver-opts: network=host

- name: Build 3.10 wheel
uses: docker/build-push-action@v5
with:
context: cudaq
file: ./cudaq/docker/release/cudaq.wheel.Dockerfile
build-args: |
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu12.0-gcc11-main
release_version=0.99.99
python_version=3.10
outputs: /cudaq-wheels

- name: Build 3.11 wheel
uses: docker/build-push-action@v5
with:
context: cudaq
file: ./cudaq/docker/release/cudaq.wheel.Dockerfile
build-args: |
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu12.0-gcc11-main
release_version=0.99.99
python_version=3.11
outputs: /cudaq-wheels

- name: Build 3.12 wheel
uses: docker/build-push-action@v5
with:
context: cudaq
file: ./cudaq/docker/release/cudaq.wheel.Dockerfile
build-args: |
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ inputs.platform }}-cu12.0-gcc11-main
release_version=0.99.99
python_version=3.12
outputs: /cudaq-wheels

# ==========================================================================
# Store CUDAQ wheels cache
# ==========================================================================

- name: Store CUDAQ wheels in the cache
if: steps.check-cache.outputs.valid == 'false' && inputs.save-build == 'true' && inputs.lookup-only == 'false'
uses: actions/cache/save@v4
with:
path: /cudaq-wheels
key: ${{ steps.cudaq-wheels-key.outputs.main }}${{ steps.cudaq-wheels-key.outputs.pr }}
Loading
Loading