Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions parts/common/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@
"versionsV2": [
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "0.3.1"
"latestVersion": "1.0.0"
}
Comment thread
juliusl marked this conversation as resolved.
],
"downloadURL": "https://acrstreamingpackage.z5.web.core.windows.net/${version}/acr-mirror-2004.deb"
Comment thread
juliusl marked this conversation as resolved.
Expand All @@ -2228,7 +2228,7 @@
"versionsV2": [
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "0.3.1"
"latestVersion": "1.0.0"
}
],
"downloadURL": "https://acrstreamingpackage.z5.web.core.windows.net/${version}/acr-mirror-2204.deb"
Expand All @@ -2237,7 +2237,7 @@
"versionsV2": [
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "0.3.1"
"latestVersion": "1.0.0"
}
],
"downloadURL": "https://acrstreamingpackage.z5.web.core.windows.net/${version}/acr-mirror-2404.deb"
Expand All @@ -2248,7 +2248,7 @@
"versionsV2": [
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "0.3.1"
"latestVersion": "1.0.0"
}
],
"downloadURL": "https://acrstreamingpackage.z5.web.core.windows.net/${version}/acr-mirror-azurelinux3.rpm"
Expand Down
12 changes: 10 additions & 2 deletions parts/linux/cloud-init/artifacts/cse_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,16 @@ ensureNoDupOnPromiscuBridge() {

ensureArtifactStreaming() {
waitForContainerdReady || exit $ERR_ARTIFACT_STREAMING_INSTALL
retrycmd_if_failure 120 5 25 systemctl --quiet enable --now acr-mirror overlaybd-tcmu overlaybd-snapshotter
/opt/acr/bin/acr-config --enable-containerd 'azurecr.io'
retrycmd_if_failure 120 5 25 systemctl --quiet enable --now acr-mirror overlaybd-tcmu overlaybd-snapshotter || exit $ERR_ARTIFACT_STREAMING_INSTALL
Comment thread
juliusl marked this conversation as resolved.

local acr_mirror_setup="${ACR_MIRROR_SETUP_SCRIPT:-/opt/acr/tools/mirror/setup.sh}"
if [ -x "$acr_mirror_setup" ]; then
"$acr_mirror_setup" aks
else
echo "Older acr-mirror package is detected, using old acr-config enablement"
# setup.sh is only available in acr-mirror 1.0.0 and above
"${ACR_CONFIG_BIN:-/opt/acr/bin/acr-config}" --enable-containerd 'azurecr.io'
fi
}

ensureDHCPv6() {
Expand Down
64 changes: 64 additions & 0 deletions spec/parts/linux/cloud-init/artifacts/cse_config_spec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,70 @@ Describe 'cse_config.sh'
End
End

Describe 'ensureArtifactStreaming'
# ensureArtifactStreaming enables the acr-mirror/overlaybd services and then
# runs the version-appropriate enablement path:
# - acr-mirror 1.0.0+ -> setup.sh aks
# - older packages -> acr-config --enable-containerd
# The enablement binary paths are overridable (ACR_MIRROR_SETUP_SCRIPT /
# ACR_CONFIG_BIN), so the stubs live in a temp dir instead of mutating /opt.
setup_streaming() {
TEST_ACR_DIR="$(mktemp -d)"
ACR_MIRROR_SETUP_SCRIPT="${TEST_ACR_DIR}/setup.sh"
ACR_CONFIG_BIN="${TEST_ACR_DIR}/acr-config"
}
cleanup_streaming() {
rm -rf "${TEST_ACR_DIR}"
}
BeforeEach 'setup_streaming'
AfterEach 'cleanup_streaming'

waitForContainerdReady() {
return 0
}
systemctl() {
echo "systemctl $@"
}
retrycmd_if_failure() {
echo "retrycmd_if_failure $@"
return "${RETRYCMD_RC:-0}"
}

install_setup_sh() {
printf '#!/bin/sh\necho "setup.sh $@"\n' > "${ACR_MIRROR_SETUP_SCRIPT}"
chmod +x "${ACR_MIRROR_SETUP_SCRIPT}"
}
install_acr_config() {
printf '#!/bin/sh\necho "acr-config $@"\n' > "${ACR_CONFIG_BIN}"
chmod +x "${ACR_CONFIG_BIN}"
}

It 'uses setup.sh aks when acr-mirror 1.0.0+ is installed'
install_setup_sh
When run ensureArtifactStreaming
The output should include "setup.sh aks"
The output should not include "Older acr-mirror package"
The status should be success
End

It 'falls back to acr-config enablement when setup.sh is absent (older package)'
install_acr_config
When run ensureArtifactStreaming
The output should include "Older acr-mirror package is detected"
The output should include "acr-config --enable-containerd azurecr.io"
The status should be success
End

It 'fails fast when enabling the streaming services fails'
RETRYCMD_RC=1
install_setup_sh
When run ensureArtifactStreaming
The output should include "retrycmd_if_failure"
The output should not include "setup.sh aks"
The status should equal "$ERR_ARTIFACT_STREAMING_INSTALL"
End
End

Describe 'configureAzureJson'
AZURE_JSON_PATH="azure.json"
AKS_CUSTOM_CLOUD_JSON_PATH="customcloud.json"
Expand Down
7 changes: 0 additions & 7 deletions vhdbuilder/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,6 @@ installAndConfigureArtifactStreaming() {
rm "$MIRROR_DOWNLOAD_PATH"

/opt/acr/tools/overlaybd/install.sh
Comment thread
juliusl marked this conversation as resolved.
/opt/acr/tools/overlaybd/config-user-agent.sh azure
/opt/acr/tools/overlaybd/enable-http-auth.sh
/opt/acr/tools/overlaybd/config.sh download.enable false
/opt/acr/tools/overlaybd/config.sh cacheConfig.cacheSizeGB 32
/opt/acr/tools/overlaybd/config.sh exporterConfig.enable true
/opt/acr/tools/overlaybd/config.sh exporterConfig.port 9863
systemctl link /opt/overlaybd/overlaybd-tcmu.service /opt/overlaybd/snapshotter/overlaybd-snapshotter.service
# Remove the bundled overlaybd installer packages (~55-58 MB); install.sh already installed them and they're unused at runtime.
rm -f /opt/acr/tools/overlaybd/bin/*.deb /opt/acr/tools/overlaybd/bin/*.rpm
Comment thread
juliusl marked this conversation as resolved.
echo " - acr-mirror version ${version}" >> ${VHD_LOGS_FILEPATH}
Expand Down
Loading