Skip to content

Commit

Permalink
perf: add paralleliation to container image pulls
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Bailey committed Apr 11, 2024
1 parent 4c9e1d9 commit 859aa5a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vhdbuilder/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ string_replace() {
echo ${1//\*/$2}
}

declare -a containerImagePids=()

ContainerImages=$(jq ".ContainerImages" $COMPONENTS_FILEPATH | jq .[] --monochrome-output --compact-output)
for imageToBePulled in ${ContainerImages[*]}; do
downloadURL=$(echo "${imageToBePulled}" | jq .downloadURL -r)
Expand All @@ -295,9 +297,11 @@ for imageToBePulled in ${ContainerImages[*]}; do

for version in ${versions}; do
CONTAINER_IMAGE=$(string_replace $downloadURL $version)
pullContainerImage ${cliTool} ${CONTAINER_IMAGE}
pullContainerImage ${cliTool} ${CONTAINER_IMAGE} &
containerImagePids+=($!)
echo " - ${CONTAINER_IMAGE}" >> ${VHD_LOGS_FILEPATH}
done
wait ${containerImagePids[@]}
done

watcher=$(jq '.ContainerImages[] | select(.downloadURL | contains("aks-node-ca-watcher"))' $COMPONENTS_FILEPATH)
Expand Down

0 comments on commit 859aa5a

Please sign in to comment.