8181 if [ "${name%_publishing}" != "$name" ]; then
8282 download "$url" "$name"
8383 platforms=`cat "$name.txt" | egrep -o 'platforms?: \S*' | cut -d ' ' -f 2`
84- image_hash=`cat "$name.txt" | grep -o -e "cuda-quantum-dev-image: \S*" -e "cuda-quantum-installer -image: \S*" -e "cuda-quantum-wheeldeps-image: \S*" | cut -d ' ' -f 2`
84+ image_hash=`cat "$name.txt" | grep -o -e "cuda-quantum-dev-image: \S*" -e "cuda-quantum-assets -image: \S*" -e "cuda-quantum-wheeldeps-image: \S*" | cut -d ' ' -f 2`
8585 if [ -n "$(echo $platforms | grep ',')" ]; then runner=linux-amd64-cpu8
8686 else runner=$(echo $platforms | tr / -)-cpu8
8787 fi
@@ -178,7 +178,7 @@ jobs:
178178 done
179179
180180 for file in ${{ join(fromJson(steps.artifacts.outputs.installers).info_files, ' ') }}; do
181- create_assets $file cuda-quantum-installer -image cuda-quantum-installer '${{ steps.artifacts.outputs.installers }}'
181+ create_assets $file cuda-quantum-assets -image cuda-quantum-assets '${{ steps.artifacts.outputs.installers }}'
182182 done
183183
184184 - name : Wait for assets
@@ -253,7 +253,6 @@ jobs:
253253 for file in ${{ join(fromJson(steps.artifacts.outputs.installers).info_files, ' ') }}; do
254254 download_assets $file '${{ steps.artifacts.outputs.installers }}'
255255 done
256-
257256 env :
258257 GH_TOKEN : ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
259258
@@ -290,7 +289,19 @@ jobs:
290289 uses : actions/checkout@v3
291290 with :
292291 ref : ${{ needs.assets.outputs.github_commit }}
293- token : ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
292+
293+ - name : Log in to DockerHub
294+ uses : docker/login-action@v3
295+ with :
296+ username : ${{ secrets.DOCKERHUB_USERNAME }}
297+ password : ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
298+
299+ - name : Log in to GitHub CR
300+ uses : docker/login-action@v3
301+ with :
302+ registry : ghcr.io
303+ username : ${{ github.actor }}
304+ password : ${{ github.token }}
294305
295306 - name : Load docker assets
296307 uses : actions/download-artifact@v4
@@ -339,12 +350,6 @@ jobs:
339350 env :
340351 GH_TOKEN : ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
341352
342- - name : Log in to DockerHub
343- uses : docker/login-action@v3
344- with :
345- username : ${{ secrets.DOCKERHUB_USERNAME }}
346- password : ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
347-
348353 - name : Log in to default registry
349354 if : steps.release_info.outputs.push_to_ngc != 'true'
350355 uses : docker/login-action@v3
@@ -443,6 +448,111 @@ jobs:
443448 outputs : |
444449 image_hash: ${{ steps.release_info.outputs.image_name }}@${{ steps.cudaq_build.outputs.digest }}
445450
451+ cudaq_installer :
452+ name : CUDA Quantum installer
453+ if : ${{ toJson(fromJson(needs.assets.outputs.installers).info_files) != '[]' }}
454+ needs : assets
455+ runs-on : ubuntu-latest
456+ permissions :
457+ contents : read
458+ packages : write
459+ id-token : write
460+
461+ environment :
462+ name : ghcr-deployment
463+ url : ${{ vars.deployment_url }}
464+
465+ strategy :
466+ matrix :
467+ info_file : ${{ fromJson(needs.assets.outputs.installers).info_files }}
468+ fail-fast : false
469+
470+ steps :
471+ - name : Checkout repository
472+ uses : actions/checkout@v3
473+ with :
474+ ref : ${{ needs.assets.outputs.github_commit }}
475+
476+ - name : Load build assets
477+ uses : actions/download-artifact@v4
478+ with :
479+ name : ${{ needs.assets.outputs.retrieved_assets }}
480+ path : /tmp/assets
481+
482+ - name : Retrieve assets
483+ id : release_info
484+ run : |
485+ release_id=${{ fromJson(needs.assets.outputs.installers)[format('{0}', matrix.info_file)].release_id }}
486+ assets_folder=assets && mkdir "$assets_folder" && cd "$assets_folder"
487+ cp -r /tmp/assets/${{ matrix.info_file }}/. "$(pwd)"
488+
489+ build_info=${{ matrix.info_file }}*
490+ platform=`cat $build_info | grep -o 'platform: \S*' | cut -d ' ' -f 2`
491+ platform_id=`echo $platform | sed 's/linux\///g' | tr -d ' '`
492+ platform_arch=`([ "$platform_id" == "amd64" ] && echo x86_64) || ([ "$platform_id" == "arm64" ] && echo aarch64) || echo any`
493+ assets_image=`cat $build_info | grep -o 'cuda-quantum-assets-image: \S*' | cut -d ' ' -f 2`
494+ platform_base_image=`cat $build_info | grep -o 'platform-base-image: \S*' | cut -d ' ' -f 2`
495+ openmpi_buildcache=`cat $build_info | grep -o 'openmpi-build-cache: \S*' | cut -d ' ' -f 2`
496+ for file in `ls *zip`; do unzip "$file" && rm "$file"; done && cd -
497+
498+ echo "release_id=$release_id" >> $GITHUB_OUTPUT
499+ echo "platform=$platform" >> $GITHUB_OUTPUT
500+ echo "platform_arch=$platform_arch" >> $GITHUB_OUTPUT
501+ echo "assets_image=$assets_image" >> $GITHUB_OUTPUT
502+ echo "platform_base_image=$platform_base_image" >> $GITHUB_OUTPUT
503+ echo "openmpi_buildcache=$openmpi_buildcache" >> $GITHUB_OUTPUT
504+ env :
505+ GH_TOKEN : ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
506+
507+ - name : Log in to DockerHub
508+ uses : docker/login-action@v3
509+ with :
510+ username : ${{ secrets.DOCKERHUB_USERNAME }}
511+ password : ${{ secrets.DOCKERHUB_READONLY_TOKEN }}
512+
513+ - name : Log in to default registry
514+ if : steps.release_info.outputs.push_to_ngc != 'true'
515+ uses : docker/login-action@v3
516+ with :
517+ registry : ${{ vars.registry }}
518+ username : ${{ github.actor }}
519+ password : ${{ github.token }}
520+
521+ - name : Set up buildx runner
522+ uses : docker/setup-buildx-action@v2
523+
524+ - name : Build installer
525+ uses : docker/build-push-action@v5
526+ with :
527+ context : .
528+ file : ./docker/release/installer.Dockerfile
529+ build-args : |
530+ base_image=${{ steps.release_info.outputs.assets_image }}
531+ additional_components=assets
532+ platforms : ${{ steps.release_info.outputs.platform }}
533+ outputs : type=local,dest=/tmp/install
534+
535+ - name : Update release information
536+ run : |
537+ release_id=${{ steps.release_info.outputs.release_id }}
538+ gh release view $release_id --json body --jq .body > rel_notes.txt
539+ header_length=`cat rel_notes.txt | grep -n "Release notes generated" | cut -d ':' -f 1`
540+ head -n $(($header_length - 1)) rel_notes.txt > new_notes.txt
541+ echo -e "\nImage to create ${{ steps.release_info.outputs.platform }} installer:\n" >> new_notes.txt
542+ echo "- cuda-quantum-assets: ${{ steps.release_info.outputs.assets_image }}" >> new_notes.txt
543+ (echo && tail -n +$header_length rel_notes.txt) >> new_notes.txt
544+ gh release edit $release_id -R ${{ github.repository }} --notes-file new_notes.txt
545+ env :
546+ GH_TOKEN : ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
547+
548+ - name : Upload installer
549+ uses : actions/upload-artifact@v4
550+ with :
551+ name : ${{ steps.release_info.outputs.platform_arch }}-installer
552+ path : /tmp/install
553+ retention-days : 1
554+ if-no-files-found : error
555+
446556 cudaq_wheels :
447557 name : CUDA Quantum Python wheels
448558 if : ${{ toJson(fromJson(needs.assets.outputs.python_wheels).info_files) != '[]' }}
@@ -467,7 +577,6 @@ jobs:
467577 uses : actions/checkout@v3
468578 with :
469579 ref : ${{ needs.assets.outputs.github_commit }}
470- token : ${{ secrets.REPO_BOT_ACCESS_TOKEN }}
471580
472581 - name : Load wheel assets
473582 uses : actions/download-artifact@v4
@@ -528,7 +637,7 @@ jobs:
528637 - name : Upload wheels
529638 uses : actions/upload-artifact@v4
530639 with :
531- name : ${{ steps.release_info.outputs.platform_arch }}-wheels
640+ name : ${{ steps.release_info.outputs.platform_arch }}-py${{ matrix.python_version }}- wheels
532641 path : /tmp/wheels
533642 retention-days : 1
534643 if-no-files-found : error
@@ -561,7 +670,7 @@ jobs:
561670
562671 config :
563672 name : Configure validation
564- needs : [cudaq_hpc, cudaq_wheels]
673+ needs : [cudaq_hpc, cudaq_installer, cudaq_wheels]
565674 runs-on : ubuntu-latest
566675
567676 outputs :
@@ -580,11 +689,67 @@ jobs:
580689 images=`echo '${{ steps.read_json.outputs.result }}' | jq '[.image_hash[] | select(. != "")]'`
581690 echo "docker_images=$(echo $images)" >> $GITHUB_OUTPUT
582691
583- validation :
584- name : Validation
585- needs : [assets, config ]
692+ installer_validation :
693+ name : Installer validation
694+ needs : [assets, cudaq_installer ]
586695 runs-on : linux-amd64-gpu-v100-latest-1
587696
697+ container :
698+ image : redhat/ubi8:8.0
699+ options : --user root
700+ env :
701+ NVIDIA_VISIBLE_DEVICES : ${{ env.NVIDIA_VISIBLE_DEVICES }}
702+ TERM : xterm
703+
704+ steps :
705+ - name : Checkout repository
706+ uses : actions/checkout@v3
707+ with :
708+ ref : ${{ needs.assets.outputs.github_commit }}
709+
710+ - name : Load installer
711+ uses : actions/download-artifact@v4
712+ with :
713+ name : x86_64-installer
714+ path : /tmp/install
715+
716+ - name : Install runtime dependencies
717+ run : |
718+ dnf install -y --nobest --setopt=install_weak_deps=False \
719+ 'dnf-command(config-manager)' gcc-toolset-12
720+ enable_script=`find / -path '*gcc*' -path '*12*' -name enable`
721+ . "$enable_script"
722+ . scripts/configure_build.sh install-cudart
723+
724+ # TODO: Add nvidia-mgpu to the arguments for validate_container.sh
725+ # (Currently missing an rpath, since it is not finding libcustatevec.so.1)
726+ - name : Install and run sanity checks
727+ shell : bash
728+ run : |
729+ chmod +x /tmp/install/install_cuda_quantum.*
730+ /tmp/install/install_cuda_quantum.* --accept
731+ rm -rf examples && mv docs/sphinx/examples examples && rm -rf examples/python
732+ bash -l scripts/validate_container.sh nvidia tensornet | tee /tmp/validation.out
733+
734+ - name : Create summary
735+ if : always() && !cancelled()
736+ run : |
737+ if [ -f /tmp/validation.out ]; then
738+ echo "## Validation" >> $GITHUB_STEP_SUMMARY
739+ echo "The validation of the CUDA Quantum installation produced the following output:" >> $GITHUB_STEP_SUMMARY
740+ echo '```text' >> $GITHUB_STEP_SUMMARY
741+ cat /tmp/validation.out >> $GITHUB_STEP_SUMMARY
742+ echo '```' >> $GITHUB_STEP_SUMMARY
743+ fi
744+
745+ image_validation :
746+ name : Docker image validation
747+ needs : config
748+ runs-on : linux-amd64-gpu-v100-latest-1
749+ permissions :
750+ contents : read
751+ packages : read
752+
588753 strategy :
589754 matrix :
590755 image_hash : ${{ fromJson(needs.config.outputs.docker_images) }}
@@ -671,7 +836,7 @@ jobs:
671836
672837 create_release :
673838 name : CUDA Quantum Release
674- needs : [assets, cudaq_hpc, cudaq_wheels, validation ]
839+ needs : [assets, cudaq_hpc, cudaq_wheels, image_validation ]
675840 if : needs.assets.outputs.release_title
676841 runs-on : ubuntu-latest
677842
@@ -721,7 +886,7 @@ jobs:
721886
722887 clean_up :
723888 name : Clean up
724- needs : [assets, cudaq_hpc, cudaq_wheels, create_release, validation ]
889+ needs : [assets, cudaq_hpc, cudaq_wheels, create_release, image_validation ]
725890 # Force this job to run even when some of the dependencies above are skipped.
726891 if : always() && !cancelled() && needs.assets.result != 'skipped' && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
727892 runs-on : ubuntu-latest
0 commit comments