Skip to content

feat: ACR-based SDK distribution with feature flag#2837

Draft
CodingIsBliss wants to merge 37 commits intomainfrom
feature/oryx-sdk-acr-distribution
Draft

feat: ACR-based SDK distribution with feature flag#2837
CodingIsBliss wants to merge 37 commits intomainfrom
feature/oryx-sdk-acr-distribution

Conversation

@CodingIsBliss
Copy link
Copy Markdown
Collaborator

@CodingIsBliss CodingIsBliss commented Apr 1, 2026

Summary

Add ACR-based SDK distribution behind ORYX_ENABLE_ACR_SDK_PROVIDER feature flag. SDKs can be pulled from Azure Container Registry instead of blob storage, with two separate provider paths and full fallback to existing blob storage.

Architecture

Two separate ACR SDK providers:

  1. ExternalAcrSdkProvider - Communicates with LWASv2 via Unix socket (source=acr). LWASv2 resolves the SDK companion image from LinuxAssets (same build tag as runtime image), pulls via containerd, mounts, and extracts SDK to disk.

  2. AcrSdkProvider (direct) - Downloads SDKs directly from Oryx ACR (oryxsdks.azurecr.io) using OCI Distribution API via curl/HTTP. Used as a fallback when LWASv2 is not available.

Fallback Chain

  • ExternalAcrSdkProvider (LWASv2 -> WAWS ACR companion image)
  • GetAcrInstallerScriptSnippet (direct curl -> Oryx ACR)
  • EnableDynamicInstall (existing blob storage - untouched)

New Files (8)

  • IExternalAcrSdkProvider.cs / ExternalAcrSdkProvider.cs - ACR SDK provider via LWASv2
  • OciRegistryClient.cs - HTTP client for OCI Distribution API
  • AcrVersionProviderBase.cs - Base class for ACR version discovery
  • Per-platform ACR version providers: Node, Python, PHP, DotNetCore

Modified Files (27)

  • Constants/Config: SdkStorageConstants, SettingsKeys, Options
  • Platform install decisions: Node/Python/PHP/DotNet Platform.cs with ACR branch
  • Version providers: ACR provider chain added
  • Installers: GetAcrInstallerScriptSnippet() for direct OCI download
  • DI registrations for all new providers
  • Go startup: ACR download path in setupEnvironment.go

Feature Flag

All changes additive. Existing blob storage paths untouched.

Related PRs

  • Antares-Websites: #15250811
  • AAPT-Antares-Oryx: #15250812
  • imagebuilder-v2: #15250813

Sarath chandra Bussa added 4 commits April 1, 2026 13:14
Add two separate ACR SDK providers behind ORYX_ENABLE_ACR_SDK_PROVIDER:

1. ExternalAcrSdkProvider - communicates with LWASv2 via Unix socket
   to pull SDK images from WAWS Images ACR
2. AcrSdkProvider (direct) - downloads SDKs from Oryx ACR
   (oryxsdks.azurecr.io) using OCI Distribution API

New files:
- IExternalAcrSdkProvider.cs / ExternalAcrSdkProvider.cs
- OciRegistryClient.cs - HTTP client for OCI Distribution API
- AcrVersionProviderBase.cs - base class for ACR version discovery
- Per-platform ACR version providers (Node, Python, PHP, DotNetCore)
- publishSdkImageToAcr.sh / publishSdkToAcr.yml - ACR publish pipeline

Modified files:
- Platform install decisions (NodePlatform, PythonPlatform, PhpPlatform,
  DotNetCorePlatform) with ACR branch before existing DynamicInstall
- Version provider orchestrators with ACR provider chain
- PlatformInstallerBase with GetAcrInstallerScriptSnippet()
- Go startup script generator with ACR download path
- DI registrations for all new providers
- Constants, options, settings keys for ACR configuration

All changes are additive and behind feature flags.
Existing blob storage code paths are completely untouched.
…esolution

Remove ACR repository/tag construction from ExternalAcrSdkProvider.
Now sends only platform, version, and debianFlavor to LWASv2.
LWASv2 resolves the SDK companion image from LinuxAssets and
handles pinning, containerd pull, mount, and extraction.
… OneBranch pipeline)

Remove publishSdkImageToAcr.sh and publishSdkToAcr.yml since SDK images
are now built and pushed using onebranch.pipeline.imagebuildinfo in
the AAPT-Antares-Oryx pipeline, not via custom scripts.
@CodingIsBliss CodingIsBliss changed the title Oryx SDK regional distribution — pull SDKs from ACR feat: ACR-based SDK distribution with feature flag Apr 1, 2026
Use the same ACR that AAPT-Antares-Oryx publishes SDK images to.
Updated both C# constant and Go constant.
@CodingIsBliss CodingIsBliss force-pushed the feature/oryx-sdk-acr-distribution branch from 259f0c4 to faa6b2d Compare April 1, 2026 13:09
Sarath chandra Bussa added 2 commits April 1, 2026 19:22
- SA1204: Move static GetFirstLayerDigest before instance members (OciRegistryClient.cs)
- SA1124: Remove #region/#endregion around OCI JSON models (OciRegistryClient.cs)
- SA1202: Move protected GetAcrInstallerScriptSnippet before private methods (PlatformInstallerBase.cs)
- SA1116/SA1117: Place multi-line parameters each on own line (ExternalAcrSdkProvider.cs)
- SA1515: Add blank line before single-line comment (DotNetCoreAcrVersionProvider.cs)
- SA1204: Move static GetFirstLayerDigest before instance members (OciRegistryClient.cs)
- SA1124: Remove #region/#endregion around OCI JSON models (OciRegistryClient.cs)
- SA1202: Move protected GetAcrInstallerScriptSnippet before private methods (PlatformInstallerBase.cs)
- SA1116/SA1117: Place multi-line parameters each on own line (ExternalAcrSdkProvider.cs)
- SA1515: Add blank line before single-line comment (DotNetCoreAcrVersionProvider.cs)
@CodingIsBliss CodingIsBliss force-pushed the feature/oryx-sdk-acr-distribution branch from 505580f to 3a88dfe Compare April 1, 2026 14:19
kumaraksh1 and others added 9 commits April 1, 2026 20:41
* fix: Resolve StyleCop analyzer errors in ACR SDK provider files

- SA1204: Move static GetFirstLayerDigest before instance members (OciRegistryClient.cs)
- SA1124: Remove #region/#endregion around OCI JSON models (OciRegistryClient.cs)
- SA1202: Move protected GetAcrInstallerScriptSnippet before private methods (PlatformInstallerBase.cs)
- SA1116/SA1117: Place multi-line parameters each on own line (ExternalAcrSdkProvider.cs)
- SA1515: Add blank line before single-line comment (DotNetCoreAcrVersionProvider.cs)

* fix sdk providers logic

* refactor pythonPlatform

* refctor for dotnet,php and node

---------

Co-authored-by: Sarath chandra Bussa <sbussa@microsoft.com>
@sarsharma
Copy link
Copy Markdown
Member

sarsharma commented Apr 2, 2026

Maybe we need 2 config flags here?
ORYX_ENABLE_EXTERNAL_ACR_SDK_PROVIDER
ORYX_ENABLE_ACR_SDK_PROVIDER

@CodingIsBliss CodingIsBliss marked this pull request as ready for review April 3, 2026 14:10
@CodingIsBliss CodingIsBliss requested a review from a team as a code owner April 3, 2026 14:10
@CodingIsBliss CodingIsBliss marked this pull request as draft April 3, 2026 14:11
kumaraksh1 and others added 7 commits April 4, 2026 01:45
…LWASv2 socket contract

- Fix socket path to /var/sdk-image-sockets/oryx-pull-sdk-image.socket (ACR socket)
- Add ExternalAcrSdksStorageDir constant (/var/OryxAcrSdks) for ACR SDK cache
- Add top-level Action field (pull-sdk / get-version) to request DTOs
- Remove BlobName and UrlParameters from ExternalAcrSdkProvider request
- Accept server-returned filename as success response instead of expecting 'Success$'
* update logic for dotnet and default versions

* Refactor ACR SDK provider to return tarball path
public const string EnableExternalAcrSdkProviderKey = "ORYX_ENABLE_EXTERNAL_ACR_SDK_PROVIDER";
public const string EnableAcrSdkProviderKey = "ORYX_ENABLE_ACR_SDK_PROVIDER";
public const string AcrSdkRegistryUrlKeyName = "ORYX_ACR_SDK_REGISTRY_URL";
public const string DefaultAcrSdkRegistryUrl = "https://oryxacr.azurecr.io";
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.

before merging, lets update this to mcr if required

public const string EnableAcrSdkProviderKey = "ORYX_ENABLE_ACR_SDK_PROVIDER";
public const string AcrSdkRegistryUrlKeyName = "ORYX_ACR_SDK_REGISTRY_URL";
public const string DefaultAcrSdkRegistryUrl = "https://oryxacr.azurecr.io";
public const string AcrSdkRepositoryPrefix = "sdks";
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.

same here, for prod case + mcr, this might become <mcr>/oryx/sdks

…po constants (#2867)

* update logic for dotnet and default versions

* Refactor ACR SDK provider to return tarball path

* Cleanup startupscriptgen and refactor ACR SDK distribution constants
* update logic for dotnet and default versions

* Refactor ACR SDK provider to return tarball path

* Cleanup startupscriptgen and refactor ACR SDK distribution constants

* Refactor ACR SDK provider methods to return boolean status and update related logic across platforms

* Update version provider logic to check for external SDK provider option
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