-
Notifications
You must be signed in to change notification settings - Fork 464
Implement changes needed in the Host to decouple workers from the Host release #11111
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
base: feature/decouple-workers
Are you sure you want to change the base?
Implement changes needed in the Host to decouple workers from the Host release #11111
Conversation
@@ -144,30 +176,16 @@ internal void AddProvider(string workerDir) | |||
|
|||
_logger.LogDebug("Found worker config: {workerConfigPath}", workerConfigPath); | |||
|
|||
var workerConfig = GetWorkerConfigJsonElement(workerConfigPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change in logic for this line. Just moved the method GetWorkerConfigJsonElement()
to class WorkerConfigurationHelper
@@ -144,30 +176,16 @@ internal void AddProvider(string workerDir) | |||
|
|||
_logger.LogDebug("Found worker config: {workerConfigPath}", workerConfigPath); | |||
|
|||
var workerConfig = GetWorkerConfigJsonElement(workerConfigPath); | |||
var workerDescriptionElement = workerConfig.GetProperty(WorkerConstants.WorkerDescription); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these lines (148-170) are moved to a method WorkerConfigurationHelper.GetWorkerDescription()
- https://gist.github.com/surgupta-msft/612906e464e445284eb8400a2695c087/revisions
@@ -213,61 +231,6 @@ internal void AddProvider(string workerDir) | |||
} | |||
} | |||
|
|||
private static JsonElement GetWorkerConfigJsonElement(string workerConfigPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are also moved to class WorkerConfigurationHelper
as we will need to call these methods from class WorkerConfigurationResolver
as part of compatibility check
namespace Microsoft.Azure.WebJobs.Script.Workers.Rpc.Configuration | ||
{ | ||
internal static class WorkerConfigurationHelper | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the methods in this class are taken from RPCWorkerConfigFactory
with minor adjustments. See gist - https://gist.github.com/surgupta-msft/fcecd60a676f9d7d73792c3a3dca9aa9/revisions
test/TestWorkers/Probingpaths/workers/node/3.10.1/worker.config.json
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/LanguageWorkerOptionsSetup.cs
Outdated
Show resolved
Hide resolved
Minor comment on branch name, we should use |
src/WebJobs.Script/Workers/Rpc/Configuration/DefaultWorkerConfigurationResolver.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DynamicWorkerConfigurationResolver.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add the placeholder + specialization use case test to validate that flow.
src/WebJobs.Script/Workers/Rpc/Configuration/WorkerConfigurationHelper.cs
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/WorkerConfigurationResolverFactory.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DefaultWorkerConfigurationResolver.cs
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DynamicWorkerConfigurationResolver.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DynamicWorkerConfigurationResolver.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DynamicWorkerConfigurationResolver.cs
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DynamicWorkerConfigurationResolver.cs
Outdated
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/DynamicWorkerConfigurationResolver.cs
Show resolved
Hide resolved
src/WebJobs.Script/Workers/Rpc/Configuration/LanguageWorkerOptionsSetup.cs
Outdated
Show resolved
Hide resolved
Yes, this will definitely be included with Integration and E2E tests changes. I am currently working on it - #11140 |
Issue describing the changes in this PR
Related issue #10944
Update
As the PR now deals with multiple functionalities, splitting these changes into two separate PRs as described below. Additionally, converting this PR to a draft in case it’s needed for reference. I’ll close it when it’s no longer required.
RPCWorkerConfigFactory
and moving the logic for locating WorkerConfigs within the Host to a new classDefaultWorkerConfigurationResolver
. This resolver will take its inputs via Options. These changes will be merged into thedev
branch.DynamicWorkerConfigurationResolver
and include only the logic related to decoupling workers.Pull request checklist
IMPORTANT: Currently, changes must be backported to the
in-proc
branch to be included in Core Tools and non-Flex deployments.in-proc
branch is not requiredrelease_notes.md
Additional information
Additional PR information
This pull request introduces changes to decouple language workers from the Host release and enable dynamic worker resolution. Key updates include new worker configuration resolvers, environment enhancements, and feature flags to control worker behavior.
Backlog issues - Link
Design doc - Link
Flows covered in this PR -
GetWorkerConfigs()
method ofIWorkerConfigurationResolver
to get the required worker configs.WorkerConfigurationHelper.cs
to enable reusing of workers profile evaluation logic.DefaultWorkerConfigurationResolver
to scan the Host's "workers" directory for worker configurations.DynamicWorkerConfigurationResolver
, which dynamically resolves worker configurations based on -IsWindowsEnvironment()
to determine the windows environment type.IsDynamicWorkerResolutionEnabled
method toEnvironmentExtensions
class to enable/disable dynamic worker resolution using feature flag and hosting configuration.FeatureFlagDisableWorkerProbingPaths
to disable dynamic resolution feature by users.WorkerConfigurationResolverOptions
by getting required values from IConfiguration and IEnvironment such as worker probing paths, release channel, workers available for resolution via hosting config.Note: The decoupling workers flow is disabled by default in this PR. We will enable the flow using Hosting Config after completing other relevant backlog items which will be included in follow-up PRs.