Skip to content

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

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

surgupta-msft
Copy link
Contributor

@surgupta-msft surgupta-msft commented Jun 9, 2025

Issue describing the changes in this PR

resolves #10944

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • 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

This PR implements initial changes to decouple language workers from the Host release payload.

Backlog issues - Link
Design doc - Link

Flows covered in this PR -

  1. LanguageWorkerOptionsSetup -
    • Checks if the feature is enabled. If yes, gets probingPaths from the environment.
    • Creates an instance of WorkerConfigurationResolver and passes probingPaths to that. Sends the instance of WorkerConfigurationResolver when creating an instance of RPCWorkerConfigFactory
  2. RPCWorkerConfigFactory -
    • If feature is enabled, call GetWorkerConfigs() method of WorkerConfigurationResolver, otherwise look for worker configs within Host.
    • Moved some methods to WorkerConfigurationHelper.cs to enable reusing of workers profile evaluation logic.
  3. WorkerConfigurationResolver -
    • Host-Worker compatibility check
    • Leveraging Release channel concept to point to a previous version of worker
    • Fallback to the old flow if worker is not found at the probing path level
  4. Feature Flags -
    • Added new feature flags FeatureFlagEnableWorkerProbingPaths and FeatureFlagDisableWorkerProbingPaths to enable or disable worker probing paths.

Note: The decoupling workers flow is disabled by default in this PR. We will enable the flow after completing other relevant backlog items which will be included in follow-up PRs.

@surgupta-msft surgupta-msft requested a review from a team as a code owner June 9, 2025 19:38
@@ -144,30 +176,16 @@ internal void AddProvider(string workerDir)

_logger.LogDebug("Found worker config: {workerConfigPath}", workerConfigPath);

var workerConfig = GetWorkerConfigJsonElement(workerConfigPath);
Copy link
Contributor Author

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);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All these lines (148-150 and 152-170) are moved to a method WorkerConfigurationHelper.GetWorkerDescription()

@@ -213,61 +231,6 @@ internal void AddProvider(string workerDir)
}
}

private static JsonElement GetWorkerConfigJsonElement(string workerConfigPath)
Copy link
Contributor Author

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
{
Copy link
Contributor Author

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

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.

Implement changes needed in the Host to decouple workers from the Host release
1 participant