-
Notifications
You must be signed in to change notification settings - Fork 31
Resource limits now also from services key; Added tests #1173
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 file(s) reviewed, 11 comment(s)
Edit PR Review Bot Settings | Greptile
Eco CI Output:
🌳 CO2 Data: Total cost of whole PR so far: |
* main: (27 commits) Bump orjson from 3.10.16 to 3.10.18 (#1168) Bump pydantic from 2.11.3 to 2.11.4 (#1169) Bump psycopg[binary] from 3.2.6 to 3.2.7 (#1171) Resource limits now also from services key; Added tests (#1173) (fix): Cron job queue check logic was reversed Updated ee Moving [system] and [machine] to upper case Shortened model Watchlist must insert usage_scenario_variables Comment for MCP Job ID now a field to filter by Usage Scenario Variables and ScenarioRunner templates (#1172) Disabled providers are now removed also from DB entry not only from effective measurement (fix): Entries for config options that were null where not correctly showing Made temperatur error more helpful Typo Root DIR of GMT was not accurate Renamed Runner to ScenarioRunner and moved to lib/ Software add now returns job_id on insert; Jobs API now allows filter for job_id [skip ci] (#1170) (test-fix): New wording ...
Greptile Summary
Added comprehensive testing and validation for Docker container resource limits, ensuring consistent configuration between service-level and deploy.resources.limits specifications.
This PR reworks how GMT handles Resource Limits.
Previously this was done through the deploy key in services.
However this key is intended for Docker Swarm.
GMT now also support the cpus and mem_limit keys under services.
When using Docker Compose directly the deploy settings for CPU and Memory have no further implications and will just overwrite any settings given via services top level keys. Implementation is here: https://github.com/docker/compose/blob/5bb46035cf12e5b2fc2f3b09522a392b7b753120/pkg/compose/create.go#L713
lib/schema_checker.py
to enforce memory limits as strings and CPU limits as string/float/inttests/test_resource_limits.py
to verify matching CPU/memory limits between deploy and service-level configslib/scenario_runner.py
to properly handle and apply resource limits from both configuration locationstests/data/usage_scenarios/
for various resource limit scenarios including invalid configurations