Skip to content

feat(docker): Depends_on based on initializer #12584

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

kiblik
Copy link
Contributor

@kiblik kiblik commented Jun 10, 2025

This change blocks the start of uwsgi, celerybeat, and celeryworker until initializer is not completed_successfully. This is useful for:

  • avoiding errors in uwsgi, celerybeat, and celeryworker during start-up when the db is not ready
  • make it easier to identify errors with initializer (they might get easily lost within other logs).

@kiblik kiblik marked this pull request as ready for review June 10, 2025 17:26
@kiblik kiblik requested review from Maffooch and mtesauro as code owners June 10, 2025 17:26
Copy link

DryRun Security

No security concerns detected in this pull request.


All finding details can be found in the DryRun Security Dashboard.

Copy link
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! What happens when there is an error in the initializer? I guess it just fails with an error and the other containers are never started?

@valentijnscholten valentijnscholten added this to the 2.48.0 milestone Jun 11, 2025
@kiblik
Copy link
Contributor Author

kiblik commented Jun 11, 2025

Cool! What happens when there is an error in the initializer? I guess it just fails with an error and the other containers are never started?

Exactly (well, except psql and redis - they do not use dependency, so they would still be running)

For testing, I changed models.py, did not prepare migrations, initializer failed, and the whole process of startup stopped (docker did not touch uwsgi, nginx or celery*). This was the last message before coming back to bash.

service "initializer" didn't complete successfully: exit 1

@Maffooch Maffooch requested a review from dogboat June 12, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants