mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
Merge branch 'almet/document-systemd' into 'main'
Put systemd configuration files in the docs. Closes #3 See merge request framasoft/framaspace/argos!14
This commit is contained in:
commit
e199b4932c
5 changed files with 71 additions and 2 deletions
21
conf/systemd-agent.service
Normal file
21
conf/systemd-agent.service
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Argos agent
|
||||||
|
Documentation=https://framasoft.frama.io/framaspace/argos/
|
||||||
|
Requires=network.target
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
Environment="ARGOS_AGENT_TOKEN=Secret"
|
||||||
|
Environment="ARGOS_AGENT_SERVER_URL=http://127.0.0.1:8000"
|
||||||
|
WorkingDirectory=/var/www/argos/
|
||||||
|
ExecStart=/var/www/argos/venv/bin/argos agent --max-tasks 20 --wait-time 10 --log-level DEBUG
|
||||||
|
SyslogIdentifier=argos-agent
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
# NB: it may be better to
|
||||||
|
# - use a dedicated user
|
||||||
|
# - use a EnvironmentFile=/etc/default/argos-agent in order enable configuration
|
||||||
|
# changes without doing a systemctl daemon-reload
|
16
conf/systemd-server.service
Normal file
16
conf/systemd-server.service
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Argos server
|
||||||
|
Documentation=https://framasoft.frama.io/framaspace/argos/
|
||||||
|
Requires=network.target postgresql.service
|
||||||
|
After=network.target postgresql.service
|
||||||
|
PartOf=postgresql.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=www-data
|
||||||
|
WorkingDirectory=/var/www/argos/
|
||||||
|
ExecStart=/var/www/argos/venv/bin/argos server start
|
||||||
|
ExecReload=/var/www/argos/venv/bin/argos server reload
|
||||||
|
SyslogIdentifier=argos-server
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
25
docs/deployment/systemd.md
Normal file
25
docs/deployment/systemd.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Using systemd
|
||||||
|
|
||||||
|
Here are the systemd files that can be used to deploy the server and the agents.
|
||||||
|
|
||||||
|
## Agent
|
||||||
|
|
||||||
|
```{literalinclude} ../../conf/systemd-agent.service
|
||||||
|
---
|
||||||
|
caption: /etc/systemd/system/argos-agent.service
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
## Server
|
||||||
|
|
||||||
|
```{literalinclude} ../../conf/systemd-server.service
|
||||||
|
---
|
||||||
|
caption: /etc/systemd/system/argos-server.service
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Please note that it might be better to use Gunicorn with a Uvicorn worker, [as specified in the Uvicorn docs](https://www.uvicorn.org/#running-with-gunicorn):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gunicorn example:app -w 4 -k uvicorn.workers.UvicornWorker
|
||||||
|
```
|
|
@ -64,5 +64,12 @@ checks
|
||||||
developer/overview
|
developer/overview
|
||||||
developer/new-check
|
developer/new-check
|
||||||
developer/models
|
developer/models
|
||||||
|
changelog
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```{toctree}
|
||||||
|
:caption: Deployment
|
||||||
|
:hidden:
|
||||||
|
deployment/systemd
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ The quickest way to get started is to copy the `config-example.yaml` file and ed
|
||||||
cp config-example.yaml config.yaml
|
cp config-example.yaml config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
You can read more about the configuration in the [configuration section](configuration.md).
|
You can read more about the configuration in the [configuration section](../configuration.md).
|
||||||
|
|
||||||
## Starting the server
|
## Starting the server
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue