datatracker/ietf
Jennifer Richards 3705bedfcd
feat: Celery support and asynchronous draft submission API ()
* ci: add Dockerfile and action to build celery worker image

* ci: build celery worker on push to jennifer/celery branch

* ci: also build celery worker for main branch

* ci: Add comment to celery Dockerfile

* chore: first stab at a celery/rabbitmq docker-compose

* feat: add celery configuration and test task / endpoint

* chore: run mq/celery containers for dev work

* chore: point to ghcr.io image for celery worker

* refactor: move XML parsing duties into XMLDraft

Move some PlaintextDraft methods into the Draft base class and
implement for the XMLDraft class. Use xml2rfc code from ietf.submit
as a model for the parsing.

This leaves some mismatch between the PlaintextDraft and the Draft
class spec for the get_author_list() method to be resolved.

* feat: add api_upload endpoint and beginnings of async processing

This adds an api_upload() that behaves analogously to the api_submit()
endpoint. Celery tasks to handle asynchronous processing are added but
are not yet functional enough to be useful.

* perf: index Submission table on submission_date

This substantially speeds up submission rate threshold checks.

* feat: remove existing files when accepting a new submission

After checking that a submission is not in progress, remove any files
in staging that have the same name/rev with any extension. This should
guard against stale files confusing the submission process if the
usual cleanup fails or is skipped for some reason.

* refactor: make clear that deduce_group() uses only the draft name

* refactor: extract only draft name/revision in clean() method

Minimizing the amount of validation done when accepting a file. The
data extraction will be moved to asynchronous processing.

* refactor: minimize checks and data extraction in api_upload() view

* ci: fix dockerfiles to match sandbox testing

* ci: tweak celery container docker-compose settings

* refactor: clean up Draft parsing API and usage

  * remove get_draftname() from Draft api; set filename during init
  * further XMLDraft work
    - remember xml_version after parsing
    - extract filename/revision during init
    - comment out long broken get_abstract() method
  * adjust form clean() method to use changed API

* feat: flesh out async submission processing

First basically working pass!

* feat: add state name for submission being validated asynchronously

* feat: cancel submissions that async processing can't handle

* refactor: simplify/consolidate async tasks and improve error handling

* feat: add api_submission_status endpoint

* refactor: return JSON from submission api endpoints

* refactor: reuse cancel_submission method

* refactor: clean up error reporting a bit

* feat: guard against cancellation of a submission while validating

Not bulletproof but should prevent

* feat: indicate that a submission is still being validated

* fix: do not delete submission files after creating them

* chore: remove debug statement

* test: add tests of the api_upload and api_submission_status endpoints

* test: add tests and stubs for async side of submission handling

* fix: gracefully handle (ignore) invalid IDs in async submit task

* test: test process_uploaded_submission method

* fix: fix failures of new tests

* refactor: fix type checker complaints

* test: test submission_status view of submission in "validating" state

* fix: fix up migrations

* fix: use the streamlined SubmissionBaseUploadForm for api_upload

* feat: show submission history event timestamp as mouse-over text

* fix: remove 'manual' as next state for 'validating' submission state

* refactor: share SubmissionBaseUploadForm code with Deprecated version

* fix: validate text submission title, update a couple comments

* chore: disable requirements updating when celery dev container starts

* feat: log traceback on unexpected error during submission processing

* feat: allow secretariat to cancel "validating" submission

* feat: indicate time since submission on the status page

* perf: check submission rate thresholds earlier when possible

No sense parsing details of a draft that is going to be dropped regardless
of those details!

* fix: create Submission before saving to reduce race condition window

* fix: call deduce_group() with filename

* refactor: remove code lint

* refactor: change the api_upload URL to api/submission

* docs: update submission API documentation

* test: add tests of api_submission's text draft consistency checks

* refactor: rename api_upload to api_submission to agree with new URL

* test: test API documentation and submission thresholds

* fix: fix a couple api_submission view renames missed in templates

* chore: use base image + add arm64 support

* ci: try to fix workflow_dispatch for celery worker

* ci: another attempt to fix workflow_dispatch

* ci: build celery image for submit-async branch

* ci: fix typo

* ci: publish celery worker to ghcr.io/painless-security

* ci: install python requirements in celery image

* ci: fix up requirements install on celery image

* chore: remove XML_LIBRARY references that crept back in

* feat: accept 'replaces' field in api_submission

* docs: update api_submission documentation

* fix: remove unused import

* test: test "replaces" validation for submission API

* test: test that "replaces" is set by api_submission

* feat: trap TERM to gracefully stop celery container

* chore: tweak celery/mq settings

* docs: update installation instructions

* ci: adjust paths that trigger celery worker image  build

* ci: fix branches/repo names left over from dev

* ci: run manage.py check when initializing celery container

Driver here is applying the patches. Starting the celery workers
also invokes the check task, but this should cause a clearer failure
if something fails.

* docs: revise INSTALL instructions

* ci: pass filename to pip update in celery container

* docs: update INSTALL to include freezing pip versions

Will be used to coordinate package versions with the celery
container in production.

* docs: add explanation of frozen-requirements.txt

* ci: build image for sandbox deployment

* ci: add additional build trigger path

* docs: tweak INSTALL

* fix: change INSTALL process to stop datatracker before running migrations

* chore: use ietf.settings for manage.py check in celery container

* chore: set uid/gid for celery worker

* chore: create user/group in celery container if needed

* chore: tweak docker compose/init so celery container works in dev

* ci: build mq docker image

* fix: move rabbitmq.pid to writeable location

* fix: clear password when CELERY_PASSWORD is empty

Setting to an empty password is really not a good plan!

* chore: add shutdown debugging option to celery image

* chore: add django-celery-beat package

* chore: run "celery beat" in datatracker-celery image

* chore: fix docker image name

* feat: add task to cancel stale submissions

* test: test the cancel_stale_submissions task

* chore: make f-string with no interpolation a plain string

Co-authored-by: Nicolas Giard <github@ngpixel.com>
Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2022-08-22 13:29:31 -05:00
..
api feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
bin chore: remove unneeded logging and code marked unreachable that has not been reached. () 2022-08-04 11:25:31 -05:00
community fix: Remove unicode encode from CVS row writer () 2022-08-02 10:23:53 -05:00
cookies More fixes 2021-12-02 11:07:50 +00:00
database-notes
dbtemplate test: Validate HTML rendered during tests () 2022-04-07 13:30:38 -03:00
doc fix: correctly render wg shepherd writeups and test it. () 2022-08-11 16:21:52 -05:00
group feat: show expired WG/RG drafts at WG/RG Documents page () 2022-07-26 12:02:09 -05:00
help Added django-simple-history and replaced the old (and unused) PersonHistory class with a history=HistoricalRecords() field on Person. Added the needed migrations and changes to admin, resources, and settings. Related to issues and . 2018-04-27 17:36:20 +00:00
idindex Use temporary directories instead of "real" filesystem for tests. Fixes . Commit ready for merge. 2021-11-05 19:45:57 +00:00
iesg Hopefully the final check-ins. 2022-02-08 17:29:15 +00:00
ietfauth fix: do not set user template var in ietfauth views () 2022-07-15 13:37:25 -05:00
ipr chore: remove more tools.ietf.org server only related things. () 2022-06-22 14:11:46 -05:00
liaisons feat: only offer IAB/IESG members for bofreq responsible leadership () 2022-07-26 11:23:00 -05:00
mailinglists chore: remove unneeded logging and code marked unreachable that has not been reached. () 2022-08-04 11:25:31 -05:00
mailtrigger Use temporary directories instead of "real" filesystem for tests. Fixes . Commit ready for merge. 2021-11-05 19:45:57 +00:00
meeting fix: allow 90m session requests. Prompt for cannot meet at time reasoning. () 2022-08-19 09:11:44 -05:00
message Added matching indexes to a number of models with ordering by multiple keys. 2020-11-09 19:41:12 +00:00
name feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
nomcom feat(nomcom): Allow nomcom chair to turn volunteer acceptance on and off () 2022-07-24 08:51:57 -05:00
person feat: only offer IAB/IESG members for bofreq responsible leadership () 2022-07-26 11:23:00 -05:00
redirects Update internal references to trac.tools.ietf.org to point to trac.ietf.org. Remove several links into tools.ietf.org. Commit ready for merge. 2021-10-13 21:43:44 +00:00
release feat: reflect breaking change in internal release description () 2022-04-14 15:04:09 -05:00
review fix: avoid mutables as defaults. Compute date default arguments at runtime rather than loadtime. () 2022-07-06 14:39:36 -05:00
secr fix: allow 90m session requests. Prompt for cannot meet at time reasoning. () 2022-08-19 09:11:44 -05:00
static fix: use white ietf text logo in header () 2022-07-27 15:43:06 -05:00
stats chore: remove unneeded logging and code marked unreachable that has not been reached. () 2022-08-04 11:25:31 -05:00
submit feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
sync fix: improve person selection when receiving IANA email () 2022-05-20 16:20:26 -05:00
templates feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
utils feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
.gitignore feat: diff crawl docker tool () 2022-08-18 12:28:47 -05:00
.yarnrc Preliminary work on converting bower management of web resources to yarn. New management command, replacing bower_install will be needed. 2019-07-25 20:28:18 +00:00
__init__.py feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
celeryapp.py feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
checks.py Convert generate-draft-aliaes and generate-wg-aliases into management commands: generate_draft_aliases and generate_group_aliases. Also provide tests for the new management commands. 2021-03-13 17:30:35 +00:00
context_processors.py feat: improve release information in footer. () 2022-03-30 11:53:07 -03:00
feed_urls.py Changed urlpattern order to list the more specific of overlapping patterns first, and made the rfc feed per year pattern more permissive. 2017-12-04 16:32:58 +00:00
LICENSE
manage.py Moved warnings settings from manage.py and test_runner.py to one single place, settings.py. Decreased the verbosity level when invoking 'loaddata' from the test runner. 2016-12-15 13:25:20 +00:00
middleware.py Updated a middleware function to use the correct Py3 idiom to access exception arguments. 2020-09-21 12:39:00 +00:00
settings.py feat: Celery support and asynchronous draft submission API () 2022-08-22 13:29:31 -05:00
settings_sqlitetest.py chore: Use URL resolver in more places () 2022-06-22 14:10:16 -05:00
settings_testcrawl.py chore: improve ALLOWED_HOSTS in settings (ports are not useful there) () 2022-07-20 15:16:14 -05:00
urls.py fix: test web manifest () 2022-06-02 11:10:11 -05:00
virtualenv-manage.py More Py2/3 adaptations fetched from production. 2020-02-23 16:27:30 +00:00
wsgi.py Update internal references to trac.tools.ietf.org to point to trac.ietf.org. Remove several links into tools.ietf.org. Commit ready for merge. 2021-10-13 21:43:44 +00:00