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

Docker / Docker-compose improvements #1314

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Conversation

joeribekker
Copy link
Member

@joeribekker joeribekker commented Jul 17, 2024

Changed Dockerfile to more closely follow Open Forms.

  • Added os upgrade to be sure the libraries as up to date as possible everytime the image is built.
  • Replaced vim with nano (I left curl in for you A)
  • Used uv instead of pip (super fast drop in replacement)
  • Compile translatable messages during build
  • Added Celery beat script
  • Added proper release scheme attributes

Added Celery beat, monitor and health check.

  • There was 1 container reserved for all Celery related things:
    worker, beat and monitoring. According to Celery documentation
    it's best to have a separate Beat process so you can scale
    separately. Also, combining monitoring with the events itself
    could cause issues. Everything is separated now.

  • Additional health checks and dependancies are introduced to
    Docker-compose so Celery nicely waits for the database to be
    prepped.

@joeribekker joeribekker requested a review from sjoerdie July 17, 2024 13:58
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.

Project coverage is 95.12%. Comparing base (f5137ee) to head (52928c8).

Files Patch % Lines
src/open_inwoner/celery.py 69.56% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1314      +/-   ##
===========================================
- Coverage    95.14%   95.12%   -0.02%     
===========================================
  Files          993      993              
  Lines        36100    36121      +21     
===========================================
+ Hits         34347    34361      +14     
- Misses        1753     1760       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joeribekker joeribekker force-pushed the feature/docker-love branch from e7a37c8 to 68003ba Compare July 18, 2024 17:13
docker-compose.yml Outdated Show resolved Hide resolved
@joeribekker joeribekker force-pushed the feature/docker-love branch 2 times, most recently from 609a0f3 to 8e8e3ab Compare July 25, 2024 14:34
@joeribekker joeribekker force-pushed the feature/docker-love branch from 8e8e3ab to 9b1664f Compare July 25, 2024 14:47
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
bin/celery_beat.sh Outdated Show resolved Hide resolved
bin/celery_monitor.sh Show resolved Hide resolved
bin/celery_worker.sh Show resolved Hide resolved
bin/docker_start.sh Show resolved Hide resolved
bin/start_celery.sh Outdated Show resolved Hide resolved
bin/start_celery.sh Outdated Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
- Added os upgrade to be sure the libraries as up to date as possible everytime the image is built.
- Replaced vim with nano
- Used uv instead of pip (super fast drop in replacement)
- Compile translatable messages during build
- Added proper release scheme attributes
- Separated Celery into worker, beat and monitor containers
- Added additional health checks to steer the ordering of container-startup

There was 1 container reserved for all Celery related things:
worker, beat and monitoring. According to Celery documentation
it's best to have a separate Beat process so you can scale
separately. Also, combining monitoring with the events itself
could cause issues. Everything is separated now.

Additional health checks and dependancies are introduced to
Docker-compose so Celery nicely waits for the database to be
prepped.
@joeribekker joeribekker merged commit d176a89 into develop Jul 26, 2024
20 checks passed
@joeribekker joeribekker deleted the feature/docker-love branch July 26, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants