|
| 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 }} |
0 commit comments