Skip to content

Commit

Permalink
Merge branch 'main' into feature/oqc_client_upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jfriel-oqc committed Nov 7, 2024
2 parents 23a5e54 + 7b42224 commit 7fd1c62
Show file tree
Hide file tree
Showing 962 changed files with 50,952 additions and 9,767 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.github @bettinaheim @amccaskey @bmhowe23
.github @bettinaheim @1tnguyen @bmhowe23
3 changes: 2 additions & 1 deletion .github/actions/install-ngc-cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ runs:
wget -O ngccli_linux.zip --content-disposition \
https://api.ngc.nvidia.com/v2/resources/nvidia/ngc-apps/ngc_cli/versions/${{ inputs.version }}/files/ngccli_linux.zip
if [ -z "$(sha256sum ngccli_linux.zip | grep -o '${{ inputs.checksum }} ')" ]; then
echo "::error::NGC CLI was corrupted during download." && exit 1
echo "::error::NGC CLI was corrupted during download."
exit 1
fi
unzip ngccli_linux.zip && chmod u+x ngc-cli/ngc
12 changes: 11 additions & 1 deletion .github/actions/run-in-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
shell:
default: "bash"
required: false
# Adding a new optional parameter for directory mapping
volume:
default: ""
required: false

runs:
using: "composite"
Expand All @@ -21,6 +25,12 @@ runs:
then additional_run_args="--gpus all"
fi
# Check if a volume mapping is specified and set the option
volume_option=""
if [ -n "${{ inputs.volume }}" ]; then
volume_option="-v ${{ inputs.volume }}"
fi
# Note: "bash -s << EOF" does not play nice with mpirun/mpiexec. It
# silently skips any shell commands that come after the mpirun/mpiexec,
# so don't use it. Use this instead, which seems to work better.
Expand All @@ -29,7 +39,7 @@ runs:
${{ inputs.run }}
EOF
container=$(docker run --user ${{ inputs.user }} $additional_run_args -id ${{ inputs.image }})
container=$(docker run --user ${{ inputs.user }} $additional_run_args $volume_option -id ${{ inputs.image }})
docker cp $tmpFile $container:$tmpFile
docker exec --user root $container chown -R ${{ inputs.user }} $tmpFile
docker exec $container ${{ inputs.shell }} $tmpFile
Expand Down
10 changes: 10 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 70%
threshold: 1%
ignore:
- "tpls"
fixes:
- "/workspaces/cuda-quantum::"
3 changes: 3 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
allowRemediationCommits:
individual: true
thirdParty: false
82 changes: 62 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ on:
push:
branches:
- "pull-request/[0-9]+"

merge_group:
types:
- checks_requested

name: CI # do not change name without updating workflow_run triggers

concurrency:
Expand All @@ -28,6 +31,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
pull-requests: read
contents: read

outputs:
pull_request_number: ${{ steps.pr_info.outputs.pr_number }}
Expand Down Expand Up @@ -78,7 +82,7 @@ jobs:
strategy:
matrix:
platform: [amd64, arm64]
toolchain: [llvm, clang16, gcc12]
toolchain: [clang16, gcc11, gcc12]
fail-fast: false
uses: ./.github/workflows/dev_environment.yml
secrets:
Expand All @@ -87,11 +91,11 @@ jobs:
with:
platforms: linux/${{ matrix.platform }}
dockerfile: build/devdeps.Dockerfile
toolchain: ${{ matrix.toolchain }}
build_config_id: ${{ matrix.toolchain }}
build_args: |
llvm_commit=${{ needs.metadata.outputs.llvm_commit }}
pybind11_commit=${{ needs.metadata.outputs.pybind11_commit }}
toolchain=${{ matrix.toolchain }}
registry_cache_from: ${{ inputs.cache_base || needs.metadata.outputs.cache_base }}
checkout_submodules: true
# needed only for the cloudposse GitHub action
matrix_key: ${{ matrix.platform }}-${{ matrix.toolchain }}

Expand All @@ -101,6 +105,7 @@ jobs:
strategy:
matrix:
platform: [amd64, arm64]
cuda_version: ["11.8", "12.0"]
fail-fast: false
uses: ./.github/workflows/dev_environment.yml
secrets:
Expand All @@ -109,22 +114,25 @@ jobs:
with:
platforms: linux/${{ matrix.platform }}
dockerfile: build/devdeps.manylinux.Dockerfile
toolchain: gcc11
build_config_id: cu${{ matrix.cuda_version }}-gcc11
build_args: |
base_image=ghcr.io/nvidia/pypa/manylinux_2_28${{ (matrix.platform == 'arm64' && '_aarch64') || (matrix.platform == 'amd64' && '_x86_64') || '' }}:latest
cuda_version=${{ matrix.cuda_version }}
toolchain=gcc11
distro=rhel8
llvm_commit=${{ needs.metadata.outputs.llvm_commit }}
pybind11_commit=${{ needs.metadata.outputs.pybind11_commit }}
registry_cache_from: ${{ inputs.cache_base || needs.metadata.outputs.cache_base }}
# needed only for the cloudposse GitHub action
matrix_key: ${{ matrix.platform }}-python
matrix_key: ${{ matrix.platform }}-cu${{ matrix.cuda_version }}-python

source_build:
name: Load source build cache
needs: metadata
strategy:
matrix:
platform: [amd64, arm64]
cuda_version: ["11.8", "12.0"]
fail-fast: false
uses: ./.github/workflows/dev_environment.yml
secrets:
Expand All @@ -133,14 +141,16 @@ jobs:
with:
platforms: linux/${{ matrix.platform }}
dockerfile: build/assets.Dockerfile
build_config_id: cu${{ matrix.cuda_version }}-llvm
build_target: prereqs
toolchain: gcc11
build_args: |
base_image=${{ fromJson(needs.metadata.outputs.platform_config)[format('{0}', matrix.platform)].minimal_base_image }}
cuda_version=${{ matrix.cuda_version }}
toolchain=llvm
registry_cache_from: ${{ inputs.cache_base || needs.metadata.outputs.cache_base }}
checkout_submodules: true
# needed only for the cloudposse GitHub action
matrix_key: ${{ matrix.platform }}-installer
matrix_key: ${{ matrix.platform }}-cu${{ matrix.cuda_version }}-installer

# This job is needed only when using the cloudposse GitHub action to read
# the output of a matrix job. This is a workaround due to current GitHub
Expand All @@ -155,7 +165,7 @@ jobs:
json: "${{ steps.read_json.outputs.result }}"

steps:
- uses: cloudposse/github-action-matrix-outputs-read@0.1.2
- uses: cloudposse/github-action-matrix-outputs-read@1.0.0
id: read_json
with:
matrix-step-name: dev_environment
Expand All @@ -166,7 +176,7 @@ jobs:
strategy:
matrix:
platform: [amd64, arm64]
toolchain: [llvm, clang16, gcc12]
toolchain: [clang16, gcc11, gcc12]
mpi: [openmpi, mpich]
exclude:
- toolchain: llvm
Expand All @@ -183,6 +193,24 @@ jobs:
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
export_environment: ${{ github.event_name == 'workflow_dispatch' && inputs.export_environment }}

gen_code_coverage:
name: Gen code coverage
needs: config
strategy:
matrix:
platform: [amd64]
toolchain: [clang16]
fail-fast: false
uses: ./.github/workflows/generate_cc.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
platform: linux/${{ matrix.platform }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-{1}', matrix.platform, matrix.toolchain)] }}
export_environment: ${{ github.event_name == 'workflow_dispatch' && inputs.export_environment }}

docker_image:
name: Create Docker images
needs: config
Expand All @@ -196,17 +224,18 @@ jobs:
DOCKERHUB_READONLY_TOKEN: ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
with:
platforms: linux/${{ matrix.platform }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-llvm', matrix.platform)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-llvm', matrix.platform)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-llvm', matrix.platform)] }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-gcc11', matrix.platform)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-gcc11', matrix.platform)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-gcc11', matrix.platform)] }}

python_wheels:
name: Create Python wheels
needs: config
strategy:
matrix:
platform: [amd64, arm64]
python_version: ['3.8', '3.11']
python_version: ['3.10', '3.12']
cuda_version: ["11.8", "12.0"]
fail-fast: false
uses: ./.github/workflows/python_wheels.yml
secrets:
Expand All @@ -215,16 +244,28 @@ jobs:
with:
platform: linux/${{ matrix.platform }}
python_version: ${{ matrix.python_version }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-python', matrix.platform)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-python', matrix.platform)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-python', matrix.platform)] }}
cuda_version: ${{ matrix.cuda_version }}
devdeps_image: ${{ fromJson(needs.config.outputs.json).image_hash[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}
devdeps_cache: ${{ fromJson(needs.config.outputs.json).cache_key[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}
devdeps_archive: ${{ fromJson(needs.config.outputs.json).tar_archive[format('{0}-cu{1}-python', matrix.platform, matrix.cuda_version)] }}

python_metapackages:
name: Create Python metapackages
needs: python_wheels
uses: ./.github/workflows/python_metapackages.yml
with:
cudaq_version: ${{ needs.python_wheels.outputs.cudaq_version }}
python_versions: "['3.10', '3.12']"
cuda_versions: "['', '11.8', '12.0']"
wheel_artifacts: 'pycudaq-*'

binaries:
name: Create CUDA Quantum installer
needs: [metadata, config]
strategy:
matrix:
platform: [amd64, arm64]
cuda_version: ["11.8", "12.0"]
fail-fast: false
uses: ./.github/workflows/prebuilt_binaries.yml
secrets:
Expand All @@ -233,8 +274,9 @@ jobs:
with:
platform: linux/${{ matrix.platform }}
platform_base_image: ${{ fromJson(needs.metadata.outputs.platform_config)[format('{0}', matrix.platform)].minimal_base_image }}
build_cache: ${{ fromJson(needs.config.outputs.json).build_cache[format('{0}-installer', matrix.platform)] }}
toolchain: gcc11
build_config_id: cu${{ matrix.cuda_version }}-llvm
cuda_version: ${{ matrix.cuda_version }}
build_cache: ${{ fromJson(needs.config.outputs.json).build_cache[format('{0}-cu{1}-installer', matrix.platform, matrix.cuda_version)] }}

clean_up:
name: Prepare cache clean-up
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/cla_assistant.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/clean_caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ jobs:
# downsides, and do just that here to have some periodic clean up.

- name: Delete build caches for MPI asset (ARM64)
uses: actions/delete-package-versions@v4
uses: actions/delete-package-versions@v5
with:
package-name: buildcache-cuda-quantum-assets-openmpi-gcc11-arm64
package-type: 'container'
min-versions-to-keep: 1 # the used action does not support 0 here

- name: Delete build caches for MPI asset (AMD64)
uses: actions/delete-package-versions@v4
uses: actions/delete-package-versions@v5
with:
package-name: buildcache-cuda-quantum-assets-openmpi-gcc11-amd64
package-type: 'container'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/clean_up.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
/repos/nvidia/cuda-quantum/git/refs/heads/$branch
done
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.REPO_BOT_ACCESS_TOKEN || github.token }}
draft_releases:
name: Delete draft release
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
# We need to keep a good number of untagged manifests,
# since each tagged image contains/depends on untagged components
- name: Delete untagged images
uses: actions/delete-package-versions@v4
uses: actions/delete-package-versions@v5
with:
package-name: ${{ matrix.image_name }}
package-type: 'container'
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:

- name: Delete matching signatures
if: steps.packages.outputs.versions_to_remove
uses: actions/delete-package-versions@v4
uses: actions/delete-package-versions@v5
with:
package-name: ${{ matrix.image_name }}
package-type: 'container'
Expand Down
Loading

0 comments on commit 7fd1c62

Please sign in to comment.