Conversation
Changes cached containers or packages on windows VHDsPlease get a Windows SIG member to approve. The following dif file shows any additions or deletions from what will be cached on windows VHDs organised by VHD type.
diff --git a/vhd_files/2019-containerd.txt b/vhd_files/2019-containerd.txt
index 17dbc7d..013c301 100644
--- a/vhd_files/2019-containerd.txt
+++ b/vhd_files/2019-containerd.txt
@@ -15,0 +16 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip
diff --git a/vhd_files/2022-containerd-gen2.txt b/vhd_files/2022-containerd-gen2.txt
index 0209fde..5ba7057 100644
--- a/vhd_files/2022-containerd-gen2.txt
+++ b/vhd_files/2022-containerd-gen2.txt
@@ -16,0 +17 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip
diff --git a/vhd_files/2022-containerd.txt b/vhd_files/2022-containerd.txt
index 73642bd..b61c807 100644
--- a/vhd_files/2022-containerd.txt
+++ b/vhd_files/2022-containerd.txt
@@ -16,0 +17 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip
diff --git a/vhd_files/2025-gen2.txt b/vhd_files/2025-gen2.txt
index 0f7e754..7e7797a 100644
--- a/vhd_files/2025-gen2.txt
+++ b/vhd_files/2025-gen2.txt
@@ -13,0 +14 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip
diff --git a/vhd_files/2025.txt b/vhd_files/2025.txt
index f80e2a6..8c3042b 100644
--- a/vhd_files/2025.txt
+++ b/vhd_files/2025.txt
@@ -13,0 +14 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip
diff --git a/vhd_files/23H2-gen2.txt b/vhd_files/23H2-gen2.txt
index 3d8175c..89f7956 100644
--- a/vhd_files/23H2-gen2.txt
+++ b/vhd_files/23H2-gen2.txt
@@ -14,0 +15 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip
diff --git a/vhd_files/23H2.txt b/vhd_files/23H2.txt
index 4ef680f..61d01f9 100644
--- a/vhd_files/23H2.txt
+++ b/vhd_files/23H2.txt
@@ -14,0 +15 @@ c:\akse-cache\csi-proxy\: https://packages.aks.azure.com/csi-proxy/v1.1.2-hotfix
+c:\akse-cache\oras\: https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip |
There was a problem hiding this comment.
Pull request overview
Adds Windows support for caching the oras CLI as part of the Windows VHD build cache, by extending the shared components manifest.
Changes:
- Added
windowsDownloadLocationfor theoraspackage. - Added a Windows-specific
downloadURIs.windows.defaultentry fororas(v1.2.2).
| "windows": { | ||
| "default": { | ||
| "versionsV2": [ | ||
| { | ||
| "renovateTag": "<DO_NOT_UPDATE>", | ||
| "latestVersion": "1.2.2" | ||
| } | ||
| ], | ||
| "downloadURL": "https://github.com/oras-project/oras/releases/download/v${version}/oras_${version}_windows_amd64.zip" | ||
| } |
There was a problem hiding this comment.
The Windows oras version here (1.2.2) doesn’t match the oras version currently used during Windows VHD build for OCI pulls (vhdbuilder/packer/windows/configure-windows-vhd.ps1 hardcodes 1.2.3). This creates version drift and can result in downloading/storing two different oras zips in a single build (extra time/space) while the cached copy may never be used. Consider aligning the version with what the VHD build uses, and ideally sourcing the oras version from a single place (e.g., components.json) to prevent future divergence.
There was a problem hiding this comment.
@jiashun0011
found function Pull-OCIArtifact, it hardcode to install v1.2.3 oras and installed seems only in aksTempDir "c:\akstemp". I guess it is not impleted for cse runtime?
cc @abeltrano
There was a problem hiding this comment.
maybe we can change the cache version to v1.2.3
and in Pull-OCIArtifact, we modify to detect cached version first, wdyt?
| { | ||
| "name": "oras", | ||
| "downloadLocation": "/opt/bin", | ||
| "windowsDownloadLocation": "c:\\akse-cache\\oras\\", |
There was a problem hiding this comment.
akse-cache will be removed finally.
Do you think we should move the oras.exe to another place to keep it? e.g. c:/aks-tools/oras/oras.exe?
There was a problem hiding this comment.
good point, let's use the future location to avoid problems in the future.
where can I learn more about the deprecation of the akse-cache folder ?
There was a problem hiding this comment.
i think it should happen during NodePrep
i just created on windows node, kubectl enter this node but did not find c:\akse-cache
There was a problem hiding this comment.
As far as I'm aware, we have no plans to remove the aks-cache directory. It's used during node provisioning and it's probably deleted after the node joins the cluster to save drive space.
| "latestVersion": "1.2.2" | ||
| } | ||
| ], | ||
| "downloadURL": "https://github.com/oras-project/oras/releases/download/v${version}/oras_${version}_windows_amd64.zip" |
There was a problem hiding this comment.
from Get-PackagesToCacheOnVHD
i think it will only download the zip file in download path. Do we still need function to unzip it?
| "default": { | ||
| "versionsV2": [ | ||
| { | ||
| "renovateTag": "<DO_NOT_UPDATE>", |
There was a problem hiding this comment.
why not setting up renovate to fetch the version from github and have automatic PR created for ORAS.
| "versionsV2": [ | ||
| { | ||
| "renovateTag": "<DO_NOT_UPDATE>", | ||
| "latestVersion": "1.2.2" |
There was a problem hiding this comment.
1.2.3 is out, same as 1.3.0 shoudlnt we pick one of those two ?
There was a problem hiding this comment.
I'm confused. For windows, Oras seems to be only used during VHD creation. It's not needed (as far as I can tell) during node provisioning. So we don't need it cached on the VHD. Ideally it would be used to pull OCI Artifacts and then deleted afterwards.
If we want to update the version, we can do this in the configure-windows-vhd.ps1 file. Currently it's set to 1.2.3. We probably need a better way to specify this, but I don't think components.json is the right place.
What this PR does / why we need it:
Cache oras binary in Windows image.
Which issue(s) this PR fixes:
Chore: cache oras binary in Windows image