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

Feature/dpm 174 data hub api investigate rq health check #5266

Conversation

marijnkampf
Copy link
Contributor

@marijnkampf marijnkampf commented Mar 18, 2024

Description of change

Add RQ health check.

A health check has been added to docker-compose.yml for rq_short and rq_long processes.

If you run docker ps you should now see (healthy) status for the rq_short and rq_long processes.

CONTAINER ID   IMAGE                                 COMMAND                  CREATED        STATUS                 PORTS                                                  NAMES
58049321c036   data-hub-rq_long                      "dockerize -wait tcp…"   2 hours ago    Up 2 hours (healthy)   8000/tcp                                               data-hub-rq_long-1
6009bc581e40   data-hub-rq_sched                     "dockerize -wait tcp…"   2 hours ago    Up 2 hours             8000/tcp                                               data-hub-rq_sched-1
3649fedd1029   data-hub-rq_short                     "dockerize -wait tcp…"   2 hours ago    Up 2 hours (healthy)   8000/tcp                                               data-hub-rq_short-1
81177123cc36   data-hub-api                          "dockerize -wait tcp…"   2 hours ago    Up 17 minutes          0.0.0.0:8000->8000/tcp                                 data-hub-api-1
16f270556a25   mdawar/rq-exporter:latest             "python -m rq_export…"   25 hours ago   Up 2 hours             0.0.0.0:9726->9726/tcp                                 data-hub-rq_exporter-1
08a03f6a74db   opensearchproject/opensearch:2.11.0   "./opensearch-docker…"   25 hours ago   Up 2 hours             9300/tcp, 9600/tcp, 0.0.0.0:9200->9200/tcp, 9650/tcp   data-hub-opensearch-1
afa1849decc2   redis:7.2.4                           "docker-entrypoint.s…"   25 hours ago   Up 2 hours             0.0.0.0:6379->6379/tcp                                 data-hub-redis-1
735eea5e99d9   postgres:16                           "docker-entrypoint.s…"   25 hours ago   Up 2 hours             0.0.0.0:5432->5432/tcp                                 data-hub-postgres-1

Checklist

  • Has this branch been rebased on top of the current main branch?

    Explanation

    The branch should not be stale or have conflicts at the time reviews are requested.

  • Is the CircleCI build passing?

General points

Other things to check

  • Make sure fixtures/test_data.yaml is maintained when updating models
  • Consider the admin site when making changes to models
  • Use select-/prefetch-related field lists in views and search apps, and update them when fields are added
  • Make sure the README is updated e.g. when adding new environment variables

See docs/CONTRIBUTING.md for more guidelines.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.61%. Comparing base (30fa6dd) to head (c69f824).

Additional details and impacted files
@@                 Coverage Diff                  @@
##           migration-deploy    #5266      +/-   ##
====================================================
+ Coverage             96.56%   96.61%   +0.04%     
====================================================
  Files                   915      916       +1     
  Lines                 21631    21658      +27     
  Branches               1932     1935       +3     
====================================================
+ Hits                  20888    20924      +36     
+ Misses                  602      595       -7     
+ Partials                141      139       -2     

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

@marijnkampf marijnkampf changed the base branch from main to migration-deploy March 19, 2024 13:23
@marijnkampf marijnkampf force-pushed the feature/DPM-174-Data-Hub-API-Investigate-RQ-health-check branch from cf8e129 to 2d40f8e Compare March 21, 2024 09:28
@marijnkampf marijnkampf force-pushed the migration-deploy branch 2 times, most recently from a33524a to 30fa6dd Compare March 21, 2024 12:25
@marijnkampf marijnkampf force-pushed the feature/DPM-174-Data-Hub-API-Investigate-RQ-health-check branch from c9f9483 to c69f824 Compare March 21, 2024 12:25
@marijnkampf marijnkampf marked this pull request as ready for review March 21, 2024 14:00
@marijnkampf marijnkampf requested a review from a team as a code owner March 21, 2024 14:00
Copy link
Contributor

@code-review-doctor code-review-doctor bot left a comment

Choose a reason for hiding this comment

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

Some food for thought. View full project report here.

redis = Redis.from_url(settings.REDIS_BASE_URL)
workers = Worker.all(connection=redis)
queue_names = reduce(concat, [worker.queue_names() for worker in workers], [])
missing_queues = set([queue]) - set(queue_names)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
missing_queues = set([queue]) - set(queue_names)
missing_queues = {queue} - set(queue_names)

Using set literal syntax is simpler and computationally quicker. Explained here.

@marijnkampf marijnkampf merged this pull request into migration-deploy Mar 21, 2024
4 checks passed
@marijnkampf marijnkampf deleted the feature/DPM-174-Data-Hub-API-Investigate-RQ-health-check branch March 21, 2024 14:07
marijnkampf added a commit that referenced this pull request Mar 28, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
marijnkampf added a commit that referenced this pull request Apr 2, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
bau123 pushed a commit that referenced this pull request Apr 9, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
bau123 pushed a commit that referenced this pull request Apr 9, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
marijnkampf added a commit that referenced this pull request May 20, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
marijnkampf added a commit that referenced this pull request Jul 1, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
cgsunkel pushed a commit that referenced this pull request Jul 15, 2024
* Create Command for rq health check and include in docker-compose.yml configuration.
cgsunkel added a commit that referenced this pull request Jul 15, 2024
* Update codeowners

* Add sample rate to sentry (#5532)

* Add sample rate to sentry

* Add new action for govpaas branch

* Bump django from 4.2.11 to 4.2.14 (#5536)

Bumps [django](https://github.com/django/django) from 4.2.11 to 4.2.14.
- [Commits](django/django@4.2.11...4.2.14)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add new fields to sentry config (#5537)

* Remove migration actions (#5538)

* Update redis

* Update open search

* Update pingdom end point url

* Feature/dpm 174 data hub api investigate rq health check (#5266)

* Create Command for rq health check and include in docker-compose.yml configuration.

* DPM 199 Data Hub API logging (#5304)

* Change logging to ASIM formatter

* Update common_logging.py

* do not run collectstatic at run time on DBT Platform

* add build configuration for DBT Platform

* remove debug setup

* Migration/DPM 343 Data Hub API application settings (#5340)

* Change DATABASE_URL connection string to DATABASE_CREDENTIALS containing JSON structure.

* update database environment for build job

* Rename reserved environment variables (#5345)

* Debug: DBT Platform

* Debug: metadata hawk authentication

* Debug: DBT Patch

* Debug: test on sector filter

* Debug: Hawk

* Undo debugging

* Fix Flake8 Missing newline between import groups (#5457)

* TET 801 Stop Opensearch addess showing credentials (#5519)

* Stop showing open search credentials on connection error.
* Allow for setting of pool maxsize on open search connection.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Christopher <christopher.sunkel@digital.trade.gov.uk>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lawrence Goldstien <lawrence.goldstein@digital.trade.gov.uk>
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.

2 participants