-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
root: move database calls from ready() to dedicated startup signal #9081
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
fd5af82
to
a7b203d
Compare
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-ghcr.io/goauthentik/dev-server:gh-7c692bb652cb03e73df0377a845c8f26e8bb92e4
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s For arm64, use these values: AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-ghcr.io/goauthentik/dev-server:gh-7c692bb652cb03e73df0377a845c8f26e8bb92e4-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s Afterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-ghcr.io/goauthentik/dev-server:gh-7c692bb652cb03e73df0377a845c8f26e8bb92e4 For arm64, use these values: authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-ghcr.io/goauthentik/dev-server:gh-7c692bb652cb03e73df0377a845c8f26e8bb92e4-arm64 Afterwards, run the upgrade commands from the latest release notes. |
c1bd800
to
35facad
Compare
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
we didn't really use it to do anything, and we shouldn't have to since the live/ready probes are handled by django anyways and so the container runtime will restart the server if needed Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This reverts commit 16778fd.
This reverts commit a129f7a. Signed-off-by: Jens Langhammer <jens@goauthentik.io> # Conflicts: # authentik/root/settings.py
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
e2faadb
to
7c692bb
Compare
* main: root: fix missing imports after #9081 (#9106) root: move database calls from ready() to dedicated startup signal (#9081) web: fix console log leftover (#9096) web: bump the eslint group in /web with 2 updates (#9098) core: bump twilio from 9.0.2 to 9.0.3 (#9103) web: bump the eslint group in /tests/wdio with 2 updates (#9099) core: bump drf-spectacular from 0.27.1 to 0.27.2 (#9100) core: bump django-model-utils from 4.4.0 to 4.5.0 (#9101) core: bump ruff from 0.3.4 to 0.3.5 (#9102) website/docs: update notes on SECRET_KEY (#9091) web: fix broken locale compile (#9095) website/integrations: add outline knowledge base (#8786) website/docs: fix typo (#9082) website/docs: email stage: fix example translation error (#9048)
Details
This started out as an attempt to get rid of the Django 5.x deprecation message saying to not do database calls in the AppConfig's ready() call.
The PR introduces a couple new signals for startup logic, and the signals are triggered by either the
dev_server
command or gunicorn'spost_worker_init
hook. To not change too much of the startup logic, the ManagedAppConfig connects to those new signals to call its startup reconcilers.There's also an optimisation in this PR; for gunicorn the signal is only triggered for the first worker as all required things such as importing modules is not handled by this signal, and thus it is enough to know that the startup reconcilers were triggered once per gunicorn process.
There's also a nice side-effect of speeding up the startup as startup tasks are no longer run when migrating
Checklist
ak test authentik/
)make lint-fix
)If an API change has been made
make gen-build
)If changes to the frontend have been made
make web
)If applicable
make website
)