Skip to content

Mutate request instances based on existing request - #2266

Merged
rosalind210 merged 4 commits into
masterfrom
allow_empty_instance_requests
Mar 2, 2022
Merged

Mutate request instances based on existing request#2266
rosalind210 merged 4 commits into
masterfrom
allow_empty_instance_requests

Conversation

@rosalind210

Copy link
Copy Markdown
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.


private boolean skipPersistingTooLongTaskIds = false;

private boolean allowSettingRequestInstances = false;

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@WH77 WH77 left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants