Skip to content

Commit

Permalink
Docs: Updated installation instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsedla1o committed Sep 14, 2023
1 parent b023472 commit 8e41189
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Create a virtualenv and install the DP³ platform using:
python3 -m venv venv # (1)!
source venv/bin/activate # (2)!
pip install --upgrade pip # (3)!
pip install git+https://github.com/CESNET/dp3.git#egg=dp3
pip install git+https://github.com/CESNET/dp3.git#egg=dp-cubed
```

1. We recommend using virtual environment. If you are not familiar with it, please read
Expand Down Expand Up @@ -180,16 +180,33 @@ For production use, we recommend using the [`supervisor`](http://supervisord.org
which greatly simplifies having multiple worker processes. We recommend [`gunicorn`](https://gunicorn.org/) as the API server,
hidden behind [`nginx`](https://www.nginx.com/) as a reverse proxy.

We will assume that you have a prototype of your application available on the server you will be deploying on,
if not, you can use `dp3 setup` to create the application skeleton after installing the DP3 package,
as described in [the previous section](#creating-a-dp3-application).

To start, install the pre-requisites and explicitly dependent packages:

```shell
sudo dnf install git wget nginx supervisor redis
```

!!! warning "Application placement"

We highly recommend using a virtualenv for you python environment
which can be created using the command:

```sh
python3 -m venv <path>
```

We recommend placing your application, as well as the virtualenv,
outside you home directory, for example in `/opt/<APP_NAME>`.
This will greatly simplify the permissions management.

Inside your virtualenv, install DP3 with the `deploy` extras, which includes the `gunicorn` server:

```shell
pip install "git+https://github.com/CESNET/dp3.git#egg=dp3[deploy]"
pip install "git+https://github.com/CESNET/dp3.git#egg=dp-cubed[deploy]"
```

We will assume that you have the python environment activated for the rest of the installation.
Expand Down
2 changes: 1 addition & 1 deletion dp3/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_latest_snapshot(self, etype: str, eid: str) -> dict:

def get_latest_snapshots(
self, etype: str, eid_filter: str = ""
) -> (pymongo.cursor.Cursor, int):
) -> tuple[pymongo.cursor.Cursor, int]:
"""Get latest snapshots of given `etype`.
This method is useful for displaying data on web.
Expand Down

0 comments on commit 8e41189

Please sign in to comment.