Add docs for environment variables

This commit is contained in:
Alexis Métaireau 2023-11-23 17:58:12 +01:00
parent 94049bc0ff
commit 1554661e54
3 changed files with 41 additions and 14 deletions

View file

@ -1,4 +1,4 @@
ARGOS_YAML_FILE = "my-config.yaml" ARGOS_YAML_FILE = "my-config.yaml"
ARGOS_DATABASE_URL = "postgresql://argos:argos@localhost/argos" ARGOS_DATABASE_URL = "postgresql://argos:argos@localhost/argos"
DB_POOL_SIZE = 10 DB_POOL_SIZE = 10 # https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.pool_size
DB_MAX_OVERFLOW = 20 DB_MAX_OVERFLOW = 20

View file

@ -46,10 +46,10 @@ Usage: argos agent [OPTIONS] SERVER AUTH
Usage: argos agent https://argos.server "auth-token-here" Usage: argos agent https://argos.server "auth-token-here"
Alternatively, you can use the following environment variables to avoid passing Alternatively, you can use the following environment variables to avoid
arguments to the agent on the command line: passing arguments to the agent on the command line:
ARGOS_AGENT_SERVER_URL=https://argos.server ARGOS_AGENT_SERVER_URL=https://argos.server ARGOS_AGENT_TOKEN=auth-token-
ARGOS_AGENT_TOKEN=auth-token-here here
Options: Options:
--max-tasks INTEGER Number of concurrent tasks this agent can run --max-tasks INTEGER Number of concurrent tasks this agent can run
@ -75,8 +75,8 @@ Options:
--help Show this message and exit. --help Show this message and exit.
Commands: Commands:
clean Clean the database (to run routinely) cleandb Clean the database (to run routinely)
start Starts the server. start Starts the server.
``` ```
<!--[[[end]]] <!--[[[end]]]
@ -94,11 +94,11 @@ Usage: argos server start [OPTIONS]
Starts the server. Starts the server.
Options: Options:
--host TEXT Host to bind --host TEXT Host to bind
--port INTEGER Port to bind --port INTEGER Port to bind
--reload Enable hot reloading --config TEXT Path the the configuration file
--log-config TEXT Path to the logging configuration file --reload Enable hot reloading
--help Show this message and exit. --help Show this message and exit.
``` ```
<!--[[[end]]] <!--[[[end]]]
@ -111,7 +111,7 @@ Options:
.. ]]] --> .. ]]] -->
```man ```man
Usage: argos server clean [OPTIONS] Usage: argos server cleandb [OPTIONS]
Clean the database (to run routinely) Clean the database (to run routinely)
@ -119,7 +119,7 @@ Usage: argos server clean [OPTIONS]
been locked for too long. been locked for too long.
Options: Options:
--max-results INTEGER Maximum number of results to keep --max-results INTEGER Number of results per tasks to keep
--max-lock-seconds INTEGER The number of seconds after which a lock is --max-lock-seconds INTEGER The number of seconds after which a lock is
considered stale considered stale
--help Show this message and exit. --help Show this message and exit.

View file

@ -13,6 +13,33 @@ caption: .env
--- ---
``` ```
### Environment variables
Here are the environment variables you can define to configure how the service will behave :
#### ARGOS_YAML_FILE
The path to the yaml configuration file, defining the checks.
#### ARGOS_DATABASE_URL
The database url, as defined [in SQLAlchemy docs](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls).
For instance, to connect to a postgres database on localhost with user, pass and dbname "argos":
```
ARGOS_DATABASE_URL = "postgresql://argos:argos@localhost/argos"
```
#### DB_POOL_SIZE
#### DB_MAX_OVERFLOW
These two help you configure the size of the pool, and the max overflow (until when do we accept a new connection ?) These are documented [in the SQLAlchemy docs in greater details](https://docs.sqlalchemy.org/en/20/core/pooling.html#sqlalchemy.pool.QueuePool.params.pool_size)
```bash
DB_POOL_SIZE = 10
DB_MAX_OVERFLOW = 20
```
## Checks configuration ## Checks configuration