Skip to content

Refactor the cpu limit check - #4373

Open
sidtuladhar wants to merge 6 commits into
masterfrom
u/sidtuladhar/PAASTA-18929/validate-stable-pool
Open

Refactor the cpu limit check#4373
sidtuladhar wants to merge 6 commits into
masterfrom
u/sidtuladhar/PAASTA-18929/validate-stable-pool

Conversation

@sidtuladhar

@sidtuladhar sidtuladhar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Refactor the cpu limit check:

  • remove recommended pool
  • require comment next to cpu in yelpsoa to override

@sidtuladhar
sidtuladhar requested a review from a team as a code owner August 14, 2026 11:12
@sidtuladhar sidtuladhar changed the title U/sidtuladhar/paasta 18929/validate stable pool Refactor the cpu limit check Aug 14, 2026
Comment thread paasta_tools/cli/cmds/validate.py Outdated
Comment on lines +971 to +975
config_file_path = os.path.join(
soa_dir,
service,
f"{instance_config.get_instance_type()}-{cluster}.yaml",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mbrankin-art has a nice helper for this in his validation PR, but if this gets merged first, we can always switch this to the new helper later :p

Comment on lines +966 to +967
if instance_config.get_instance_type() not in ("kubernetes", "eks"):
continue

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think similar to mbrankin's PR: we might want to use PaastaServiceConfigLoader so that we can quickly filter and just load the configs we care about

Comment thread paasta_tools/cli/cmds/validate.py Outdated
returncode = False
print(
failure(
f"{service}.{instance} in {cluster} has {cpu} CPUs, which exceeds the limit of {pool_limits['max_cpus']} for the {pool} pool."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
f"{service}.{instance} in {cluster} has {cpu} CPUs, which exceeds the limit of {pool_limits['max_cpus']} for the {pool} pool."
f"{service}.{instance} in {cluster} has {cpu} CPUs, which exceeds the recommended limit of {pool_limits['max_cpus']} for the {pool} pool."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and hmm, maybe we want to also include what the true max is so that folks don't try to do something like cpus: 512 during an incident to give something a ton of resources and get confused as to why stuff isn't running :p

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

my concern for adding a true max is that we'd always need to have it updated with whatever the max we've set in the karpenter nodepool. In your experience, do engineers just use an unrealistic big number during DARs for mitigation? In most cases, if they do double the CPU + override comment should go to the fallback pool ig

Comment thread paasta_tools/cli/cmds/validate.py Outdated
@sidtuladhar
sidtuladhar requested a review from nemacysts August 18, 2026 11:25
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