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

Native configuration supports Azure low-priority or spot VMs #4526

Closed
adamrtalbot opened this issue Nov 20, 2023 · 6 comments · Fixed by #4527
Closed

Native configuration supports Azure low-priority or spot VMs #4526

adamrtalbot opened this issue Nov 20, 2023 · 6 comments · Fixed by #4527
Milestone

Comments

@adamrtalbot
Copy link
Collaborator

adamrtalbot commented Nov 20, 2023

New feature

The Azure Batch autoscaling formula does not support low-priority or spot virtual machines. You can manually add them using a custom formula, but we could expose this as a simple option. See the Microsoft blog for a demonstration:

#4236

Usage scenario

Using low priority or spot machines.

Suggest implementation

Modify this block and replace $TargetDedicatedNodes with $TargetLowPriorityNodes when this option is enabled.

@pditommaso
Copy link
Member

pditommaso commented Nov 20, 2023

Horrible. Isn't there an option to control it via pool settings?

@pditommaso
Copy link
Member

pditommaso commented Nov 20, 2023

Look at PoolAddParameter

    /**
     * Set this property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both.
     *
     * @param targetLowPriorityNodes the targetLowPriorityNodes value to set
     * @return the PoolAddParameter object itself.
     */
    public PoolAddParameter withTargetLowPriorityNodes(Integer targetLowPriorityNodes) {
        this.targetLowPriorityNodes = targetLowPriorityNodes;
        return this;
    }

final interval = spec.opts.scaleInterval.seconds as int
poolParams
.withEnableAutoScale(true)
.withAutoScaleEvaluationInterval( new Period().withSeconds(interval) )
.withAutoScaleFormula(scaleFormula(spec.opts))

@pditommaso pditommaso linked a pull request Nov 20, 2023 that will close this issue
@pditommaso
Copy link
Member

Drafted an initial implementation. Likely the scaling formula needs to be updated when lowPriority is enabled.

@pditommaso pditommaso added this to the 23.12.0-edge milestone Nov 20, 2023
@pditommaso

This comment was marked as off-topic.

@pditommaso

This comment was marked as off-topic.

@adamrtalbot
Copy link
Collaborator Author

Likely the scaling formula needs to be updated when lowPriority is enabled.

Correct. We 'just' need to use $TargetLowPriorityNodes instead of $TargetDedicatedNodes in the formula so shouldn't be too difficult: https://learn.microsoft.com/en-us/azure/batch/batch-automatic-scaling#read-write-service-defined-variables

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 a pull request may close this issue.

2 participants