Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Pin blobfuse version
Browse files Browse the repository at this point in the history
- Manually overridable through nodeprep script edit
- Resolves #351
  • Loading branch information
alfpark committed Apr 23, 2021
1 parent 87b22b0 commit 3b23665
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/shipyard_nodeprep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ DOCKER_CE_VERSION_CENTOS=19.03.5
DOCKER_CE_VERSION_SLES=17.09.1
GLUSTER_VERSION_DEBIAN=7
GLUSTER_VERSION_CENTOS=6
IMDS_VERSION=2019-04-30
BLOBFUSE_VERSION=1.3.6
IMDS_VERSION=2021-01-01

# consts
DOCKER_CE_PACKAGE_DEBIAN="5:${DOCKER_CE_VERSION_DEBIAN}~3-0~"
Expand Down Expand Up @@ -381,7 +382,7 @@ get_vm_size_from_imds() {
if [ -n "$vm_size" ]; then
return
fi
curl -fSsL -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=${IMDS_VERSION}" > imd.json
curl -fSsL -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=${IMDS_VERSION}" > imd.json
vm_size=$(python -c "import json;f=open('imd.json','r');a=json.load(f);print(a['compute']['vmSize']).lower()")
if [[ "$vm_size" =~ ^standard_(((hb|hc)[0-9]+m?rs?(_v[1-9])?)|(nc[0-9]+rs_v3)|(nd[0-9]+rs_v2))$ ]]; then
# SR-IOV RDMA
Expand Down Expand Up @@ -906,8 +907,10 @@ mount_azureblob_container() {
else
log DEBUG "blobfuse is not installed"
local mspkg
local bfpkg
if [ "$PACKAGER" == "apt" ]; then
mspkg=packages-microsoft-prod.deb
bfpkg="blobfuse=${BLOBFUSE_VERSION}"
if [ "$DISTRIB_ID" == "ubuntu" ]; then
download_file_as "https://packages.microsoft.com/config/${DISTRIB_ID}/${DISTRIB_RELEASE}/${mspkg}" "$mspkg"
elif [ "$DISTRIB_ID" == "debian" ]; then
Expand All @@ -916,18 +919,19 @@ mount_azureblob_container() {
fi
elif [ "$PACKAGER" == "yum" ]; then
mspkg=packages-microsoft-prod.rpm
bfpkg="blobfuse-${BLOBFUSE_VERSION}"
download_file_as "https://packages.microsoft.com/config/rhel/${DISTRIB_RELEASE}/${mspkg}" "$mspkg"
elif [ "$PACKAGER" == "zypper" ]; then
mspkg=packages-microsoft-prod.rpm
download_file_as "https://packages.microsoft.com/config/sles/${DISTRIB_RELEASE}/${mspkg}" "$mspkg"
fi
if [ ! -f ${mspkg} ]; then
if [ ! -f ${mspkg} ] || [ -z "${bfpkg}" ]; then
echo "ERROR: unsupported distribution for Azure blob: $DISTRIB_ID $DISTRIB_RELEASE"
exit 1
fi
install_local_packages ${mspkg}
refresh_package_index
install_packages blobfuse
install_packages ${bfpkg}
fi
./azureblob-mount.sh
rm azureblob-mount.sh
Expand Down
4 changes: 4 additions & 0 deletions scripts/windows/shipyard_nodeprep_nativedocker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ param(
[String] $x # blobxfer version
)

Set-Variable ImdsVersion -option Constant -value "2021-01-01"
Set-Variable NodePrepFinished -option Constant -value (Join-Path $env:AZ_BATCH_NODE_ROOT_DIR -ChildPath "volatile" | Join-Path -ChildPath ".batch_shipyard_node_prep_finished")
Set-Variable VolatileStartupSave -option Constant -value (Join-Path $env:AZ_BATCH_NODE_ROOT_DIR -ChildPath "volatile" | Join-Path -ChildPath "startup" | Join-Path -ChildPath ".save")
Set-Variable MountsPath -option Constant -value (Join-Path $env:AZ_BATCH_NODE_ROOT_DIR -ChildPath "mounts")
Expand Down Expand Up @@ -46,6 +47,9 @@ Write-Host "Encrypted: $e"
Write-Host "Azure File: $a"
Write-Host ""

# retrive IMDS
Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Proxy $Null -Uri "http://169.254.169.254/metadata/instance?api-version=${ImdsVersion}" | ConvertTo-Json -Depth 64 | Out-File imd.json

# touch volatile startup save file
New-Item -ItemType file $VolatileStartupSave -Force

Expand Down

0 comments on commit 3b23665

Please sign in to comment.