Skip to content

Commit 8c49021

Browse files
authored
Documentation: readme and docker-compose (#42)
1 parent 7212325 commit 8c49021

7 files changed

Lines changed: 23 additions & 26 deletions

File tree

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,22 @@ Platform for tracking, sharing and running quantum experiments in a clean and un
88
> Alpha release is in the works.
99
> Files from hackathon project are located in [hackathon folder](./hackathon)
1010
11-
### General overview
12-
13-
![flow](https://raw.githubusercontent.com/IceKhan13/QiskitFlow/master/docs/images/flow.png)
14-
15-
1611
### Hot to run
1712
* [Overview / Flow](#flow)
18-
* [Installation](#installation)
13+
* [Installation and server running](#installation)
1914
* [Code annotation](#code-annotation)
2015
* [CLI](#cli)
2116
* [Experiment runs list](#list-of-experiment-runs)
2217
* [Experiment run information](#experiment-run-information)
2318
* [Share experiment](#share-experiment-run)
2419
* [Examples](#examples)
25-
* [Run server and UI on your machine](#run-local)
2620
* [UI](#ui)
2721

22+
2823
### Flow
2924

25+
![flow](https://raw.githubusercontent.com/IceKhan13/QiskitFlow/master/docs/images/flow.png)
26+
3027
Flow of actions while using QiskitFlow is following:
3128
- [Install](#installation) QiskitFlow if not installed yet
3229
- [Annotate](#code-annotation) your code with `Experiment` abstraction QiskitFlow library provides
@@ -41,10 +38,24 @@ Flow of actions while using QiskitFlow is following:
4138

4239
### Installation
4340

41+
In order to install qiskitflow locally you need to follow 2 step process:
42+
- install python library for code annopatation and cli
43+
- run docker containers for backend server, ui and database
44+
45+
To install qiskitflow library and CLI simply run
4446
```shell script
4547
pip install qiskitflow
4648
```
4749

50+
In order to run containers with required services we suggest to use docker-compose. But by no means we restrict you to deploy qiskitflow to any container aware environment. At the end of the day all required services are just docker images.
51+
1. Copy [./docker-compose.yaml](docker-compose.yaml file) to your machine
52+
2. Run `docker-compose up` in a folder where you saved compose file. In a few moments you should see logs from server, ui and database.
53+
54+
55+
> NOTE: in order to share experiments you need to have backend server up and running.
56+
57+
> NOTE: username and password for local server is `admin`
58+
4859

4960
### Code annotation
5061

@@ -187,17 +198,6 @@ Experiment information
187198
[Jupyter notebook with quantum teleportation example](https://github.com/IceKhan13/QiskitFlow/blob/master/docs/examples/example.ipynb)
188199

189200

190-
### Run local
191-
192-
0. Install `docker compose`
193-
1. Run
194-
```shell script
195-
docker-compose up
196-
```
197-
198-
Note: username and password for local server is `admin`
199-
200-
201201
### UI
202202

203203
<details><summary>Screenshots</summary>

backend/_Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FROM python:3.7
22
ENV PYTHONUNBUFFERED=1
3+
RUN apt update && apt install postgresql-client -y
34
WORKDIR /code
45
COPY requirements.txt /code/
56
RUN pip install -r requirements.txt

backend/core/management/commands/initadmin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Command(BaseCommand):
88
def handle(self, *args, **options):
9-
for line in settings.ADMINS:
9+
for line in settings.ON_START_ADMINS:
1010
username, password, email = line.split(",")
1111
if User.objects.filter(username=username).exists():
1212
print("Admin user {} already exists".format(username))

backend/qiskitflow_backend/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@
166166
'SLIDING_TOKEN_LIFETIME': timedelta(hours=3)
167167
}
168168

169-
ADMINS = os.environ.get("DJANGO_ADMINS", "").split(";")
169+
ON_START_ADMINS = os.environ.get("DJANGO_ADMINS", "").split(";")

docker-compose.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ services:
1515
server:
1616
container_name: qiskitflow-server
1717
image: icekhan/qiskitflow-backend:latest
18-
# build:
19-
# context: ./backend/
20-
# dockerfile: _Dockerfile
21-
command: sh -c "python manage.py migrate && python manage.py initadmin && gunicorn qiskitflow_backend.wsgi:application --bind 0.0.0.0:8000"
18+
command: sh -c "until pg_isready --username=postgres --host=db; do sleep 1; done; python manage.py migrate && python manage.py initadmin && gunicorn qiskitflow_backend.wsgi:application --bind 0.0.0.0:8000"
2219
ports:
2320
- "8000:8000"
2421
environment:
@@ -37,6 +34,5 @@ services:
3734
ui:
3835
container_name: qiskitflow-ui
3936
image: icekhan/qiskitflow-ui:latest
40-
#build: ./ui/
4137
ports:
4238
- "3000:80"

docs/images/flow.png

-7 KB
Loading

ui/app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<meta name="mobile-web-app-capable" content="yes">
1313

1414
<link rel="icon" href="/favicon.ico" />
15-
<title>React.js Boilerplate</title>
15+
<title>QiskitFlow. Reproducible quantum experiments.</title>
1616
</head>
1717

1818
<body>

0 commit comments

Comments
 (0)