Skip to content

Commit 9c0ad27

Browse files
Bump Docker's Lightning version & add Docker build workflow. (#593)
* Bump Docker's Lightning version & add Docker build workflow. * Auto update version * Mod pull_request triggers. * No sudo. * run on ubuntu-22.04 * Put back sudo. * Install wget. * Build lightning-qubit only. * apt-get -y * Fix LIGHTNING_VERSION * test and push * Use docker actions * Fix l_version * Add dockerfile path * Add test. * ubuntu-latest * Fix cmake/support_kokkos.cmake for kokkos-cuda. * Remove test which does not test much. * Revert triggers * Auto update version * trigger ci * save disk with no-cache=true * commet pull_req trigger. * Use GHA cache. * Do not test. * Fix trig. * Fix trig. * Revert trigs. * runs-on: * revert triggers * Add latest tag. * push: true --------- Co-authored-by: Dev version update bot <github-actions[bot]@users.noreply.github.com>
1 parent 2143239 commit 9c0ad27

File tree

5 files changed

+89
-6
lines changed

5 files changed

+89
-6
lines changed

.github/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020
### Bug fixes
2121

22+
* Fix `lightning-kokkos-cuda` Docker build and add CI workflow to build images and push to Docker Hub.
23+
[(#593)](https://github.com/PennyLaneAI/pennylane-lightning/pull/593)
24+
2225
### Contributors
2326

2427
This release contains contributions from (in alphabetical order):
2528

26-
Amintor Dusko, Lee J. O'Riordan, Shuli Shu
29+
Amintor Dusko, Vincent Michaud-Rioux, Lee J. O'Riordan, Shuli Shu
2730

2831
---
2932

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Docker::Linux::x86_64
2+
3+
# **What it does**: Builds Docker images for Linux (ubuntu-22.04) architecture x86_64 and store it as artifacts.
4+
# **Why we have it**: To build Docker images to be uploaded to Docker Hub.
5+
# **Who does it impact**: Docker images uploaded to Docker Hub provide yet another way to install and use PennyLane + Lightning. It is especially useful on HPC platforms where environments can be difficult to set up.
6+
7+
on:
8+
release:
9+
types: [published]
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: docker_linux_x86_64-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
18+
docker:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
pl_version: ["0.34.0"]
24+
pl_backend: ["lightning-qubit", "lightning-gpu", "lightning-kokkos-openmp", "lightning-kokkos-cuda", "lightning-kokkos-rocm"]
25+
timeout-minutes: 180
26+
name: docker::${{ matrix.os }}::${{ matrix.pl_backend }}::${{ matrix.pl_version }}
27+
runs-on:
28+
group: 'Lightning Additional Runners'
29+
steps:
30+
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Login to Docker Hub
38+
uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: Build and export to Docker
44+
uses: docker/build-push-action@v5
45+
with:
46+
load: true
47+
push: false
48+
context: .
49+
file: docker/Dockerfile
50+
tags: test:${{ matrix.pl_version }}-${{ matrix.pl_backend }}
51+
target: wheel-${{ matrix.pl_backend }}
52+
build-args: |
53+
LIGHTNING_VERSION=${{ matrix.pl_version }}
54+
55+
- name: Test
56+
run: |
57+
docker run --rm test:${{ matrix.pl_version }}-${{ matrix.pl_backend }}
58+
59+
- name: Build and push
60+
uses: docker/build-push-action@v5
61+
with:
62+
push: true
63+
context: .
64+
file: docker/Dockerfile
65+
tags: pennylaneai/pennylane:${{ matrix.pl_version }}-${{ matrix.pl_backend }}
66+
target: wheel-${{ matrix.pl_backend }}
67+
build-args: |
68+
LIGHTNING_VERSION=${{ matrix.pl_version }}
69+
70+
- name: Build and push
71+
uses: docker/build-push-action@v5
72+
with:
73+
push: true
74+
context: .
75+
file: docker/Dockerfile
76+
tags: pennylaneai/pennylane:latest-${{ matrix.pl_backend }}
77+
target: wheel-${{ matrix.pl_backend }}
78+
build-args: |
79+
LIGHTNING_VERSION=${{ matrix.pl_version }}

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ endif
138138
ifdef version
139139
VERSION := $(version)
140140
else
141-
VERSION := 0.33.1
141+
VERSION := 0.34.0
142142
endif
143143
docker-build:
144144
docker build -f docker/Dockerfile --tag=pennylaneai/pennylane:$(VERSION)-$(TARGET) --target wheel-$(TARGET) --build-arg='LIGHTNING_VERSION=$(VERSION)' .

docker/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ARG AMD_ARCH=AMD_GFX90A
2020
ARG CUDA_ARCH=AMPERE80
2121
ARG CUDA_INSTALLER=https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run
2222
ARG GCC_VERSION=11
23-
ARG KOKKOS_VERSION=4.1.00
24-
ARG LIGHTNING_VERSION=0.33.1
23+
ARG KOKKOS_VERSION=4.2.00
24+
ARG LIGHTNING_VERSION=0.34.0
2525
ARG ROCM_INSTALLER=https://repo.radeon.com/amdgpu-install/5.7/ubuntu/jammy/amdgpu-install_5.7.50700-1_all.deb
2626
RUN apt-get update \
2727
&& apt-get install --no-install-recommends -y \
@@ -137,7 +137,7 @@ FROM base-build-cuda as build-kokkos-cuda
137137
WORKDIR /opt/kokkos-${KOKKOS_VERSION}
138138
# RUN wget --progress=dot:giga https://github.com/kokkos/kokkos/archive/refs/tags/${KOKKOS_VERSION}.tar.gz
139139
# RUN tar -zxf ${KOKKOS_VERSION}.tar.gz && mv /opt/kokkos-${KOKKOS_VERSION}/kokkos-${KOKKOS_VERSION}/* /opt/kokkos-${KOKKOS_VERSION}
140-
RUN git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git /opt/kokkos-${KOKKOS_VERSION}
140+
RUN git clone --branch lightning https://github.com/vincentmr/kokkos.git /opt/kokkos-${KOKKOS_VERSION}
141141
RUN cmake -S /opt/kokkos-${KOKKOS_VERSION} -B /opt/kokkos-${KOKKOS_VERSION}/build \
142142
-G Ninja \
143143
-DCMAKE_BUILD_TYPE=Release \
@@ -161,6 +161,7 @@ WORKDIR /opt/pennylane-lightning
161161
COPY --from=build-kokkos-cuda /opt/kokkos /opt/kokkos
162162
ENV CMAKE_PREFIX_PATH=/opt/kokkos:$CMAKE_PREFIX_PATH
163163
RUN pip uninstall -y pennylane-lightning
164+
RUN echo >> cmake/support_kokkos.cmake && echo "find_package(CUDAToolkit REQUIRED)" >> cmake/support_kokkos.cmake
164165
RUN PL_BACKEND=lightning_kokkos python setup.py build_ext
165166
RUN PL_BACKEND=lightning_kokkos python setup.py bdist_wheel
166167

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.35.0-dev2"
19+
__version__ = "0.35.0-dev3"

0 commit comments

Comments
 (0)