Skip to content

Scaler apis#9131

Merged
alrod merged 6 commits intodevfrom
alrod/sc-redesign3
Apr 3, 2023
Merged

Scaler apis#9131
alrod merged 6 commits intodevfrom
alrod/sc-redesign3

Conversation

@alrod
Copy link
Copy Markdown
Member

@alrod alrod commented Mar 3, 2023

Issue describing the changes in this PR

resolves #9182

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

Additional PR information

@alrod alrod requested a review from a team as a code owner March 3, 2023 22:10
@liliankasem
Copy link
Copy Markdown
Member

Please link a related issue and/or update PR description with details on changes made - thanks!

Comment thread src/WebJobs.Script/ScriptHostBuilderExtensions.cs Outdated
Comment thread src/WebJobs.Script.WebHost/Controllers/HostController.cs Outdated
Comment thread src/WebJobs.Script/ScriptHostBuilderExtensions.cs Outdated
@alrod alrod requested a review from mathewc March 15, 2023 16:24
Comment thread src/WebJobs.Script.WebHost/Controllers/HostController.cs Outdated
Comment thread src/WebJobs.Script/Config/ScaleOptionsSetup.cs Outdated
@alrod alrod force-pushed the alrod/sc-redesign3 branch from 39af175 to cce9baf Compare March 24, 2023 22:46
@alrod alrod requested a review from mathewc March 25, 2023 00:32
// FunctionsScaleManager as a parameter.
if (Utility.TryGetHostService(scriptHostManager, out FunctionsScaleManager scaleManager))
// ScaleManager as a parameter.
if (Utility.TryGetHostService(scriptHostManager, out IScaleStatusProvider scaleManager))
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.

naming/comments no longer match type

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.

nit: one more in Line 330: FunctionsScaleManager does not exist anymore

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.

Change the name of the parameter to match as well - "scaleStatusProvider"

Comment thread src/WebJobs.Script.WebHost/WebScriptHostBuilderExtension.cs
Comment thread src/WebJobs.Script/Config/ScaleOptionsSetup.cs Outdated
Comment thread src/WebJobs.Script/ScriptHostBuilderExtensions.cs Outdated
Comment thread src/WebJobs.Script/ScriptHostBuilderExtensions.cs
Comment thread test/WebJobs.Script.Tests/Controllers/Admin/HostControllerTests.cs Outdated
Comment thread test/WebJobs.Script.Tests/Scale/ScaleMonitorServiceTests.cs Outdated
Comment thread test/WebJobs.Script.Tests/Scale/ScaleMonitorServiceTests.cs Outdated
@fabiocav
Copy link
Copy Markdown
Member

Please link a related issue and/or update PR description with details on changes made - thanks!

Can you please follow up on this comment from @liliankasem or provide more information in the PR description?

@alrod alrod requested a review from mathewc March 28, 2023 22:42
Copy link
Copy Markdown
Member

@pragnagopa pragnagopa left a comment

Choose a reason for hiding this comment

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

added minor comments

Comment thread test/WebJobs.Script.Tests/Configuration/ScaleMonitorOptionsSetupTests.cs Outdated
Comment thread test/WebJobs.Script.Tests/Configuration/ScaleMonitorOptionsSetupTests.cs Outdated
Comment thread test/WebJobs.Script.Tests/Scale/FunctionsScaleManagerTests.cs
@alrod alrod requested a review from pragnagopa April 3, 2023 16:57
// This case should never happen. Because this action is marked RequiresRunningHost,
// it's only invoked when the host is running, and if it's running, we'll have access
// to the FunctionsScaleManager.
// to the IScriptHostManager.
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.

This should be IScaleStatusProvider

.GetSection(ConfigurationSectionNames.Scale)
.Bind(o);
});
services.ConfigureOptions<ScaleOptionsSetup>();
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 this looks right now. My main concern is/was whether we'd have any breaking changes with apps that might be using app settings to configure ScaleOptions now, if we're changing the config section names we're binding to. The SDK logic is here and it uses a helper that allows the Functions Host to override the section name which it does here. So I think we're good, I just need you to be sure/confirm :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, there is no breaking change - the section names remain the same.

[InlineData(false, true)]
[InlineData(true, false)]
[InlineData(false, false)]
public void ScaleOptionsSetup_Works_As_Expected(bool runtimeScaleMonitoringEnabled, bool targetBaseScalingEnabled)
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.

nit: ScaleOptionsSetup_ConfiguresExpectedDefaults

@alrod alrod requested a review from mathewc April 3, 2023 20:52
@alrod alrod merged commit c6217da into dev Apr 3, 2023
@alrod alrod deleted the alrod/sc-redesign3 branch April 3, 2023 21:24
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.

Consume new Scaler APIs from function host

5 participants