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

Connect to qat-computer #32

Merged
merged 2 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 2 additions & 44 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,5 @@ jobs:
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

build_qiskit-full:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- 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-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-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-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-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-22.04
steps:
- uses: actions/checkout@v2
- name: Build the Docker Cirq
run: docker build --build-arg quantum_env=cirq.sh . --file Dockerfile --tag quantum_lab_cirq:main
- name: Build the Docker qiskit
run: docker build . --file Dockerfile --tag quantum_lab_qiskit:main
92 changes: 1 addition & 91 deletions .github/workflows/docker-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,97 +17,7 @@ jobs:
env:
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
run: |
docker build --build-arg quantum_env=qiskit-light.sh . --file Dockerfile --tag mickahell/quantum_lab_qiskit:${RELEASE_VERSION}
docker build . --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_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 qiskit-full and push to Docker Hub
env:
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
run: |
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_qiskit-full --all-tags

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 qml 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 login --username=mickahell --password=${DOCKERHUB_PASS}
docker push mickahell/quantum_lab_qml --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-22.04
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build myQLM and push to Docker Hub
env:
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
run: |
docker build --build-arg quantum_env=myqlm.sh . --file Dockerfile --tag mickahell/quantum_lab_myqlm:${RELEASE_VERSION}
docker tag mickahell/quantum_lab_myqlm:${RELEASE_VERSION} mickahell/quantum_lab_myqlm:latest
docker login --username=mickahell --password=${DOCKERHUB_PASS}
docker push mickahell/quantum_lab_myqlm --all-tags

build_cirq:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Build cirq and push to Docker Hub
env:
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_PASS }}
run: |
docker build --build-arg quantum_env=cirq.sh . --file Dockerfile --tag mickahell/quantum_lab_cirq:${RELEASE_VERSION}
docker tag mickahell/quantum_lab_cirq:${RELEASE_VERSION} mickahell/quantum_lab_cirq:latest
docker login --username=mickahell --password=${DOCKERHUB_PASS}
docker push mickahell/quantum_lab_cirq --all-tags
27 changes: 9 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
FROM ubuntu:22.04

# Choose your quantum env
ARG quantum_env
#ARG quantum_env=qiskit-light.sh
#ARG quantum_env=qml.sh
#ARG quantum_env=qsharp.sh
#ARG quantum_env=simulaqron.sh
#ARG quantum_env=myqlm.sh
#ARG quantum_env=cirq.sh
FROM mickahell/qatcomputer-full:latest

# Var for labels
ARG GITHUB_ACTOR
Expand All @@ -29,22 +20,22 @@ LABEL org.opencontainers.image.title="Quantum Lab" \

# OS requirements
RUN apt-get update -yq \
&& apt-get install python3-pip -y \
&& apt-get install python3-tk -y \
&& apt-get install vim -y \
&& apt-get install wget -y \
&& apt-get clean -y
&& apt-get install python3-tk -yq \
&& apt-get dist-upgrade -yq \
&& apt-get clean -yq

# Add script & data
ADD build/* /opt/quantum_lab/build/
ADD data/ /opt/quantum_lab/data/
ADD start_jupyter.sh /opt/quantum_lab/

# General & env requirements
RUN pip3 install --upgrade pip setuptools
RUN pip3 install -r /opt/quantum_lab/build/requirements.txt
RUN /opt/quantum_lab/build/${quantum_env}
RUN pip install --upgrade pip setuptools
RUN pip install -r /opt/quantum_lab/build/requirements.txt

WORKDIR /opt/quantum_lab/data
VOLUME /opt/quantum_lab/data/share

EXPOSE 8888

CMD /bin/bash
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/mickahell/quantum_lab)](https://github.com/mickahell/quantum_lab/releases)

[![Docker Pulls](https://img.shields.io/docker/pulls/mickahell/quantum_lab_qiskit?label=Quantum%20Lab%20Qiskit&style=for-the-badge)](https://hub.docker.com/r/mickahell/quantum_lab_qiskit)

__Those image are now depreciated, please use the Qiskit one just above.__
[![Docker Pulls](https://img.shields.io/docker/pulls/mickahell/quantum_lab_qiskit-full?label=Quantum%20Lab%20Qiskit-full&style=for-the-badge)](https://hub.docker.com/r/mickahell/quantum_lab_qiskit-full)
[![Docker Pulls](https://img.shields.io/docker/pulls/mickahell/quantum_lab_qml?label=Quantum%20Lab%20QML&style=for-the-badge)](https://hub.docker.com/r/mickahell/quantum_lab_qml)
[![Docker Pulls](https://img.shields.io/docker/pulls/mickahell/quantum_lab_qsharp?label=Quantum%20Lab%20Q%23&style=for-the-badge)](https://hub.docker.com/r/mickahell/quantum_lab_qsharp)
Expand All @@ -34,26 +36,28 @@
- To create a new containeur and go inside, run the script : `./start.sh`

### Environment
- Libs common for every env : ```networkx, numpy, matplotlib, notebook, pandas, scipy, tk, vim```
- 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-light.sh`
- Libs : ```qiskit, qiskit-aer, qiskit[visualization]```
- `qiskit-full.sh`
- Libs : ```qiskit, qiskit-aer, qiskit[visualization], qiskit-nature, qiskit-finance, qiskit-optimization, qiskit-machine-learning```
- `qsharp.sh`
- Libs : ```qsharp, iqsharp```
- `simulaqron.sh`
- Libs : ```simulaqron```
- `myqlm.sh`
- Libs : ```myqlm, libmagickwand-dev, myqlm-interop[qiskit_binder]```
- `cirq.sh`
- Libs : ```cirq, cirq-core[contrib], texlive-latex-base, latexmk```
The env is based on the image [qat-computer](https://github.com/mickahell/qat-computer).

### Volume
The folder `data/share` is link to the host file and allow to register the modification in the host computer

### How to

#### Build

```bash
docker build . --file Dockerfile --tag quantum_lab_qiskit:main
```

#### Run

```bash
docker run -d --name qiskit_lab \
-v $PWD/YOUR_DATA_FOLDER:/opt/quantum_lab/data/share
-p 8888:8888 \
mickahell/quantum_lab_qiskit:latest -c "/opt/quantum_lab/start_jupyter.sh"
```

### Jupyter
To launch the Jupyter notebook instance :
- be inside the `data`folder
Expand Down
5 changes: 0 additions & 5 deletions build/cirq.sh

This file was deleted.

8 changes: 0 additions & 8 deletions build/myqlm.sh

This file was deleted.

13 changes: 0 additions & 13 deletions build/qiskit-full.sh

This file was deleted.

5 changes: 0 additions & 5 deletions build/qiskit-light.sh

This file was deleted.

5 changes: 0 additions & 5 deletions build/qml.sh

This file was deleted.

17 changes: 0 additions & 17 deletions build/qsharp.sh

This file was deleted.

5 changes: 1 addition & 4 deletions build/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
networkx
numpy
matplotlib
notebook
pandas
scipy
purplecaffeine
3 changes: 0 additions & 3 deletions build/simulaqron.sh

This file was deleted.

9 changes: 0 additions & 9 deletions data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
## Sharing file
- File sync with your host computer

## Program example
- Some example of program for each environment are available here :
- `qiskit`
- `qml`(Pennylane)
- `Q#`
- `SimulaQron`

Every code examples are running simply by taping : `python3 script.py` or `./script.sh`

## Jupyter
- To start the jupyter server, run the script `./start_jupyter.sh`
- Then go to your host browser and tape `http://127.0.0.1:8888/`
19 changes: 0 additions & 19 deletions data/examples/cirq/hello_cirq.py

This file was deleted.

33 changes: 0 additions & 33 deletions data/examples/myqlm/hello_myqlm.py

This file was deleted.

Loading
Loading