Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Docker's Lightning version & add Docker build workflow. #593

Merged
merged 33 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e972977
Bump Docker's Lightning version & add Docker build workflow.
vincentmr Jan 15, 2024
04ef886
Auto update version
github-actions[bot] Jan 15, 2024
fcfbbc3
Mod pull_request triggers.
vincentmr Jan 15, 2024
4132c96
No sudo.
vincentmr Jan 15, 2024
ccbddd5
run on ubuntu-22.04
vincentmr Jan 15, 2024
7c24353
Put back sudo.
vincentmr Jan 15, 2024
6f0a5c2
Install wget.
vincentmr Jan 15, 2024
79dbc1f
Build lightning-qubit only.
vincentmr Jan 15, 2024
c7b2c98
apt-get -y
vincentmr Jan 15, 2024
8a20291
Fix LIGHTNING_VERSION
vincentmr Jan 15, 2024
383b9d0
test and push
vincentmr Jan 15, 2024
19c5365
Use docker actions
vincentmr Jan 15, 2024
14ddf32
Fix l_version
vincentmr Jan 15, 2024
815a88c
Add dockerfile path
vincentmr Jan 15, 2024
7b3aec0
Add test.
vincentmr Jan 15, 2024
03343c2
ubuntu-latest
vincentmr Jan 15, 2024
cbb2975
Fix cmake/support_kokkos.cmake for kokkos-cuda.
vincentmr Jan 15, 2024
0d3b244
Remove test which does not test much.
vincentmr Jan 15, 2024
28646e1
Merge branch 'master' into bugfix/docker034
vincentmr Jan 15, 2024
f203588
Revert triggers
vincentmr Jan 15, 2024
704ee02
Auto update version
github-actions[bot] Jan 15, 2024
8c530cc
trigger ci
vincentmr Jan 15, 2024
485e981
save disk with no-cache=true
vincentmr Jan 16, 2024
ddcb48c
commet pull_req trigger.
vincentmr Jan 16, 2024
486e1a9
Use GHA cache.
vincentmr Jan 16, 2024
3a0cb91
Do not test.
vincentmr Jan 16, 2024
7013d6a
Fix trig.
vincentmr Jan 16, 2024
21fe6ce
Fix trig.
vincentmr Jan 16, 2024
a113e48
Revert trigs.
vincentmr Jan 16, 2024
c5c9e35
runs-on:
vincentmr Jan 16, 2024
647fd75
revert triggers
vincentmr Jan 16, 2024
3eb1577
Add latest tag.
vincentmr Jan 17, 2024
6ee036b
push: true
vincentmr Jan 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@

### Bug fixes

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

### Contributors

This release contains contributions from (in alphabetical order):

Amintor Dusko, Lee J. O'Riordan, Shuli Shu
Amintor Dusko, Vincent Michaud-Rioux, Lee J. O'Riordan, Shuli Shu

---

Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/docker_linux_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Docker::Linux::x86_64

# **What it does**: Builds Docker images for Linux (ubuntu-22.04) architecture x86_64 and store it as artifacts.
# **Why we have it**: To build Docker images to be uploaded to Docker Hub.
# **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.

on:
release:
types: [published]
workflow_dispatch:

concurrency:
group: docker_linux_x86_64-${{ github.ref }}
cancel-in-progress: true

jobs:

docker:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
pl_version: ["0.34.0"]
pl_backend: ["lightning-qubit", "lightning-gpu", "lightning-kokkos-openmp", "lightning-kokkos-cuda", "lightning-kokkos-rocm"]
timeout-minutes: 180
name: docker::${{ matrix.os }}::${{ matrix.pl_backend }}::${{ matrix.pl_version }}
runs-on:
group: 'Lightning Additional Runners'
steps:

- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
load: true
push: false
context: .
file: docker/Dockerfile
tags: test:${{ matrix.pl_version }}-${{ matrix.pl_backend }}
target: wheel-${{ matrix.pl_backend }}
build-args: |
LIGHTNING_VERSION=${{ matrix.pl_version }}

- name: Test
run: |
docker run --rm test:${{ matrix.pl_version }}-${{ matrix.pl_backend }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: docker/Dockerfile
tags: pennylaneai/pennylane:${{ matrix.pl_version }}-${{ matrix.pl_backend }}
target: wheel-${{ matrix.pl_backend }}
build-args: |
LIGHTNING_VERSION=${{ matrix.pl_version }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: docker/Dockerfile
tags: pennylaneai/pennylane:latest-${{ matrix.pl_backend }}
target: wheel-${{ matrix.pl_backend }}
build-args: |
LIGHTNING_VERSION=${{ matrix.pl_version }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ endif
ifdef version
VERSION := $(version)
else
VERSION := 0.33.1
VERSION := 0.34.0
endif
docker-build:
docker build -f docker/Dockerfile --tag=pennylaneai/pennylane:$(VERSION)-$(TARGET) --target wheel-$(TARGET) --build-arg='LIGHTNING_VERSION=$(VERSION)' .
Expand Down
7 changes: 4 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ ARG AMD_ARCH=AMD_GFX90A
ARG CUDA_ARCH=AMPERE80
ARG CUDA_INSTALLER=https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run
ARG GCC_VERSION=11
ARG KOKKOS_VERSION=4.1.00
ARG LIGHTNING_VERSION=0.33.1
ARG KOKKOS_VERSION=4.2.00
ARG LIGHTNING_VERSION=0.34.0
ARG ROCM_INSTALLER=https://repo.radeon.com/amdgpu-install/5.7/ubuntu/jammy/amdgpu-install_5.7.50700-1_all.deb
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
Expand Down Expand Up @@ -137,7 +137,7 @@ FROM base-build-cuda as build-kokkos-cuda
WORKDIR /opt/kokkos-${KOKKOS_VERSION}
# RUN wget --progress=dot:giga https://github.com/kokkos/kokkos/archive/refs/tags/${KOKKOS_VERSION}.tar.gz
# RUN tar -zxf ${KOKKOS_VERSION}.tar.gz && mv /opt/kokkos-${KOKKOS_VERSION}/kokkos-${KOKKOS_VERSION}/* /opt/kokkos-${KOKKOS_VERSION}
RUN git clone --branch fix-rtld-deepbind https://github.com/cz4rs/kokkos.git /opt/kokkos-${KOKKOS_VERSION}
RUN git clone --branch lightning https://github.com/vincentmr/kokkos.git /opt/kokkos-${KOKKOS_VERSION}
RUN cmake -S /opt/kokkos-${KOKKOS_VERSION} -B /opt/kokkos-${KOKKOS_VERSION}/build \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -161,6 +161,7 @@ WORKDIR /opt/pennylane-lightning
COPY --from=build-kokkos-cuda /opt/kokkos /opt/kokkos
ENV CMAKE_PREFIX_PATH=/opt/kokkos:$CMAKE_PREFIX_PATH
RUN pip uninstall -y pennylane-lightning
RUN echo >> cmake/support_kokkos.cmake && echo "find_package(CUDAToolkit REQUIRED)" >> cmake/support_kokkos.cmake
RUN PL_BACKEND=lightning_kokkos python setup.py build_ext
RUN PL_BACKEND=lightning_kokkos python setup.py bdist_wheel

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.35.0-dev2"
__version__ = "0.35.0-dev3"