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

Mutate request instances based on existing request #2266

Merged
merged 4 commits into from
Mar 2, 2022

Conversation

rosalind210
Copy link
Contributor

We want to start allowing deploys with Singularity Requests that have an empty instances field and instead of failing to deploy, those requests will take on the instance count of the existing Singularity Request.

The new code path behind the config value allowSettingRequestInstances will check checkBadRequest for both the new request has empty instances and the existing request being empty/empty instances. If the existing request isn't empty && doesn't have an empty instances field and the current request has empty instances, then the current request is updated to have the existing request's instance count.

@@ -453,6 +453,8 @@

private boolean skipPersistingTooLongTaskIds = false;

private boolean allowSettingRequestInstances = false;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe allowEmptyRequestInstances might be easier to reason about for naming? This makes it sounds like we previously didn't let anyone set it but now we do, when what we are going after is the opposite

Comment on lines 244 to 247
if (
existingRequest.flatMap(SingularityRequest::getInstances).isPresent() &&
!request.getInstances().isPresent()
) {
Copy link
Member

Choose a reason for hiding this comment

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

quick thought, should this only apply to SERVICE/WORKER types? I think it is a valid operation to want to unset the instance count for an ON_DEMAND, effectively removing the instance count cap for that. With the validation as it stands we would no longer be able to do that

Copy link
Contributor

@WH77 WH77 left a comment

Choose a reason for hiding this comment

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

🚢

@rosalind210 rosalind210 merged commit 2adac4e into master Mar 2, 2022
@rosalind210 rosalind210 deleted the allow_empty_instance_requests branch March 2, 2022 20:08
@ssalinas ssalinas added this to the 1.5.0 milestone May 4, 2022
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.

None yet

3 participants