Commit 8fcec731 authored by Alexander Kaschta's avatar Alexander Kaschta Committed by janis.streib
Browse files

UPD: Improvements to the documentation

parent 9782042d
Pipeline #211096 passed with stages
in 2 minutes and 53 seconds
# NET-SUITE
## Installation using venv
NET-SUITE requires ```python3```, ```nodejs``` and ```yarn``` for Javascript client dependency management.
In case you don't want a venv setup, omit steps 1&2.
1. Create venv:
virtualenv venv/
2. Change into venv:
source bin/activate
3. Install dependencies:
pip install -r requirements.txt
4. Install JS-Dependencies
cd net_suite/static/js
yarn install
## Installation
NET-SUITE requires ```python3``` and ```nodejs```.
## Productive setup with uwsgi
1. Clone the repository including its submodules:
```shell
git clone --recurse-submodules git@git.scc.kit.edu:scc-net/netvs/netvs-core.git
```
2. Further installation instructions for the components can be found in their matching directories.
uwsgi -s /tmp/net-suite.sock --virtualenv <path to env> --manage-script-name --mount /net-suite=run:app
## DEV-Setup
```DEBUG = True``` in ```config.py```.
python3 run.py
## systemd
Also take at look at the [uwsgi documentation](http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd).
## License
## Configuration
### NET-DB
#### Postgres
Net-Suite uses different databases depending on the host operation mode defined in ```/usr/local/etc/host_oper_mode_data.cfg```:
[op_environment]
mode = test
# mode = prod
# mode = test
[redundancy]
mode = active
[default_database_connection]
prod = pgsql_prod
test = pgsql_test
devel = psql_devel
The different databases are defined in the ```HOME``` of the user running DNSVS in the file ``` ~/.db_connection_data.ini```:
[pgsql_prod]
host=prodhost
port=5435
user=user
db=db
[pgsql_test]
host=testhost
port=5435
user=user
db=db
[pgsql_devel]
host=develhost
port=5435
user=user
db=db
Postgres authentication information is retrieved from ```~/.pgpass```.
\ No newline at end of file
The NET-SUITE is licensed under the MIT-License. More information can be found [here](LICENSE).
\ No newline at end of file
# net-suite frontend
## Project setup
```
npm install
```
## Development setup
### Development setup
1. Generate API-Endpoints
```
NETDB_AUTH=<API-Token> python3 ./generate_base_model.py
The initial setup consists of the following steps:
1. Install the following `pip`-module using `git` to be able to generate api configurations
```shell
pip3 install git+https://git.scc.kit.edu/scc-net/net-suite/api-generator.git@master#egg=net-api-generator
```
2. Enter the `frontend` folder using
```shell
cd frontend/
```
3. Generate API-Endpoints in `frontend/public/api.yml` using
```
2. Create netvs-configuration `netvs.config.js`. See `netvs.config.js.example`.
3. Run the development server
net-api-generator openapi --default_endpoint=devel > public/api.yml
```
Instead of creating the api configuration for `devel`, `test` can also be used.
4. Create a netvs-configuration `netvs.config.js`. See `netvs.config.js.example` for more information. In most cases its
enough to simply copy and rename the example config.
5. Run the development server either with `docker` and `docker-compose` (recommended way)
```shell
docker-compose up -d netvs-core_run
```
or by running a local server (which we discourage from) after installing the project using the following two commands
```shell
npm install
npm run serve
```
### Local project setup
```
npm install
```
### Compiles and minifies for production
```
npm run build
......
# NETVS - Middleware
## Installation
The NET-SUITE middleware requires ```python3```.
In case you don't want a venv setup, omit steps 1&2.
1. Create venv:
```shell
virtualenv venv/
```
2. Change into venv:
```shell
source bin/activate
```
3. Install dependencies:
```shell
pip install -r requirements.txt
```
## Productive setup with uwsgi
```shell
uwsgi -s /tmp/net-suite.sock --virtualenv <path to env> --manage-script-name --mount /net-suite=run:app
```
## DEV-Setup
```DEBUG = True``` in ```config.py```.
```shell
python3 run.py
```
## systemd
Also take at look at the [uwsgi documentation](http://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd).
## Configuration
### NET-DB
#### Postgres
Net-Suite uses different databases depending on the host operation mode defined in ```/usr/local/etc/host_oper_mode_data.cfg```:
```INI
[op_environment]
mode = test
# mode = prod
# mode = test
[redundancy]
mode = active
[default_database_connection]
prod = pgsql_prod
test = pgsql_test
devel = psql_devel
```
The different databases are defined in the ```HOME``` of the user running DNSVS in the file ``` ~/.db_connection_data.ini```:
```INI
[pgsql_prod]
host=prodhost
port=5435
user=user
db=db
[pgsql_test]
host=testhost
port=5435
user=user
db=db
[pgsql_devel]
host=develhost
port=5435
user=user
db=db
```
Postgres' authentication information is retrieved from ```~/.pgpass```.
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment