Skip to content

Commit e46a62f

Browse files
committed
Fix #1201 - Update batch deployment docs
1 parent dd4ded3 commit e46a62f

File tree

2 files changed

+26
-45
lines changed

2 files changed

+26
-45
lines changed

documentation/Batch.md

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,37 @@ The Internet.nl codebase is bundled with batch functionality, that is the
44
ability to submit a number of domains at once for web or email testing.
55

66
This is accomplished through a REST API.
7+
The API documentation of the Internet.nl API v2.0 can be found on https://batch.internet.nl/api/batch/openapi.yaml.
8+
A viewer, like ReDoc, can be used for generating a human readable version: http://redocly.github.io/redoc/?url=https://batch.internet.nl/api/batch/openapi.yaml.
79

8-
## Information for operators
10+
Examples of API consumer scripts:
11+
- Internet.nl Dashboard: https://github.com/internetstandards/Internet.nl-dashboard
12+
- Internet.nl batch scripts: https://github.com/poorting/internet.nl_batch_scripts
913

10-
### Enabling the API
14+
## Deploying a batch instance
1115
See [Deployment Batch](Docker-deployment-batch.md).
1216

13-
### Generating the documentation
14-
The API follows the [OpenAPI specification](https://swagger.io/specification/).
15-
16-
Copy `internetnl/batch_api_doc_conf_dist.py` to
17-
`internetnl/batch_api_doc_conf.py` and change any appropriate settings to your
18-
liking.
19-
20-
Run `manage.py api_generate_doc` to generate the documentation. You
21-
can then visit `/api/batch/openapi.yaml` to get the documentation (also
22-
available in the `static` folder locally). **The documentation needs to be
23-
regenerated whenever anything changes in the API specification
24-
(`checks/batch/openapi.yaml`)**
25-
26-
### Users
17+
## Users
2718
Any activity on the batch functionality requires a configured user.
2819

2920
Authorization of the users is not done by the Django application itself but
3021
rather relies on the upfront webserver to do the necessary HTTP Auth and pass
31-
the authenticated user to the Django application.
32-
33-
The `manage.py api_users` command helps with managing user information on the
34-
Django application.
22+
the authenticated user to the Django application. The known users can be
23+
managed with the `/opt/Internet.nl/docker/batch_user.sh` script, detailed
24+
in the batch deployment documentation.
3525

36-
Management for the HTTP authenticated users needs to happen separately for the
37-
upfront webserver.
26+
## Overview of significant differences in batch mode
3827

39-
To register a new user on the current internet.nl production setup on int-prod-batch:
40-
```
41-
sudo -s -u internetnl
42-
cd /opt/internetnl/Internet.nl
43-
source ~internetnl/internet.nl.env
44-
make -- manage api_users register -n "$NAME" -o "$ORGNAME" -e "$EMAIL" -u "$USERNAME"
45-
htpasswd /etc/apache2/htpasswd $USERNAME
46-
# <enter API password>
47-
```
48-
49-
### Forwarding resolver
50-
In batch operation mode it is advised to use a forwarding resolver that all the
51-
celery tasks are going to forward DNS queries to. This is configurable with the
52-
`CENTRAL_UNBOUND` option.
53-
54-
### DB indexes
55-
When running in batch operation mode it is advised to run
56-
`manage.py api_create_db_indexes`. This creates additional DB indexes needed
57-
for the batch functionality.
28+
* The connection test is not available.
29+
* DNSSEC tests do not perform a registrar lookup.
30+
* The REST API is only enabled in batch mode.
31+
* The hall of fame is not enabled.
32+
* Individual clients are not rate limited, as scheduling is entirely different as explained below.
33+
* No prechecks are performed e.g. to check whether the hostname has an A/AAAA record.
34+
* The database has some additional indexes.
5835

36+
These configuration differences are automatically managed by the deployment based on `ENABLE_BATCH`,
37+
or is documented in the batch deployment guide.
5938

6039
## Information for developers
6140

@@ -65,6 +44,10 @@ logic to submit normal tests to the main Internet.nl functionality.
6544

6645
### Logic
6746

47+
Fundamentally:
48+
- Batch requests are processed on a FIFO basis for a particular user. This means a users can submit multiple batch requests, but they are processed sequentally. The first / current batch requests needs to finish before the next one starts.
49+
- Batch requests of multiple users are run in parallel. While influenced by the number of users running simultaneous batch requests, you should assume that parallel tasks take longer to finish since server resources are being shared.
50+
6851
All the batch logic is being ran/managed by `checks/batch/scheduler.py` which
6952
is ran periodically in celery and in short:
7053
1. Does some bookkeeping for stalled tests;
@@ -80,7 +63,7 @@ is ran periodically in celery and in short:
8063
### Relevant DB Models
8164

8265
- `BatchUser`
83-
Stores the registered users; not passwords.
66+
Stores the registered users; not passwords. Automatically created.
8467
- `BatchRequest`
8568
Stores the batch requests that come through the API along with links to the
8669
generated result files.

documentation/Docker-deployment-batch.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Batch installations require the following settings:
104104
And optionally:
105105

106106
- `MONITORING_AUTH`: May be a comma separated list of `user:password` pairs which are allowed to access the metrics at `https://example.com/grafana/`.
107-
- `BASIC_AUTH`, `BASIC_AUTH_RAW` and `ALLOW_LIST`: Can be set to restrict access to the single scan webpage. See [Restricting Access](Docker-deployment.md#restricting-access) for more information.
107+
- `BASIC_AUTH_RAW` and `ALLOW_LIST`: Can be set to restrict access to the single scan webpage. See [Restricting Access](Docker-deployment.md#restricting-access) for more information.
108108

109109
For example:
110110

@@ -113,8 +113,6 @@ For example:
113113
ENABLE_HOF=False
114114
# user/password(s) for access to /grafana monitoring
115115
MONITORING_AUTH=user:welkom01
116-
# user/password(s) for access to web interface
117-
BASIC_AUTH=user:welkom01
118116
# allowed IP's to visit web interface without password
119117
ALLOW_LIST=198.51.100.1,2001:db8:2::1
120118
EOF

0 commit comments

Comments
 (0)