Skip to content

Publish AZ SIG images #3156

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

sayanchowdhury
Copy link
Member

@sayanchowdhury sayanchowdhury commented Jul 29, 2025

To be merged with https://github.com/flatcar/jenkins-os/pull/371

The script publishes vhd images to Azure Shared Image Galleries

Pending Item:

  • Need to move the download into the az_sig_publish. lbzip2 is not available in package repos. Also, need to check if curl works.
  • replication to target regions is still not working. need to look into
  • remove cleanup items before merge.
  • update default values before merge

CI http://jenkins.infra.kinvolk.io:8080/job/container/job/az_sig_publish/98/consoleFull

@sayanchowdhury sayanchowdhury force-pushed the sayan/publish-nightlies-sig branch from 8999878 to 85622c1 Compare July 29, 2025 13:57
Copy link
Contributor

@chewi chewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks.

Just a general tip, although Gentoo is admittedly quote-heavy in its ebuilds, you don't need to quote:

  • When assigning FOO=${} or FOO=$()
  • Inside [[ ]] unless it's a variable on the right-hand-side.
  • case ${FOO} in

fi

echo "Fetching target regions"
TARGET_REGIONS=$(az account list-locations -o json | jq -r '.[] | select( .metadata.regionType != "Logical" ) | .name' | sort | grep -v -E "(${BLACKLISTED_TARGET_REGIONS// /|})" | tr '\n' ' ')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TARGET_REGIONS=$(az account list-locations -o json | jq -r '.[] | select( .metadata.regionType != "Logical" ) | .name' | sort | grep -v -E "(${BLACKLISTED_TARGET_REGIONS// /|})" | tr '\n' ' ')
TARGET_REGIONS=$(az account list-locations -o json | jq --args -r '[.[] | select(.metadata.regionType != "Logical") | .name] - $ARGS.positional | sort | join(" ")' ${BLACKLISTED_TARGET_REGIONS})

echo "Blob doesn't exist. Downloading flatcar-linux-${FLATCAR_GALLERY_VERSION}-${FLATCAR_CHANNEL}-${FLATCAR_ARCH}"
# Download the VHD file (only if blob doesn't exist)
echo "Downloading ${FLATCAR_LOCAL_FILE_URL}..."
if ! curl -L -o "/data/${FLATCAR_LOCAL_FILE_NAME}.bz2" "${FLATCAR_LOCAL_FILE_URL}"; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ! curl -L -o "/data/${FLATCAR_LOCAL_FILE_NAME}.bz2" "${FLATCAR_LOCAL_FILE_URL}"; then
if ! curl -f -L -o "/data/${FLATCAR_LOCAL_FILE_NAME}.bz2" "${FLATCAR_LOCAL_FILE_URL}"; then

fi

FLATCAR_GALLERY_IMAGE_NAME="flatcar-${channel}-${arch}"
version=$(echo "${vernum}" | cut -d '-' -f2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version=$(echo "${vernum}" | cut -d '-' -f2)
version=$(cut -d '-' -f2 <<< "${vernum}")


local date=""
if [[ "$vernum" == *nightly* ]]; then
date=$(echo "${vernum}" | cut -d '-' -f4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
date=$(echo "${vernum}" | cut -d '-' -f4)
date=$(cut -d '-' -f4 <<< "${vernum}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants