Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quality of life fixes for batch test development #623

Merged
merged 8 commits into from
Nov 19, 2021

Conversation

maertsen
Copy link
Contributor

@maertsen maertsen commented Oct 18, 2021

This pull request includes improvements to the use of celery and docker while working on #30. Make sure to read through the individual commit messages, some changes impact the way batch environments are deployed.

I am happy to add a commit to add to the changelog once this PR has seen review.

@maertsen maertsen force-pushed the initial-batch-fixes branch 5 times, most recently from 967c599 to 8509120 Compare October 29, 2021 12:00
@maertsen maertsen changed the title Initial batch fixes Quality of life fixes for batch test development Oct 29, 2021
@baknu baknu added this to the v1.5 milestone Oct 29, 2021
@baknu baknu modified the milestones: v1.5, v1.6 Nov 12, 2021
Maarten Aertsen added 8 commits November 18, 2021 14:02
Made using `celery upgrade settings internetnl/settings.py-dist --django`

Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
This commit makes several changes to improve consistency:
  - rename `(checks.tasks.update.)ranking` to `update_hof`
  - refer to all tasks by their fully qualified path
  - configure schedule intervals in `internetnl/settings.py`
  - unconditionally define tasks, but only enable them when necessary in
    the scheduler. Ie. remove `if ENABLE_BATCH:` conditionals.

Fixes: 4407156

Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
This commit changes queue configuration in the following way:
  - move the scheduler to its own queue `batch_scheduler`
  - rename `worker_slow` to `batch_slow` for the batch_async* tasks

This change necessitates a configuration change to the way Celery is
started. Assign workers to the two queues defined above.

To retain the previous mapping between queues and workers,
explicitly map the `batch_scheduler` and `worker_slow` to the worker
that previously implicitly worked the default the `celery` queue.

Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
To enable the batch test prior to this change, it was necessary to set
`ENABLE_BATCH = True` and to remove the `CELERY_TASK_ROUTES` for the
frontend. This commit simply enables both when `ENABLE_BATCH = True`.

The effect of this change is that frontend tasks are routed to the same
celery queues regardless of whether the batch testing facility is
enabled. This simplifies understanding of the system.

This change necessitates a configuration change to the way Celery is
started. Assign workers to the `db_worker` and `slow_db_worker` queues.

Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
Simplify developing for the batch test by extending the existing docker
setup. To activate the batch test in docker, do the following:

```
cd docker/
export ENABLE_BATCH=True
docker-compose up -d && docker-compose logs -f
```

Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
Signed-off-by: Maarten Aertsen <maarten.aertsen@ncsc.nl>
@maertsen maertsen force-pushed the initial-batch-fixes branch from 590095f to e00d6cc Compare November 18, 2021 13:02
@maertsen
Copy link
Contributor Author

@baknu the RPKI bits scheduled for v1.5 have been developed based on this PR. I can decouple them if necessary, but from my perspective if this PR is going to be merged at all it makes sense to include it in v1.5.

@sinteur sinteur merged commit 88d2145 into internetstandards:master Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants