Skip to content

Conversation

@shreyas-gopalakrishna
Copy link
Member

resolves #8184

Design doc: https://dev.azure.com/msazure/One/_git/AAPT-Antares-Docs/pullrequest/5715621?_a=files

Issue describing the changes in this PR

Profiles enable workers to change how the worker is configured based on certain conditions, for example a worker may want to configure
itself differently for a consumption application vs a dedicated application. The profiles will be defined in the worker.config.json file
and will essentially override the default worker description based on a set of conditions.

The Java worker team is working on a prototype where an Application Insights (AI) agent is deployed along side the Java worker
to handle telemetry and logging to AI. Depending on the SKU and environment variables, the AI agent should be used.
Profiles will be used to add arguments required to enable the agent.

Sample worker.config.json with profiles

{
  "description": { ... }, // this will always be the default worker configuration
  "profiles": [
    {
      "profileName": "profile1",
      "conditions": [
        { "conditionType": "environment", "conditionName": "APP_SETTING_NAME", "conditionExpression": "app_setting_value" }
      ],
      "description": {
        "arguments": ["-DmyNewArg"]
      }
    },
    {
      "profileName": "profile2",
      "conditions": [
        { "conditionType": "hostProperty", "conditionName": "sku", "conditionExpression": "consumption" }
      ],
      "description": {
        "defaultWorkerPath": "",
        "arguments": []
      }
    }
  ]
}

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
  • I have added all required tests (Unit tests, E2E tests)

@shreyas-gopalakrishna shreyas-gopalakrishna force-pushed the shreyasg/v3-conditional-based-profiles branch from dc2f660 to 0d552f3 Compare June 14, 2022 21:56
@liliankasem
Copy link
Member

liliankasem commented Jun 15, 2022

LGTM, will hold on approval till the concern in the v4 PR is addressed

Also please make sure to manually test this E2E with a the java worker profile / agent stuff to make sure everything is working in V3

Conditional based profiles

WIP: Example refactoring using registered services

Use the Profile manager to store, load and evaluate profiles

Addressing review comments

Fixed dependency injection and review comments

Fixing unit tests

Updating WorkerProfileConditionProvider and tests

Updated tests
@shreyas-gopalakrishna shreyas-gopalakrishna force-pushed the shreyasg/v3-conditional-based-profiles branch from ab340bd to c4dd4cd Compare June 16, 2022 18:41
@shreyas-gopalakrishna shreyas-gopalakrishna merged commit 158067f into v3.x Jun 16, 2022
@shreyas-gopalakrishna shreyas-gopalakrishna deleted the shreyasg/v3-conditional-based-profiles branch June 16, 2022 20:12
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