Skip to content

Commit

Permalink
Update local infrastructure (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson authored Oct 3, 2023
1 parent 54c95a4 commit 7c96501
Showing 1 changed file with 42 additions and 14 deletions.
56 changes: 42 additions & 14 deletions docs/deployment/local.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,57 @@
Local infrastructure setup
==========================

To set up Quantum Serverless on your local machine, you will need to use `docker compose`_.
Step 1: Create a Python environment and clone the repository

.. _docker compose: https://docs.docker.com/compose/
The ``quantum-serverless`` repository contains some Dockerfiles which make spinning up a test cluster
on your local machine straightforward. The first thing we will do is clone the repository.

Once you have Docker and docker compose installed, you can run the following command to set up the infrastructure:
.. code-block::
:caption: Create a minimal environment with only Python installed in it. We recommend using `Python virtual environments <https://docs.python.org/3.10/tutorial/venv.html>`_.
python3 -m venv /path/to/virtual/environment
.. code-block::
:caption: Activate your new environment.
$ VERSION=<VERSION> docker compose [--profile <PROFILE>] up
source /path/to/virtual/environment/bin/activate
The available profiles are `full`, `jupyter`, and `repo`.
The repo profile installs core services and the program repository,
the jupyter profile installs core services and Jupyter Notebook,
and the full profile installs all core services,
Jupyter Notebook, and logging and monitoring systems.
.. code-block::
:caption: Note: If you are using Windows, use the following commands in PowerShell.
python3 -m venv c:\path\to\virtual\environment
c:\path\to\virtual\environment\Scripts\Activate.ps1
.. code-block::
:caption: Clone the Quantum Serverless repository.
Available version can be found in `GitHub releases`_ page.
cd /path/to/workspace/
git clone git@github.com:Qiskit-Extensions/quantum-serverless.git
.. _GitHub releases: https://github.com/Qiskit-Extensions/quantum-serverless/releases
Step 2: Set up Docker

For example, if you want to install version `0.6.3` with all services,
the command would be:
To set up Quantum Serverless on your local machine, you will need to use `docker compose`_.

.. _docker compose: https://docs.docker.com/compose/

Step 3: Initiate the test cluster

Once you have Docker and docker compose installed, you can run the following command from the root of the
``quantum-serverless`` repository to set up the infrastructure:

.. code-block::
$ VERSION=0.6.3 docker compose --profile full up
$ docker compose [--profile <PROFILE>] up
The available profiles are `full`, `jupyter`, and `repo`.
The repo profile installs core services and the program repository;
the jupyter profile installs core services and Jupyter Notebook;
and the full profile installs all core services, including logging and
monitorying systems and jupyter.

Step 4: Run a program in the test environment

Once the containers are running, you can simulate a remote cluster with the resources on your
local machine. To create and run programs in this simulated cluster, visit the Jupyter Lab
environment at `localhost:8888` via a web browser. Refer to the `Getting Started section <_getting_started>_`
for details about running your program remotely.

0 comments on commit 7c96501

Please sign in to comment.