... | ... | @@ -20,7 +20,7 @@ Stork should compile on a variety of different operating systems. We recently im |
|
|
|
|
|
### Stork Agent
|
|
|
|
|
|
stork-agent is a program written in Go (part of the Stork backend) that must be installed on each machine monitored by the stork-server. It serves the following purposes.
|
|
|
`stork-agent` is a program written in Go (part of the Stork backend) that must be installed on each machine monitored by the `stork-server`. It serves the following purposes.
|
|
|
|
|
|
| Feature | Code Locations |
|
|
|
| ------ | ------ |
|
... | ... | @@ -33,7 +33,7 @@ stork-agent is a program written in Go (part of the Stork backend) that must be |
|
|
| Export Kea statistics to Prometheus | backend/agent/promkeaexporter.go |
|
|
|
|
|
|
### Stork Server
|
|
|
stork-server is a program written in Go (part of the Stork backend) that is a central instance of the Stork deployment. It manages and monitors remote systems (via the agents). It provides the middleware serving UI files downloaded to a user's browser. The browser then communicates with the server over the REST API. The API can also be used directly. Stork system tests use the server's REST API to interact with it. The following is the list of the server's features.
|
|
|
`stork-server` is a program written in Go (part of the Stork backend) that is a central instance of the Stork deployment. It manages and monitors remote systems (via the agents). It provides the middleware serving UI files downloaded to a user's browser. The browser then communicates with the server over the REST API. The API can also be used directly. Stork system tests use the server's REST API to interact with it. The following is the list of the server's features.
|
|
|
|
|
|
| Feature | Code Locations |
|
|
|
| ------ | ------ |
|
... | ... | @@ -96,4 +96,49 @@ It is a rich toolset for defining REST API specifications. The Swagger editor he |
|
|
Swagger 2.0 is the API specification version currently used in Stork. OpenAPI 3.0 is the next specification version with a more sophisticated data model. We currently don't use OpenAPI 3.0 because the Go-swagger code generator does not support it.
|
|
|
|
|
|
### PostgreSQL
|
|
|
Stork server uses PostgreSQL as a central database. Go-pg and Go-pg/orm are used as client libraries. These libraries are now in maintenance mode. The Bun project offers similar functionality but also works for other databases. We are considering migration to this project. |
|
|
\ No newline at end of file |
|
|
Stork server uses PostgreSQL as a central database. Go-pg and Go-pg/orm are used as client libraries. These libraries are now in maintenance mode. The Bun project offers similar functionality but also works for other databases. We are considering migration to this project.
|
|
|
|
|
|
## Preparing the Developer Environment
|
|
|
|
|
|
This section describes the exact steps to prepare a fresh Ubuntu 22 system for Stork development.
|
|
|
|
|
|
Begin with installing the dependencies that are not installed automatically by the Stork build system.
|
|
|
|
|
|
```shell
|
|
|
$ sudo apt install ruby gcc python3.10-venv default-jre postgresql-14 docker-compose
|
|
|
$ sudo snap install chromium
|
|
|
$ sudo usermod -a -G docker <your_username>
|
|
|
```
|
|
|
|
|
|
Prepare the databases both for the unit tests and normal `stork-server` operation.
|
|
|
|
|
|
```shell
|
|
|
$ sudo -u postgres psql
|
|
|
postgres=# CREATE DATABASE stork;
|
|
|
CREATE DATABASE
|
|
|
postgres=# CARETE DATABASE storktest;
|
|
|
CREATE DATABASE
|
|
|
postgres=# CREATE USER stork WITH PASSWORD 'stork';
|
|
|
CREATE ROLE
|
|
|
postgres=# CREATE USER storktest WITH PASSWORD 'storktest';
|
|
|
CREATE ROLE
|
|
|
postgres=# ALTER ROLE storktest SUPERUSER;
|
|
|
ALTER ROLE
|
|
|
postgres=# \c stork
|
|
|
You are now connected to database "stork" as user "postgres".
|
|
|
stork=# CREATE EXTENSION pgcrypto;
|
|
|
CREATE EXTENSION
|
|
|
```
|
|
|
|
|
|
Clone Stork repository and play around. Some of the `rake` tasks may take significant amount of time when they run for the first time. These tasks fetch and cache many dependencies. It is useful to run them for the first time using a stable and fast internet connection.
|
|
|
|
|
|
```shell
|
|
|
$ git clone git@gitlab.isc.org:isc-projects/stork.git
|
|
|
$ cd stork
|
|
|
$ rake --tasks
|
|
|
$ rake -D
|
|
|
$ rake unittest:backend SHORT=true
|
|
|
$ rake unittest:ui
|
|
|
$ rake demo:up
|
|
|
```
|
|
|
|