Commit graph

21 commits

Author SHA1 Message Date
Kesara Rathnayake b8c6cb34dd
chore: Remove obsolete version attribute (#7931) 2024-09-12 16:28:44 -05:00
Robert Sparks 73137364cc
chore: rename test settings and shorten runserver instructions (#6131) 2023-08-11 11:21:38 -05:00
Darrel 98634ea27b
chore(dev): fails to build a container in a GitHub Codespace (#6006) 2023-07-22 13:24:41 -04:00
Nicolas Giard f3831de3ef
chore(dev): fix internal static proxy + add /pgadmin to reverse-proxy (#5809) 2023-06-13 10:56:11 -05:00
Jennifer Richards b7dd8b9b95
chore: Restart celery worker on source changes (#5749)
* chore: Restart celery worker on Python source change

* chore: Debounce celery restarts, only watch ietf dir
2023-06-08 14:13:46 -05:00
Nicolas Giard 03a192b54c
chore: add nginx reverse proxy to dev environment (#5745)
* chore: add nginx reverse proxy to dev environment

* chore: replace settings_local in docker and backup old
2023-06-05 16:47:06 -05:00
Nicolas Giard 0a11892414
chore: use variable for static.ietf.org references (#5692) 2023-05-25 17:23:18 -05:00
Nicolas Giard 82d0d42b28
chore: add pgadmin to dev environment 2023-04-25 18:02:34 -04:00
Nicolas Giard 03ae3f809f
chore: update docker-compose.yml for new db image 2023-04-18 16:34:55 -04:00
Jim Fenton 0f1a6c960f
chore: Update test docs to postgresql; remove extraneous sqlite stuff (#5400)
* chore: Update test docs to postgresql; remove extraneous sqlite stuff

* Reverted addition of settings_postgrestest.py to .gitignore
2023-03-29 10:45:03 +09:00
Nicolas Giard a60d52253e
chore: use prebuilt pg db image in dev (#4890) 2022-12-15 14:00:51 -06:00
Robert Sparks 27fccc6ba0
feat: move to postgresql (#4744)
* feat: move to postgresql

* fix: repair fractional replace statement

* fix: use pathlib to manipulate settings_local

Co-authored-by: Jennifer Richards <jennifer@painless-security.com>

* fix: do two string replacements, not one followed by another that throws away the first.

Co-authored-by: Jennifer Richards <jennifer@painless-security.com>

* fix: use pathlib again to manipulate settings_local

Co-authored-by: Jennifer Richards <jennifer@painless-security.com>

* fix: properly use assert (1/2)

Co-authored-by: Jennifer Richards <jennifer@painless-security.com>

* fix: properly use assert (2/2)

Co-authored-by: Jennifer Richards <jennifer@painless-security.com>

Co-authored-by: Jennifer Richards <jennifer@painless-security.com>
2022-11-11 11:01:01 +00:00
Lars Eggert 67e0d74a20
feat: Set DISPLAY env, so X11 apps show on the host (#4509) 2022-10-17 09:50:24 -05:00
Jennifer Richards a3f2d4bdc0
chore: run checks using celery UID/GID in container (#4364)
* chore: run checks as celery uid/gid in celery container

* chore: add init flag to suggested beat container config
2022-08-24 13:00:01 -05:00
Jennifer Richards 727feabfff
chore: create stale submission cleanup task and other deployment tweaks (#4358)
* chore: disable beat container for dev

* chore: use init option with celery container

* chore: create cancel_stale_submissions task via migration

* chore: revert accidental change included in last commit

* chore: terminate celery docker-init.sh on failed command
2022-08-24 12:29:48 -05:00
Jennifer Richards 3705bedfcd
feat: Celery support and asynchronous draft submission API (#4037)
* 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
Nicolas Giard 52b51e4962
ci: fix db container 2022-07-28 17:35:26 -04:00
Nicolas Giard e02ce05612
chore: make /assets a named volume for dev container (#4018)
* chore: make /assets a static volume for dev container

* chore: fix create-dirs script to point to /assets
2022-05-31 16:43:29 -05:00
Nicolas Giard 742ce5a08e
chore: make dev container use base image 2022-05-24 16:49:37 -04:00
Robert Sparks 55d7629e4d
chore: use and expect python39 (#3908) 2022-04-29 09:45:41 -05:00
Robert Sparks aa718e7e98
chore: bring docker-compose to root level (#3642) (#3643)
Authored-by: Nicolas Giard <github@ngpixel.com>
2022-03-14 17:17:31 -05:00
Renamed from docker/docker-compose.yml (Browse further)