Skip to content
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

Drop lots of obsolete CI, release signing, and upload code #2477

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions bootstrap_sdk
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ GENTOO_MIRRORS="${GENTOO_MIRRORS//https:\/\//http://}"
export GENTOO_MIRRORS

catalyst_init "$@"
check_gsutil_opts
ROOT_OVERLAY=${TEMPDIR}/stage4_overlay

if [[ "$STAGES" =~ stage4 ]]; then
Expand Down Expand Up @@ -108,18 +107,6 @@ if [[ "$STAGES" =~ stage4 ]]; then
verify_digests "${release_image}" "${release_contents}"

info "SDK ready: ${release_image}"

def_upload_path="${UPLOAD_ROOT}/sdk/${ARCH}/${FLAGS_version}"
sign_and_upload_files "tarball" "${def_upload_path}" "" \
"${release_image}" "${release_contents}" "${release_digests}"
sign_and_upload_files "packages" "${def_upload_path}" "pkgs/" \
"${BINPKGS}"/*

if [ -d "${BINPKGS}/crossdev" ]; then
# Upload the SDK toolchain packages
sign_and_upload_files "cross toolchain packages" "${def_upload_path}" \
"toolchain/" "${BINPKGS}/crossdev"/*
fi
fi

command_completed
6 changes: 0 additions & 6 deletions build_image
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ eval set -- "${FLAGS_ARGV:-prod}"
# so will die prematurely if 'switch_to_strict_mode' is specified before now.
switch_to_strict_mode

check_gsutil_opts

# If downloading packages is enabled ensure the board is configured properly.
if [[ ${FLAGS_getbinpkg} -eq ${FLAGS_TRUE} ]]; then
"${SRC_ROOT}/scripts/setup_board" --board="${FLAGS_board}" \
Expand Down Expand Up @@ -202,8 +200,6 @@ FLATCAR_BUILD_ID="${FLATCAR_BUILD_ID}"
FLATCAR_SDK_VERSION=${FLATCAR_SDK_VERSION}
EOF

upload_image "${BUILD_DIR}/version.txt"

# Create a named symlink.
set_build_symlinks latest "${FLAGS_group}-latest"

Expand All @@ -230,5 +226,3 @@ if [[ "${PROD_IMAGE}" -eq 1 ]]; then
fi

command_completed


25 changes: 2 additions & 23 deletions build_library/build_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,13 @@ extract_update() {
local image_name="$1"
local disk_layout="$2"
local update_path="${BUILD_DIR}/${image_name%_image.bin}_update.bin"
local digest_path="${update_path}.DIGESTS"

"${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" \
extract "${BUILD_DIR}/${image_name}" "USR-A" "${update_path}"

# Compress image
files_to_evaluate+=( "${update_path}" )
declare -a compressed_images
declare -a extra_files
compress_disk_images files_to_evaluate compressed_images extra_files

# Upload compressed image
upload_image -d "${digest_path}" "${compressed_images[@]}" "${extra_files[@]}"

# Upload legacy digests
upload_legacy_digests "${digest_path}" compressed_images
compress_disk_images files_to_evaluate

# For production as well as dev builds we generate a dev-key-signed update
# payload for running tests (the signature won't be accepted by production systems).
Expand All @@ -87,8 +78,6 @@ extract_update() {
-new_image "${update_path}" \
-new_kernel "${BUILD_DIR}/${image_name%.bin}.vmlinuz" \
-out_file "${update_test}"

upload_image "${update_test}"
}

zip_update_tools() {
Expand All @@ -100,8 +89,6 @@ zip_update_tools() {
export REPO_MANIFESTS_DIR SCRIPTS_DIR
"${BUILD_LIBRARY_DIR}/generate_au_zip.py" \
--arch "$(get_sdk_arch)" --output-dir "${BUILD_DIR}" --zip-name "${update_zip}"

upload_image "${BUILD_DIR}/${update_zip}"
}

generate_update() {
Expand All @@ -123,16 +110,8 @@ generate_update() {

# Compress image
declare -a files_to_evaluate
declare -a compressed_images
declare -a extra_files
files_to_evaluate+=( "${update}.bin" )
compress_disk_images files_to_evaluate compressed_images extra_files

# Upload images
upload_image -d "${update}.DIGESTS" "${update}".{gz,zip} "${compressed_images[@]}" "${extra_files[@]}"

# Upload legacy digests
upload_legacy_digests "${update}.DIGESTS" compressed_images
compress_disk_images files_to_evaluate
}

# ldconfig cannot generate caches for non-native arches.
Expand Down
16 changes: 1 addition & 15 deletions build_library/dev_container_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,6 @@ create_dev_container() {
finish_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${image_contents}" "${image_contents_wtd}"

declare -a files_to_evaluate
declare -a compressed_images
declare -a extra_files

files_to_evaluate+=( "${BUILD_DIR}/${image_name}" )
compress_disk_images files_to_evaluate compressed_images extra_files

upload_image -d "${BUILD_DIR}/${image_name}.DIGESTS" \
"${BUILD_DIR}/${image_contents}" \
"${BUILD_DIR}/${image_contents_wtd}" \
"${BUILD_DIR}/${image_packages}" \
"${BUILD_DIR}/${image_licenses}" \
"${compressed_images[@]}" \
"${extra_files[@]}"

# Upload legacy digests
upload_legacy_digests "${BUILD_DIR}/${image_name}.DIGESTS" compressed_images
compress_disk_images files_to_evaluate
}
2 changes: 0 additions & 2 deletions build_library/generate_au_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
# GLOBALS
STATIC_FILES = ['%s/version.txt' % REPO_MANIFESTS_DIR,
'%s/common.sh' % SCRIPTS_DIR,
'%s/core_pre_alpha' % SCRIPTS_DIR,
'%s/core_roller_upload' % SCRIPTS_DIR,
'%s/core_sign_update' % SCRIPTS_DIR,
]

Expand Down
18 changes: 1 addition & 17 deletions build_library/modify_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,8 @@ finish_modify_image() {


declare -a files_to_evaluate
declare -a compressed_images
declare -a extra_files

files_to_evaluate+=( "${DST_IMAGE}" )
compress_disk_images files_to_evaluate compressed_images extra_files

upload_image -d "${DST_IMAGE}.DIGESTS" \
"${compressed_images[@]}" \
"${extra_files[@]}"

# Upload legacy digests
upload_legacy_digests "${DST_IMAGE}.DIGESTS" compressed_images

for filename in "${EXTRA_FILES[@]}"; do
if [[ -e "${BUILD_DIR}/${filename}" ]]; then
upload_image "${BUILD_DIR}/${filename}"
fi
done
compress_disk_images files_to_evaluate

set_build_symlinks "${FLAGS_group}-latest"

Expand Down
64 changes: 2 additions & 62 deletions build_library/prod_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ create_prod_image() {
sudo rsync -a --delete "${BUILD_DIR}/configroot/etc/portage" "${BUILD_DIR}/root_fs_dir2/etc"
sudo mksquashfs "${BUILD_DIR}/root_fs_dir2" "${BUILD_DIR}/${image_sysext_base}" -noappend -xattrs-exclude '^btrfs.'
sudo rm -rf "${BUILD_DIR}/root_fs_dir2"

# clean-ups of things we do not need
sudo rm ${root_fs_dir}/etc/csh.env
sudo rm -rf ${root_fs_dir}/etc/env.d
Expand Down Expand Up @@ -180,56 +180,8 @@ EOF
"${image_initrd_contents_wtd}" \
"${image_disk_usage}"

# Upload
local to_upload=(
"${BUILD_DIR}/${image_contents}"
"${BUILD_DIR}/${image_contents_wtd}"
"${BUILD_DIR}/${image_packages}"
"${BUILD_DIR}/${image_sbom}"
"${BUILD_DIR}/${image_licenses}"
"${BUILD_DIR}/${image_kernel}"
"${BUILD_DIR}/${image_pcr_policy}"
"${BUILD_DIR}/${image_grub}"
"${BUILD_DIR}/${image_kconfig}"
"${BUILD_DIR}/${image_initrd_contents}"
"${BUILD_DIR}/${image_initrd_contents_wtd}"
"${BUILD_DIR}/${image_disk_usage}"
"${BUILD_DIR}/${image_sysext_base}"
)

# append sysext inventories to uploads
if [[ -n "${base_sysexts}" ]] ; then
local inventory_file="" image_basename="${image_name%.bin}"

for inventory_file in "${image_contents}" "${image_contents_wtd}" "${image_disk_usage}" "${image_packages}" ; do
local suffix="${inventory_file/${image_basename}/}" sysext=""

for sysext in ${base_sysexts//,/ }; do
local name="${sysext%:*}"
local sysext_inventory="${root_fs_sysexts_output_dir}/${name}${suffix}"
if [[ ! -f "${sysext_inventory}" ]] ; then
die "Sysext inventory file '${name}${suffix}' for '${inventory_file}' not found in '${root_fs_sysexts_output_dir}'"
fi
to_upload+=( "${sysext_inventory}" )
done
done
fi

local files_to_evaluate=( "${BUILD_DIR}/${image_name}" )
declare -a compressed_images
declare -a extra_files
compress_disk_images files_to_evaluate compressed_images extra_files
to_upload+=( "${compressed_images[@]}" )
to_upload+=( "${extra_files[@]}" )

# FIXME(bgilbert): no shim on arm64
if [[ -f "${BUILD_DIR}/${image_shim}" ]]; then
to_upload+=("${BUILD_DIR}/${image_shim}")
fi
upload_image -d "${BUILD_DIR}/${image_name}.DIGESTS" "${to_upload[@]}"

# Upload legacy digests
upload_legacy_digests "${BUILD_DIR}/${image_name}.DIGESTS" compressed_images
compress_disk_images files_to_evaluate
}

create_prod_tar() {
Expand All @@ -246,13 +198,11 @@ create_prod_tar() {
sudo umount "/mnt/${lodevbase}p9"
sudo rmdir "/mnt/${lodevbase}p9"
sudo losetup --detach "${lodev}"
upload_image "${container}"
}

create_prod_sysexts() {
local image_name="$1"
local image_sysext_base="${image_name%.bin}_sysext.squashfs"
local to_upload=()
for sysext in "${EXTRA_SYSEXTS[@]}"; do
local name="flatcar-${sysext%:*}"
local pkgs="${sysext#*:}"
Expand All @@ -273,15 +223,5 @@ create_prod_sysexts() {
-private_key "/usr/share/update_engine/update-payload-key.key.pem" \
-new_image "${BUILD_DIR}/${name}.raw" \
-out_file "${BUILD_DIR}/flatcar_test_update-${name}.gz"
to_upload+=(
"${BUILD_DIR}/${name}.raw"
"${BUILD_DIR}/${name}_contents.txt"
"${BUILD_DIR}/${name}_contents_wtd.txt"
"${BUILD_DIR}/${name}_disk_usage.txt"
"${BUILD_DIR}/${name}_packages.txt"
"${BUILD_DIR}/flatcar_test_update-${name}.gz"
)
done
upload_image -d ${BUILD_DIR}/sysexts.DIGESTS "${to_upload[@]}"
}

Loading
Loading