Skip to content

Conversation

@MoralCode
Copy link
Contributor

@MoralCode MoralCode commented Oct 23, 2025

Description
This pr removes the worker_process_vmem_cap config item and replaces it with a configurable count per worker:

  • core_worker_count
  • secondary_worker_count
  • facade_worker_count

We default these values to 5 workers each because we anticipate most users getting started with docker will be likely running on laptops. We plan to document that these values should be changed in production as part of that issue ( #3249 )

This makes managing the tasks more intuitive for augur admins.

Notes for Reviewers
When running this, you will need to ensure that the database values are reset based on the hardcoded defaults in order for these values to exist in your config table. There is no migration for adding this and I do not plan to add one.

Signed commits

  • Yes, I signed my commits.

@MoralCode MoralCode requested a review from sgoggins as a code owner October 23, 2025 20:25
@MoralCode MoralCode changed the title Remove worker vmem replace worker vmem config item with individual process counts Oct 23, 2025
logger.info(f"The API is available at '{api_response.json()['route']}'")

processes = start_celery_worker_processes(float(worker_vmem_cap), disable_collection)
processes = start_celery_worker_processes((core_worker_count, secondary_worker_count, facade_worker_count), disable_collection)

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'processes' from outer scope (line 479) (redefined-outer-name)

@MoralCode
Copy link
Contributor Author

given that this had to be updated in two places, I'm also curious if one of the functions can be entirely removed.

Also this probably still needs updating to adjust the place in the code where the tasks are actually added to the queues

Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

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

@MoralCode : Have you at least started this on your dev machine and run it ?... Ordinarily I assume that, but unwinding these changes could amount to a bunch of work if it breaks anything. .. so, asking even though I suspect the answer is "yes". :)

@sgoggins
Copy link
Member

@MoralCode : ah .. looks like this one is breaking docker builds.

@MoralCode MoralCode force-pushed the remove-worker-vmem branch 2 times, most recently from dfaa582 to fe7a40e Compare October 27, 2025 18:17
@MoralCode MoralCode force-pushed the remove-worker-vmem branch 2 times, most recently from 4f8fa26 to 938071c Compare October 29, 2025 21:20
@MoralCode MoralCode linked an issue Oct 29, 2025 that may be closed by this pull request
@sgoggins
Copy link
Member

@MoralCode : What are thinking re: docker build failure? Wait to merge until it passes, or solve it on another PR?

Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

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

Do we need to add rows to the config table? Seems like it?

os.environ["AUGUR_DISABLE_COLLECTION"] = "1"

worker_vmem_cap = get_value("Celery", 'worker_process_vmem_cap')
core_worker_count = get_value("Celery", 'core_worker_count')
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add values to the database?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, but thats why i filed #3356 - the values and sensible defaults already exist in the config.py file, and I think we should have the application insert them if something tries to access them and it cannot find the value. Then users dont need to run some manual command and we can keep the DB migrations limited to only structural fixes

@MoralCode MoralCode added the config Items related to configuring augur settings/state to change how it behaves label Oct 30, 2025
@MoralCode MoralCode added this to the v0.91.0 Release milestone Oct 30, 2025
@MoralCode
Copy link
Contributor Author

Works on my machine (and also with augur.json - although with some fiddling because podman permissions).

@MoralCode MoralCode added the ready Items tested and seeking additional approvals or a merge. Usually for items under active development label Nov 3, 2025
@sgoggins sgoggins self-assigned this Nov 4, 2025
Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

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

LGTM; need to fix the CI build issue

@sgoggins
Copy link
Member

sgoggins commented Nov 4, 2025

Docker image build still failing, @MoralCode

@MoralCode
Copy link
Contributor Author

Rerunning. cant see an obvious error besides failing to clone chaoss/whitepaper.....

Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

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

I think we have worked this one pretty close to the nub ... @MoralCode : Any reservations about merging?

@MoralCode
Copy link
Contributor Author

I think we have worked this one pretty close to the nub ... @MoralCode : Any reservations about merging?

nope, good to merge!

…r each thing

This is a tuple so it can potentially scale up without impacting the method signature

Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
@sgoggins sgoggins merged commit 934560d into main Nov 10, 2025
15 checks passed
@sgoggins sgoggins deleted the remove-worker-vmem branch November 12, 2025 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Items related to configuring augur settings/state to change how it behaves ready Items tested and seeking additional approvals or a merge. Usually for items under active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow admins to control resource usage of Augur

2 participants