Skip to content

mickahell/qat-computer

Repository files navigation

Qat Computer

GitHub release (latest by date)

Demo tests Python tests QatComputer tests QatCMD tests

Docker Pulls Docker Pulls Full

Qiskit License

The project is aimed to create a Qiskit base docker image to use as base for any quantum application using Qiskit. The image also contains the tool QatComputer who allows you to run a python project directly inside the container as a run as you go.

Full documentation available at QatComputer docs.

Goals

This project has 2 purposes :

  • Create a based docker image pre-installed with an updated version of Qiskit. In order to help with integration and deployement of Quantum apps.
  • Create a virtual environment to run and test your own project locally, serverlessly without having to configure anything or to alter your local configuration. AS everything is inside a docker env, you create, run, destroy and retry again with a clean new container again and again.

Prerequisites

  • Linux
    apt-get install docker-ce docker-ce-cli containerd.io

Details

Getting started

The image is available in DockerHub and can be clone with :

docker pull mickahell/qatcomputer
# Full
docker pull mickahell/qatcomputer-full

Most of the usefull commands are available in the Docker Compose file and in the makefile.

Build

if you want to build your own image :

docker build . --build-arg FULL=false --file docker/Dockerfile --tag qatcomputer:latest

Compute

Parameters for the tool can be given as docker extra parameters. A configuration file is also available with every parameters :

# log
## 0 : Informational
## 1 : Warning
## 2 : Error --> Always
## 3 : Critical --> Always
loglevel: 0   # Optionnal
debian_packages:   # Optionnal
  - "jq"
python_version: "python3.10"   # Optionnal
compute_path: "simple_python_repository"
filename_to_execute: "main.py"
requirements_file: "requirements.txt"   # Optionnal

In order to start the image and make the internal tool available :

docker run -d --rm --privileged --cgroupns=host \
	--name qatcomputer \
	-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
	-v my_conf_folder:/etc/qat-computer/conf \
	-v my_super_project:/etc/qat-computer/compute \
	mickahell/qatcomputer:latest

In order to the tool works correctly you need :

  • (Optional) Be in priviledge mode and host network mode
  • (Optional) Link your cgroup
  • (Optional) Link your project conf
  • Link your project to the compute folder inside the image

And run the tool :

docker exec --tty qatcomputer \
	qat-computer compute -conf=conf.yaml