Skip to content

Commit

Permalink
fix: wasm shims download failure fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Bailey committed Mar 11, 2024
1 parent fd10782 commit f27b93e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions parts/linux/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,26 @@ downloadSecureTLSBootstrapKubeletExecPlugin() {
}

downloadContainerdWasmShims() {
local pids=()
for shim_version in $CONTAINERD_WASM_VERSIONS; do
binary_version="$(echo "${shim_version}" | tr . -)"
local containerd_wasm_url="https://acs-mirror.azureedge.net/containerd-wasm-shims/${shim_version}/linux/amd64"
local containerd_wasm_filepath="/usr/local/bin"
local containerd_wasm_url="https://acs-mirror.azureedge.net/containerd-wasm-shims/${shim_version}/linux/amd64"
if [[ $(isARM64) == 1 ]]; then
containerd_wasm_url="https://acs-mirror.azureedge.net/containerd-wasm-shims/${shim_version}/linux/arm64"
fi

if [ ! -f "$containerd_wasm_filepath/containerd-shim-spin-${shim_version}" ] || [ ! -f "$containerd_wasm_filepath/containerd-shim-slight-${shim_version}" ]; then
retrycmd_if_failure 30 5 60 curl -fSLv -o "$containerd_wasm_filepath/containerd-shim-spin-${binary_version}-v1" "$containerd_wasm_url/containerd-shim-spin-v1" 2>&1 | tee $CURL_OUTPUT >/dev/null | grep -E "^(curl:.*)|([eE]rr.*)$" && (cat $CURL_OUTPUT && exit $ERR_KRUSTLET_DOWNLOAD_TIMEOUT)
retrycmd_if_failure 30 5 60 curl -fSLv -o "$containerd_wasm_filepath/containerd-shim-slight-${binary_version}-v1" "$containerd_wasm_url/containerd-shim-slight-v1" 2>&1 | tee $CURL_OUTPUT >/dev/null | grep -E "^(curl:.*)|([eE]rr.*)$" && (cat $CURL_OUTPUT && exit $ERR_KRUSTLET_DOWNLOAD_TIMEOUT)
retrycmd_if_failure 30 5 60 curl -fSLv -o "$containerd_wasm_filepath/containerd-shim-wws-${binary_version}-v1" "$containerd_wasm_url/containerd-shim-wws-v1" 2>&1 | tee $CURL_OUTPUT >/dev/null | grep -E "^(curl:.*)|([eE]rr.*)$" && (cat $CURL_OUTPUT && exit $ERR_KRUSTLET_DOWNLOAD_TIMEOUT) &
pids+=($!)
if [ "$shim_version" = "v0.8.0" ]; then
# Only download the wws shim for v0.8.0, wws shim for v0.3.0 and v0.5.1 fail
retrycmd_if_failure 30 5 60 curl -fSLv -o "$containerd_wasm_filepath/containerd-shim-wws-${binary_version}-v1" "$containerd_wasm_url/containerd-shim-wws-v1" 2>&1 | tee $CURL_OUTPUT >/dev/null | grep -E "^(curl:.*)|([eE]rr.*)$" && (cat $CURL_OUTPUT && exit $ERR_KRUSTLET_DOWNLOAD_TIMEOUT)
chmod 755 "$containerd_wasm_filepath/containerd-shim-wws-${binary_version}-v1"
fi
chmod 755 "$containerd_wasm_filepath/containerd-shim-spin-${binary_version}-v1"
chmod 755 "$containerd_wasm_filepath/containerd-shim-slight-${binary_version}-v1"
fi
done
wait ${pids[@]}
for shim_version in $CONTAINERD_WASM_VERSIONS; do
chmod 755 "$containerd_wasm_filepath/containerd-shim-wws-${binary_version}-v1"
done
}

downloadAzureCNI() {
Expand Down

0 comments on commit f27b93e

Please sign in to comment.