From c59ed3938aee9f4239132a02376f8248e59bf25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl?= Date: Fri, 10 Mar 2023 13:46:58 +0100 Subject: [PATCH] Add a light qiskit image and a full qiskit image (#25) --- .github/workflows/docker-image.yml | 53 +++++++++----------- .github/workflows/docker-tag.yml | 75 +++++++++++++++++----------- Dockerfile | 2 +- README.md | 10 ++-- build/qiskit-full.sh | 9 ++++ build/{qiskit.sh => qiskit-light.sh} | 1 - 6 files changed, 85 insertions(+), 65 deletions(-) create mode 100755 build/qiskit-full.sh rename build/{qiskit.sh => qiskit-light.sh} (72%) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 1890bb9..9a2c835 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -9,54 +9,49 @@ on: jobs: build_qiskit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + - name: Build the Docker qiskit-light + run: docker build --build-arg quantum_env=qiskit-light.sh . --file Dockerfile --tag quantum_lab_qiskit:main - runs-on: ubuntu-18.04 - + build_qiskit-full: + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - - name: Build the Docker qiskit - run: docker build --build-arg quantum_env=qiskit.sh . --file Dockerfile --tag quantum_lab_qiskit:main + - name: Build the Docker qiskit-light + run: docker build --build-arg quantum_env=qiskit-full.sh . --file Dockerfile --tag quantum_lab_qiskit-full:main build_qml: - - runs-on: ubuntu-18.04 - + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Build the Docker qml run: docker build --build-arg quantum_env=qml.sh . --file Dockerfile --tag quantum_lab_qml:main - build_qsharp: - - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v2 - - name: Build the Docker Q# - run: docker build --build-arg quantum_env=qsharp.sh . --file Dockerfile --tag quantum_lab_qsharp:main +# build_qsharp: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v2 +# - name: Build the Docker Q# +# run: docker build --build-arg quantum_env=qsharp.sh . --file Dockerfile --tag quantum_lab_qsharp:main - build_simulaqron: - - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v2 - - name: Build the Docker SimulaQron - run: docker build --build-arg quantum_env=simulaqron.sh . --file Dockerfile --tag quantum_lab_simulaqron:main +# build_simulaqron: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v2 +# - name: Build the Docker SimulaQron +# run: docker build --build-arg quantum_env=simulaqron.sh . --file Dockerfile --tag quantum_lab_simulaqron:main build_myqlm: - - runs-on: ubuntu-18.04 - + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Build the Docker myQLM run: docker build --build-arg quantum_env=myqlm.sh . --file Dockerfile --tag quantum_lab_myqlm:main build_cirq: - - runs-on: ubuntu-18.04 - + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Build the Docker Cirq diff --git a/.github/workflows/docker-tag.yml b/.github/workflows/docker-tag.yml index 4330157..a8c8191 100644 --- a/.github/workflows/docker-tag.yml +++ b/.github/workflows/docker-tag.yml @@ -7,7 +7,7 @@ on: jobs: build_qiskit: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Set env @@ -16,58 +16,73 @@ jobs: env: DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} run: | - docker build --build-arg quantum_env=qiskit.sh . --file Dockerfile --tag mickahell/quantum_lab_qiskit:${RELEASE_VERSION} + docker build --build-arg quantum_env=qiskit-light.sh . --file Dockerfile --tag mickahell/quantum_lab_qiskit:${RELEASE_VERSION} docker tag mickahell/quantum_lab_qiskit:${RELEASE_VERSION} mickahell/quantum_lab_qiskit:latest docker login --username=mickahell --password=${DOCKERHUB_PASS} docker push mickahell/quantum_lab_qiskit --all-tags - build_qml: - runs-on: ubuntu-18.04 + build_qiskit-full: + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Build qml and push to Docker Hub + - name: Build qiskit-full and push to Docker Hub env: DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} run: | - docker build --build-arg quantum_env=qml.sh . --file Dockerfile --tag mickahell/quantum_lab_qml:${RELEASE_VERSION} - docker tag mickahell/quantum_lab_qml:${RELEASE_VERSION} mickahell/quantum_lab_qml:latest + docker build --build-arg quantum_env=qiskit-full.sh . --file Dockerfile --tag mickahell/quantum_lab_qiskit-full:${RELEASE_VERSION} + docker tag mickahell/quantum_lab_qiskit-full:${RELEASE_VERSION} mickahell/quantum_lab_qiskit-full:latest docker login --username=mickahell --password=${DOCKERHUB_PASS} - docker push mickahell/quantum_lab_qml --all-tags + docker push mickahell/quantum_lab_qiskit-full --all-tags - build_qsharp: - runs-on: ubuntu-18.04 + build_qml: + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Build Q# and push to Docker Hub + - name: Build qml and push to Docker Hub env: DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} run: | - docker build --build-arg quantum_env=qsharp.sh . --file Dockerfile --tag mickahell/quantum_lab_qsharp:${RELEASE_VERSION} - docker tag mickahell/quantum_lab_qsharp:${RELEASE_VERSION} mickahell/quantum_lab_qsharp:latest + docker build --build-arg quantum_env=qml.sh . --file Dockerfile --tag mickahell/quantum_lab_qml:${RELEASE_VERSION} + docker tag mickahell/quantum_lab_qml:${RELEASE_VERSION} mickahell/quantum_lab_qml:latest docker login --username=mickahell --password=${DOCKERHUB_PASS} - docker push mickahell/quantum_lab_qsharp --all-tags + docker push mickahell/quantum_lab_qml --all-tags - build_simulaqron: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Build SimulaQron and push to Docker Hub - env: - DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} - run: | - docker build --build-arg quantum_env=simulaqron.sh . --file Dockerfile --tag mickahell/quantum_lab_simulaqron:${RELEASE_VERSION} - docker tag mickahell/quantum_lab_simulaqron:${RELEASE_VERSION} mickahell/quantum_lab_simulaqron:latest - docker login --username=mickahell --password=${DOCKERHUB_PASS} - docker push mickahell/quantum_lab_simulaqron --all-tags +# build_qsharp: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v2 +# - name: Set env +# run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV +# - name: Build Q# and push to Docker Hub +# env: +# DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} +# run: | +# docker build --build-arg quantum_env=qsharp.sh . --file Dockerfile --tag mickahell/quantum_lab_qsharp:${RELEASE_VERSION} +# docker tag mickahell/quantum_lab_qsharp:${RELEASE_VERSION} mickahell/quantum_lab_qsharp:latest +# docker login --username=mickahell --password=${DOCKERHUB_PASS} +# docker push mickahell/quantum_lab_qsharp --all-tags + +# build_simulaqron: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v2 +# - name: Set env +# run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV +# - name: Build SimulaQron and push to Docker Hub +# env: +# DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }} +# run: | +# docker build --build-arg quantum_env=simulaqron.sh . --file Dockerfile --tag mickahell/quantum_lab_simulaqron:${RELEASE_VERSION} +# docker tag mickahell/quantum_lab_simulaqron:${RELEASE_VERSION} mickahell/quantum_lab_simulaqron:latest +# docker login --username=mickahell --password=${DOCKERHUB_PASS} +# docker push mickahell/quantum_lab_simulaqron --all-tags build_myqlm: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Set env @@ -82,7 +97,7 @@ jobs: docker push mickahell/quantum_lab_myqlm --all-tags build_cirq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Set env diff --git a/Dockerfile b/Dockerfile index b3226a5..cc8c5e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:22.04 # Choose your quantum env ARG quantum_env -#ARG quantum_env=qiskit.sh +#ARG quantum_env=qiskit-light.sh #ARG quantum_env=qml.sh #ARG quantum_env=qsharp.sh #ARG quantum_env=simulaqron.sh diff --git a/README.md b/README.md index f8d4d69..501f851 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,8 @@ - Python version install : [3.10](https://www.python.org/downloads/release/python-3104/) ## Getting started -- Build the image, run the following command line :
docker build --build-arg quantum_env=qiskit.sh -t quantum_lab .
- - You can replace `qiskit.sh` with the following one `qml.sh`, `qsharp.sh`, `simulaqron.sh`, `myqlm.sh` or `cirq.sh` +- Build the image, run the following command line :
docker build --build-arg quantum_env=qiskit-light.sh -t quantum_lab .
+ - You can replace `qiskit-light.sh` with the following one `qiskit-full.sh`, `qml.sh`, `qsharp.sh`, `simulaqron.sh`, `myqlm.sh` or `cirq.sh` - To create a new containeur and go inside, run the script : `./start.sh` ### Environment @@ -37,8 +37,10 @@ - 6 libs setup are available, one for installating [PennyLane](https://pennylane.ai), one for using [Qiskit](https://qiskit.org), one for using [Q#](https://azure.microsoft.com/fr-fr/resources/development-kit/quantum-computing/), one for [SimulaQron](https://softwarequtech.github.io/SimulaQron/html/GettingStarted.html), one for [myQLM](https://atos.net/en/lp/myqlm) and one for [Cirq](https://quantumai.google/cirq). - `qml.sh` - Libs : ```autograd, pennylane, pennylane-sf, pennylane-qiskit``` - - `qiskit.sh` - - Libs : ```qiskit, qiskit[visualization], qiskit-nature``` + - `qiskit-light.sh` + - Libs : ```qiskit, qiskit[visualization]``` + - `qiskit-full.sh` + - Libs : ```qiskit, qiskit[visualization], qiskit[nature], qiskit[finance], qiskit[optimization], qiskit[machine-learning]``` - `qsharp.sh` - Libs : ```qsharp, iqsharp``` - `simulaqron.sh` diff --git a/build/qiskit-full.sh b/build/qiskit-full.sh new file mode 100755 index 0000000..04ee608 --- /dev/null +++ b/build/qiskit-full.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +pip3 install qiskit +pip3 install 'qiskit[visualization]' + +pip3 install qiskit[nature] +pip3 install qiskit[finance] +pip3 install qiskit[optimization] +pip3 install qiskit[machine-learning] diff --git a/build/qiskit.sh b/build/qiskit-light.sh similarity index 72% rename from build/qiskit.sh rename to build/qiskit-light.sh index c3be6a1..c5610b9 100755 --- a/build/qiskit.sh +++ b/build/qiskit-light.sh @@ -2,4 +2,3 @@ pip3 install qiskit pip3 install 'qiskit[visualization]' -pip3 install qiskit-nature