Skip to content

Workflow file for this run

name: Build dev image
on:
push:
workflow_dispatch:
inputs:
# FIXME
build_type:
type: choice
required: true
description: 'Build Type (ignored if using artifacts from prior run)'
default: 'Release'
options:
- 'Release'
- 'Debug'
#cudaq_wheels:
# type: choice
# required: true
# description: 'CUDA-Q wheel source (released version from PyPI or Custom built using .cudaq_version in repo)'
# default: 'Custom'
# options:
# - 'Custom'
# - 'PyPI'
#artifacts_from_run:
# type: string
# description: Optional argument to take artifacts from a prior run of this workflow; facilitates rerunning a failed workflow without re-building the artifacts.
# required: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-cudaqx-dev:
name: Build CUDA-QX Dev Image
if: ${{ github.repository == 'NVIDIA/cudaqx' }}
strategy:
matrix:
platform: [amd64, arm64]
fail-fast: false
runs-on: linux-${{ matrix.platform }}-cpu8
steps:
- name: Login to GitHub CR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Get code
uses: actions/checkout@v4
with:
set-safe-directory: true
- name: Get required CUDA-Q version
id: get-cudaq-version
uses: ./.github/actions/get-cudaq-version
- name: Get additional metadata
id: get-cudaq-version-short
run: |
shortref=$(echo "${{ steps.get-cudaq-version.outputs.ref }}"" | head -c8)
commit_date=$(curl -s "https://api.github.com/repos/NVIDIA/cuda-quantum/commits/${{ steps.get-cudaq-version.outputs.ref }}" | jq -r '.commit.committer.date' | cut -dT -f1)
echo "shortref=$shortref" >> $GITHUB_OUTPUT
echo "commit_date=$commit_date" >> $GITHUB_OUTPUT
- 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 dev image
uses: docker/build-push-action@v5
with:
file: ./docker/build_env/cudaqx.dev.Dockerfile
tags: |
ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}
ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}
ghcr.io/nvidia/cudaqx-dev:latest-${{ matrix.platform }}
platforms: linux/${{ matrix.platform }}
push: true