forked from NVIDIA/cuda-quantum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NVIDIA#910 from bettinaheim/releases/v0.5.0
- Loading branch information
Showing
44 changed files
with
1,983 additions
and
222 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -287,51 +287,50 @@ jobs: | |
build_info=${{ matrix.info_file }}* | ||
platforms=`cat $build_info | grep -o 'platforms: \S*' | cut -d ' ' -f 2` | ||
cudaq_image=`cat $build_info | grep -o 'cuda-quantum-image: \S*' | cut -d ' ' -f 2` | ||
cudaq_ngc_image=`cat $build_info | grep -o 'cuda-quantum-ngc-image: \S*' | cut -d ' ' -f 2` | ||
cudaqbase_image=`cat $build_info | grep -o 'cuda-quantum-image: \S*' | cut -d ' ' -f 2` | ||
cudaqdev_image=`cat $build_info | grep -o 'cuda-quantum-dev-image: \S*' | cut -d ' ' -f 2` | ||
cudaqdevdeps_image=`cat $build_info | grep -o 'cuda-quantum-devdeps-image: \S*' | cut -d ' ' -f 2` | ||
for file in `ls *zip`; do unzip "$file" && rm "$file"; done && cd - | ||
docker pull $cudaq_image | ||
repo_owner=${{ github.repository_owner }} | ||
image_short_name=cuda-quantum | ||
base_tag=`docker inspect $cudaq_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.version"'` | ||
image_title=`docker inspect $cudaq_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.title"'` | ||
image_description=`docker inspect $cudaq_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.description"'` | ||
docker image rm $cudaq_image | ||
docker pull $cudaqbase_image | ||
base_tag=`docker inspect $cudaqbase_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.version"'` | ||
image_title=`docker inspect $cudaqbase_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.title"'` | ||
image_description=`docker inspect $cudaqbase_image --format='{{json .Config.Labels}}' | jq -r '."org.opencontainers.image.description"'` | ||
docker image rm $cudaqbase_image | ||
docker image prune --force | ||
registry=${{ vars.registry || 'localhost:5000' }}/${repo_owner,,} | ||
if [ -n "$(echo "$platforms" | grep ',')" ] && ${{ secrets.NGC_CREDENTIALS != '' }}; then | ||
if [ -n "$cudaq_ngc_image" ]; then | ||
ngc_registry=nvcr.io/${repo_owner,,}/nightly | ||
fi | ||
fi | ||
registry=`echo $cudaqbase_image | rev | cut -d / -f2- | rev` | ||
push_to_ngc=`([ "$registry" == "${registry#nvcr.io}" ] && echo false) || echo true` | ||
echo "release_id=$release_id" >> $GITHUB_OUTPUT | ||
echo "registry=$registry" >> $GITHUB_OUTPUT | ||
echo "ngc_registry=$ngc_registry" >> $GITHUB_OUTPUT | ||
echo "image_short_name=$image_short_name" >> $GITHUB_OUTPUT | ||
echo "image_name=${ngc_registry:-$registry}/$image_short_name" >> $GITHUB_OUTPUT | ||
echo "push_to_ngc=$push_to_ngc" >> $GITHUB_OUTPUT | ||
echo "image_name=$registry/cuda-quantum" >> $GITHUB_OUTPUT | ||
echo "image_tag=${base_tag%-base}" >> $GITHUB_OUTPUT | ||
echo "image_title=$image_title" >> $GITHUB_OUTPUT | ||
echo "image_description=$image_description" >> $GITHUB_OUTPUT | ||
echo "platforms=$platforms" >> $GITHUB_OUTPUT | ||
echo "cudaq_image=$cudaq_image" >> $GITHUB_OUTPUT | ||
echo "cudaqbase_image=$cudaqbase_image" >> $GITHUB_OUTPUT | ||
echo "cudaqdev_image=$cudaqdev_image" >> $GITHUB_OUTPUT | ||
echo "cudaqdevdeps_image=$cudaqdevdeps_image" >> $GITHUB_OUTPUT | ||
echo "assets_folder=$assets_folder" >> $GITHUB_OUTPUT | ||
env: | ||
GH_TOKEN: ${{ secrets.REPO_BOT_ACCESS_TOKEN }} | ||
|
||
- name: Log in to the registry | ||
if: steps.release_info.outputs.ngc_registry || vars.registry | ||
- name: Log in to default registry | ||
if: steps.release_info.outputs.push_to_ngc != 'true' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ steps.release_info.outputs.ngc_registry || vars.registry }} | ||
username: ${{ (steps.release_info.outputs.ngc_registry && '$oauthtoken') || github.actor }} | ||
password: ${{ (steps.release_info.outputs.ngc_registry && secrets.NGC_CREDENTIALS) || github.token }} | ||
registry: ${{ vars.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Log in to NGC registry | ||
if: steps.release_info.outputs.push_to_ngc == 'true' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: 'nvcr.io' | ||
username: '$oauthtoken' | ||
password: ${{ secrets.NGC_CREDENTIALS }} | ||
|
||
- name: Set up buildx runner | ||
uses: docker/setup-buildx-action@v2 | ||
|
@@ -354,7 +353,7 @@ jobs: | |
context: . | ||
file: ./docker/release/cudaq.ext.Dockerfile | ||
build-args: | | ||
base_image=${{ steps.release_info.outputs.cudaq_image }} | ||
base_image=${{ steps.release_info.outputs.cudaqbase_image }} | ||
assets=${{ steps.release_info.outputs.assets_folder }} | ||
vscode_config=docker/release/config/.vscode | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
|
@@ -366,14 +365,14 @@ jobs: | |
uses: sigstore/[email protected] | ||
|
||
- name: Sign image with GitHub OIDC Token | ||
if: steps.release_info.outputs.ngc_registry == '' | ||
if: steps.release_info.outputs.push_to_ngc != 'true' | ||
env: | ||
DIGEST: ${{ steps.cudaq_build.outputs.digest }} | ||
TAGS: ${{ steps.metadata.outputs.tags }} | ||
run: cosign sign --yes --recursive "${TAGS}@${DIGEST}" | ||
|
||
- name: Sign image with NGC CLI | ||
if: steps.release_info.outputs.ngc_registry | ||
if: steps.release_info.outputs.push_to_ngc == 'true' | ||
env: | ||
TAGS: ${{ steps.metadata.outputs.tags }} | ||
NGC_CLI_API_KEY: ${{ secrets.NGC_CREDENTIALS }} | ||
|
@@ -390,62 +389,15 @@ jobs: | |
echo "Signing ${TAGS}" | ||
ngc-cli/ngc registry image publish --source ${TAGS} ${TAGS} --sign | ||
- name: Log in to the container registry | ||
if: vars.registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ vars.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Set up additional deployment | ||
id: copy | ||
if: steps.release_info.outputs.ngc_registry != '' | ||
run: | | ||
echo "FROM ${{ steps.release_info.outputs.image_name }}@${{ steps.cudaq_build.outputs.digest }}" >> ngc.Dockerfile | ||
echo "image_name=${{ steps.release_info.outputs.registry }}/${{ steps.release_info.outputs.image_short_name }}" >> $GITHUB_OUTPUT | ||
- name: Update cuda-quantum metadata | ||
id: updated_metadata | ||
if: steps.copy.outcome != 'skipped' | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ steps.copy.outputs.image_name }} | ||
flavor: latest=false | ||
tags: type=raw,value=${{ steps.release_info.outputs.image_tag }} | ||
labels: | | ||
org.opencontainers.image.title=${{ steps.release_info.outputs.image_title }} | ||
org.opencontainers.image.description=${{ steps.release_info.outputs.image_description }} | ||
- name: Copy cuda-quantum NGC image | ||
id: copy_build | ||
if: steps.copy.outcome != 'skipped' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ngc.Dockerfile | ||
tags: ${{ steps.updated_metadata.outputs.tags }} | ||
labels: ${{ steps.updated_metadata.outputs.labels }} | ||
platforms: ${{ steps.release_info.outputs.platforms }} | ||
push: true | ||
|
||
- name: Sign copy with GitHub OIDC Token | ||
if: steps.copy.outcome != 'skipped' | ||
env: | ||
DIGEST: ${{ steps.copy_build.outputs.digest }} | ||
TAGS: ${{ steps.updated_metadata.outputs.tags }} | ||
run: cosign sign --yes --recursive "${TAGS}@${DIGEST}" | ||
|
||
- name: Update release information | ||
run: | | ||
release_id=${{ steps.release_info.outputs.release_id }} | ||
gh release view $release_id --json body --jq .body > rel_notes.txt | ||
header_length=`cat rel_notes.txt | grep -n "Release notes generated" | cut -d ':' -f 1` | ||
head -n $(($header_length - 1)) rel_notes.txt > new_notes.txt | ||
image_copy=${{ steps.copy.outputs.image_name }} | ||
echo -e "\nImages for ${{ steps.release_info.outputs.platforms }}:\n" >> new_notes.txt | ||
echo "- cuda-quantum (base image): ${{ steps.release_info.outputs.cudaq_image }}" >> new_notes.txt | ||
echo "- cuda-quantum (with hpc components): ${{ steps.release_info.outputs.image_name }}@${{ steps.cudaq_build.outputs.digest }}${image_copy:+ or $image_copy@${{ steps.copy_build.outputs.digest }}}" >> new_notes.txt | ||
echo "- cuda-quantum (base image): ${{ steps.release_info.outputs.cudaqbase_image }}" >> new_notes.txt | ||
echo "- cuda-quantum (with hpc components): ${{ steps.release_info.outputs.image_name }}@${{ steps.cudaq_build.outputs.digest }}" >> new_notes.txt | ||
echo "- cuda-quantum-dev (for extension development): ${{ steps.release_info.outputs.cudaqdev_image }}" >> new_notes.txt | ||
echo "- cuda-quantum-devdeps (development dependencies only): ${{ steps.release_info.outputs.cudaqdevdeps_image }}" >> new_notes.txt | ||
(echo && tail -n +$header_length rel_notes.txt) >> new_notes.txt | ||
|
@@ -459,8 +411,7 @@ jobs: | |
matrix-step-name: docker_images | ||
matrix-key: ${{ matrix.info_file }} | ||
outputs: | | ||
image_hash: ${{ format('{0}/{1}@{2}', steps.release_info.outputs.registry, steps.release_info.outputs.image_short_name, steps.copy_build.outputs.digest || steps.cudaq_build.outputs.digest) }} | ||
ngc_image_hash: ${{ steps.release_info.outputs.ngc_registry && format('{0}/{1}@{2}', steps.release_info.outputs.ngc_registry, steps.release_info.outputs.image_short_name, steps.cudaq_build.outputs.digest) || '' }} | ||
image_hash: ${{ steps.release_info.outputs.image_name }}@${{ steps.cudaq_build.outputs.digest }} | ||
cudaq_wheels: | ||
name: CUDA Quantum Python wheels | ||
|
@@ -617,26 +568,32 @@ jobs: | |
- name: Basic validation (GPU backends) | ||
run: | | ||
set +e # Allow script to keep going through errors | ||
# Skip some tests (multi-controlled gates) for the MPS backend (https://github.com/NVIDIA/cuda-quantum/issues/884) | ||
mps_skipped_tests=(/home/cudaq/examples/cpp/algorithms/grover.cpp /home/cudaq/examples/cpp/basics/multi_controlled_operations.cpp /home/cudaq/examples/cpp/other/builder/builder.cpp /home/cudaq/examples/cpp/algorithms/amplitude_estimation.cpp) | ||
for file in `ls $CUDA_QUANTUM_PATH/targets/*.config`; do | ||
if [ -n "$(cat $file | grep "GPU_REQUIREMENTS")" ]; then | ||
target=`basename $file | cut -d "." -f 1` | ||
echo "## Execute on $target target" >> $GITHUB_STEP_SUMMARY | ||
for ex in `find /home/cudaq/examples -name '*.cpp' -not -path '*/providers/*'`; do | ||
filename=$(basename -- "$ex") | ||
nvq++ $ex --target $target | ||
status=$? | ||
if [ $status -eq 0 ]; then | ||
./a.out | ||
if [[ " ${mps_skipped_tests[*]} " =~ " ${ex} " ]] && [[ "$target" = "tensornet-mps" ]] ; then | ||
echo ":white_flag: Issue: https://github.com/NVIDIA/cuda-quantum/issues/884. Test skipped." >> $GITHUB_STEP_SUMMARY | ||
else | ||
filename=$(basename -- "$ex") | ||
nvq++ $ex --target $target | ||
status=$? | ||
if [ $status -eq 0 ]; then | ||
echo ":white_check_mark: Successfully ran $filename." >> $GITHUB_STEP_SUMMARY | ||
./a.out | ||
status=$? | ||
if [ $status -eq 0 ]; then | ||
echo ":white_check_mark: Successfully ran $filename." >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo ":x: Failed to execute $filename." >> $GITHUB_STEP_SUMMARY | ||
status_sum=$((status_sum+1)) | ||
fi | ||
else | ||
echo ":x: Failed to execute $filename." >> $GITHUB_STEP_SUMMARY | ||
echo ":x: Compilation failed for $filename." >> $GITHUB_STEP_SUMMARY | ||
status_sum=$((status_sum+1)) | ||
fi | ||
else | ||
echo ":x: Compilation failed for $filename." >> $GITHUB_STEP_SUMMARY | ||
status_sum=$((status_sum+1)) | ||
fi | ||
done | ||
fi | ||
|
This file contains 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
Oops, something went wrong.