-
Notifications
You must be signed in to change notification settings - Fork 251
feat: install aznfs package on AzureLinux 3.0 #8085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2e1dfb1
6b047d1
e40c8aa
bca74c5
0d80632
c14d00a
bbe5248
a38dcdc
24add77
765e71f
a33bcb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,6 +237,53 @@ installKubeletKubectlFromPkg() { | |
| installRPMPackageFromFile "kubectl" $desiredVersion || exit $ERR_KUBECTL_INSTALL_FAIL | ||
| } | ||
|
|
||
| installAznfsPkgFromPMC() { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this package for ? how come it doesnt live in azl3 repo ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no azl3 package due to GNU TLS dependency, this is only the way to install aznfs package on AzureLinux3, check here: https://learn.microsoft.com/en-us/azure/storage/files/encryption-in-transit-for-nfs-shares?tabs=azure-portal%2CAzureLinux |
||
| if [ "$OS_VERSION" != "3.0" ]; then | ||
| echo "aznfs package install is only supported on Azure Linux 3.0" | ||
| return | ||
| fi | ||
|
|
||
| # The aznfs RPM is pre-downloaded to /opt/aznfs/downloads during VHD build | ||
|
andyzhangx marked this conversation as resolved.
|
||
| # (via components.json). If not found, download it now as a fallback. | ||
| local aznfs_download_dir="/opt/aznfs/downloads" | ||
| local aznfs_rpm_file | ||
| aznfs_rpm_file=$(find "${aznfs_download_dir}" -name "aznfs-*.rpm" -type f 2>/dev/null | sort -V | tail -1) | ||
| if [ -z "${aznfs_rpm_file}" ]; then | ||
| echo "aznfs RPM not found in ${aznfs_download_dir}, downloading from PMC" | ||
| local download_url | ||
| download_url=$(getPackageDownloadUrl "aznfs") | ||
| if [ -z "${download_url}" ]; then | ||
| echo "Error: could not determine aznfs download URL" | ||
| exit $ERR_APT_INSTALL_TIMEOUT | ||
| fi | ||
| mkdir -p "${aznfs_download_dir}" | ||
| local aznfs_filename | ||
| aznfs_filename=$(basename "${download_url}") | ||
| retrycmd_curl_file 120 5 25 "${aznfs_download_dir}/${aznfs_filename}" "${download_url}" || exit $ERR_MS_PROD_DEB_DOWNLOAD_TIMEOUT | ||
|
andyzhangx marked this conversation as resolved.
|
||
| aznfs_rpm_file="${aznfs_download_dir}/${aznfs_filename}" | ||
| fi | ||
|
andyzhangx marked this conversation as resolved.
|
||
|
|
||
| echo "Installing aznfs from pre-downloaded RPM: ${aznfs_rpm_file}" | ||
| if ! AZNFS_NONINTERACTIVE_INSTALL=1 dnf_install 30 1 600 "${aznfs_rpm_file}"; then | ||
| exit $ERR_APT_INSTALL_TIMEOUT | ||
| fi | ||
|
|
||
| # Disable aznfs auto-upgrade to respect operator OS update settings and AKS SDP | ||
| local aznfs_config="/opt/microsoft/aznfs/data/config" | ||
| if [ -f "${aznfs_config}" ]; then | ||
| sed -i 's/AUTOUPDATE=.*/AUTOUPDATE=false/' "${aznfs_config}" | ||
| echo "Disabled aznfs auto-upgrade in ${aznfs_config}" | ||
| fi | ||
|
|
||
| # Disable aznfswatchdog since aznfs install enables both aznfswatchdog and aznfswatchdogv4 | ||
| # services at the same time while we only need aznfswatchdogv4 | ||
| systemctl disable aznfswatchdog | ||
| systemctl stop aznfswatchdog | ||
|
|
||
| echo "Importing Microsoft RPM GPG key into RPM database" | ||
| gpg --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Microsoft || echo "Warning: failed to import Microsoft RPM GPG key" | ||
|
andyzhangx marked this conversation as resolved.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see #8085 (comment), without this, there would be cert issue when dnf install other packages. |
||
| } | ||
|
andyzhangx marked this conversation as resolved.
|
||
|
|
||
| installToolFromLocalRepo() { | ||
| local tool_name=$1 | ||
| local tool_download_dir=$2 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -521,6 +521,17 @@ while IFS= read -r p; do | |
| "acr-mirror") | ||
| # acr-mirror is handled separately below via installAndConfigureArtifactStreaming. | ||
| ;; | ||
| "aznfs") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should only perform the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done — added |
||
| for version in ${PACKAGE_VERSIONS[@]}; do | ||
| evaluatedURL=$(evalPackageDownloadURL "${PACKAGE_DOWNLOAD_URL}") | ||
| mkdir -p "${downloadDir}" | ||
| aznfsFilename=$(basename "${evaluatedURL}") | ||
| echo "Downloading aznfs RPM from ${evaluatedURL} to ${downloadDir}/${aznfsFilename}" | ||
| retrycmd_curl_file 120 5 25 "${downloadDir}/${aznfsFilename}" "${evaluatedURL}" || exit $ERR_MS_PROD_DEB_DOWNLOAD_TIMEOUT | ||
| echo " - aznfs version ${version}" >> ${VHD_LOGS_FILEPATH} | ||
|
andyzhangx marked this conversation as resolved.
|
||
| done | ||
| installAznfsPkgFromPMC | ||
| ;; | ||
| *) | ||
| echo "Package name: ${name} not supported for download. Please implement the download logic in the script." | ||
| # We can add a common function to download a generic package here. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why arent we looking at tracking the versions with renovate ? when would this need to change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aznfs package is from PMC (packages.microsoft.com) not the AzureLinux repo, so renovate can't track it. The version is pinned with
<DO_NOT_UPDATE>tag and we'd bump it manually when a new version is available. We could add a custom renovate datasource later if this becomes a maintenance burden.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renovate support PMC, or I mean we could easily add support for the locaiton of this package
I'm just scared at one point we will loose track of the manual bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do it manually now since we need to verify the version before auto version bump. we need to make sure the version AB used is stable and won't break first. @djsly