argos/docs/installation/getting-started.md
2024-03-25 13:56:45 +01:00

66 lines
1.6 KiB
Markdown

# Installation
## Requirements
- Python 3.11+
- PostgreSQL 13+ (for production)
## Getting dependencies
Once you got the source locally, create a virtualenv and install the dependencies:
```bash
python3 -m venv venv
source venv/bin/activate
pip install -e .
```
## Configure
The quickest way to get started is to copy the `config-example.yaml` file and edit it:
```bash
cp config-example.yaml config.yaml
```
You can read more about the configuration in the [configuration section](../configuration.md).
## Starting the server
Environment variables are used to configure the server. You can also put them in an `.env` file:
```{literalinclude} ../../.env.example
---
caption: .env
---
```
Please note that the only supported database engines are SQLite for development and PostgreSQL for production.
Then you can start the server:
```bash
argos server start
```
The server reads the `yaml` file at startup, and populates the tasks queue with the checks defined in the configuration.
## Running the agent
You can run the agent on the same machine as the server, or on a different machine. The only requirement is that the agent can reach the server.
```bash
argos agent http://localhost:8000 "<auth-token>"
```
## Cleaning the database
You also have to run cleaning tasks periodically. `argos server clean --help` will give you more information on how to do that.
Here is a crontab example, which will clean the db each hour:
```bash
# Run the cleaning tasks every hour (at minute 7)
# Keeps 10 results per task, and locks the tasks for 1 hour
7 * * * * argos server cleandb --max-results 10 --max-lock-seconds 3600
```