Skip to content

Commit

Permalink
Fix cudaqx-dev publishing issues (NVIDIA#77)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Howe <[email protected]>
  • Loading branch information
bmhowe23 authored Feb 7, 2025
1 parent 7067133 commit 82c75f2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 48 deletions.
59 changes: 13 additions & 46 deletions .github/workflows/build_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,16 @@ jobs:
echo "IMAGE_EXISTS=false" >> $GITHUB_OUTPUT
fi
- name: Set up context for buildx
- name: Build and push
if: ${{ inputs.force_rebuild || steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
run: |
docker context create builder_context
TAGS="-t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}"
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-${{ matrix.platform }}"
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:latest-${{ matrix.platform }}"
docker build $TAGS -f docker/build_env/cudaqx.dev.Dockerfile .
docker push -a ghcr.io/nvidia/cudaqx-dev
shell: bash --noprofile --norc -euo pipefail {0}

- name: Set up buildx runner
if: ${{ inputs.force_rebuild ||steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
uses: docker/setup-buildx-action@v3
with:
endpoint: builder_context
driver-opts: network=host

- name: Build dev image
if: ${{ inputs.force_rebuild ||steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
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

build-cudaqx-pydev:
name: Build CUDA-QX Python Dev Image
if: ${{ github.repository == 'NVIDIA/cudaqx' }}
Expand Down Expand Up @@ -136,34 +121,16 @@ jobs:
echo "IMAGE_EXISTS=false" >> $GITHUB_OUTPUT
fi
- name: Set up context for buildx
if: ${{ inputs.force_rebuild ||steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
- name: Build and push
if: ${{ inputs.force_rebuild || steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
run: |
docker context create builder_context
TAGS="-t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}"
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}"
TAGS+=" -t ghcr.io/nvidia/cudaqx-dev:latest-py${{ matrix.python }}-${{ matrix.platform }}"
docker build $TAGS -f docker/build_env/cudaqx.dev.Dockerfile .
docker push -a ghcr.io/nvidia/cudaqx-dev
shell: bash --noprofile --norc -euo pipefail {0}

- name: Set up buildx runner
if: ${{ inputs.force_rebuild ||steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
uses: docker/setup-buildx-action@v3
with:
endpoint: builder_context
driver-opts: network=host

- name: Build pydev image
if: ${{ inputs.force_rebuild ||steps.check-image.outputs.IMAGE_EXISTS == 'false' }}
uses: docker/build-push-action@v5
with:
file: ./docker/build_env/cudaqx.wheel.Dockerfile
build-args: |
base_image=ghcr.io/nvidia/cuda-quantum-devdeps:manylinux-${{ matrix.platform }}-cu12.0-gcc11-main
python_version=${{ matrix.python }}
tags: |
ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.commit_date }}-${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}
ghcr.io/nvidia/cudaqx-dev:${{ steps.get-cudaq-version-short.outputs.shortref }}-py${{ matrix.python }}-${{ matrix.platform }}
ghcr.io/nvidia/cudaqx-dev:latest-py${{ matrix.python }}-${{ matrix.platform }}
platforms: linux/${{ matrix.platform }}
push: true

cleanup:
name: Cleanup
needs: [build-cudaqx-dev, build-cudaqx-pydev]
Expand Down
2 changes: 1 addition & 1 deletion docker/build_env/cudaqx.dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM ghcr.io/nvidia/cuda-quantum-devdeps:ext-cu12.0-gcc11-main

LABEL org.opencontainers.image.description="Dev tools for building and testing CUDA-QX libraries"
LABEL org.opencontainers.image.source="https://github.com/NVIDIA/cudaqx"
LABEL org.opencontainers.image.title="cuda-qx-dev"
LABEL org.opencontainers.image.title="cudaqx-dev"
LABEL org.opencontainers.image.url="https://github.com/NVIDIA/cudaqx"

RUN apt-get update && apt-get install -y gfortran libblas-dev jq cuda-nvtx-12-0 \
Expand Down
2 changes: 1 addition & 1 deletion docker/build_env/cudaqx.wheel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ARG python_version=3.10

LABEL org.opencontainers.image.description="Dev tools for building and testing CUDA-QX libraries"
LABEL org.opencontainers.image.source="https://github.com/NVIDIA/cudaqx"
LABEL org.opencontainers.image.title="cuda-qx-dev"
LABEL org.opencontainers.image.title="cudaqx-dev"
LABEL org.opencontainers.image.url="https://github.com/NVIDIA/cudaqx"

RUN dnf install -y jq
Expand Down

0 comments on commit 82c75f2

Please sign in to comment.