Guide: Run your experiment with the QatComputer

QatComputer is an internal tool to the Docker image who aim to run your program directly inside the container.

Start the container

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

Run your program

Last step to run your experiment

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

Configuration

Parameters 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"   # Path inside the compute folder
filename_to_execute: "main.py"
requirements_file: "requirements.txt"   # Optionnal

References

  • Helper of the main endpoint :

Usage: qat-computer [OPTIONS] argument ...
  -conf string
        Path for the configuration yaml file.
        The configuration file can contains any options presented.
  -os-version
        print os version.
  -qiskit-version
        print qiskit version.
  -show-config
        print config.
  -version
        print version.
Sub-commands available :
 compute
  • Helper of the compute endpoint :

Usage of compute:
  -compute string
        Path of the project to compute.
  -conf string
        Path for the configuration yaml file.
        The configuration file can contains any options presented.
  -debian-pkg string
        List of debian package to install.
  -file_exe string
        Name of the file to compute the project. (default "main.py")
  -log-level int
        level of log to print :
        0 : Informational (default value)
        1 : Warning
        2 : Error --> Always shown
        3 : Critical --> Always shown
  -python-version string
        Version of python to use. (default "python3")
  -requirements string
        Name of the requirements file to setup the project.