Compare commits
23 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e996a1358 | ||
|
|
08b86c0759 | ||
|
|
0d7e74fa4a | ||
|
|
3e2dd8f1a3 | ||
|
|
583d963554 | ||
|
|
ec6291028c | ||
|
|
1bc946b6bb | ||
|
|
da2cab94ec | ||
|
|
6cae4ca9aa | ||
|
|
f7a61386b4 | ||
|
|
0fda47c2ef | ||
|
|
b2beebd8d6 | ||
|
|
49bbe467d9 | ||
|
|
220559ddd9 | ||
|
|
8c2e1a884f | ||
|
|
b6f101df00 | ||
|
|
a75c386bf7 | ||
|
|
69a2072bdc | ||
|
|
2f6b649943 | ||
|
|
ce5eaa7cff | ||
|
|
b45ec3b7c4 | ||
|
|
16b70e0849 | ||
|
|
8793fd5b80 |
4 changed files with 204 additions and 101 deletions
|
|
@ -22,7 +22,7 @@ sigkeys = ['a15B79cc']
|
|||
tree_arches = ['aarch64', 'x86_64']
|
||||
# limit tree variants
|
||||
# if undefined, all variants from variants.xml will be included
|
||||
tree_variants = ['IoT']
|
||||
tree_variants = ['bootc']
|
||||
hashed_directories = True
|
||||
|
||||
# RUNROOT settings
|
||||
|
|
@ -87,13 +87,6 @@ lorax_options = [
|
|||
})
|
||||
]
|
||||
|
||||
additional_packages = [
|
||||
('^IoT$$', {
|
||||
'*': [
|
||||
'*',
|
||||
],
|
||||
}),
|
||||
]
|
||||
multilib = [
|
||||
('^Everything$', {
|
||||
'x86_64': ['devel', 'runtime'],
|
||||
|
|
@ -203,71 +196,25 @@ translate_paths = [
|
|||
]
|
||||
|
||||
# These will be inherited by live_media, live_images and image_build
|
||||
global_ksurl = 'git+https://pagure.io/fedora-kickstarts.git?#HEAD'
|
||||
global_ksurl = 'git+https://pagure.io/fedora-kickstarts.git?#origin/f40'
|
||||
global_release = '!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN'
|
||||
global_version = '40'
|
||||
# live_images ignores this in favor of live_target
|
||||
global_target = 'f40'
|
||||
|
||||
osbuild = {
|
||||
"^IoT$": [
|
||||
{
|
||||
"name": "%s" % release_name,
|
||||
"distro": "fedora-40",
|
||||
"image_types": ["iot-raw-image"],
|
||||
"target": "f%s-candidate" % release_version,
|
||||
ostree_container = {
|
||||
"^bootc$": {
|
||||
"version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
|
||||
"config_url": "https://pagure.io/fedora-iot/base-images",
|
||||
"config_branch": "f41-stable",
|
||||
"treefile": "fedora-40.yaml",
|
||||
"repo": ["https://kojipkgs.fedoraproject.org/compose/40/Fedora-40-20240414.0/compose/Everything/$basearch/os/",
|
||||
"https://kojipkgs.fedoraproject.org/compose/updates/f40-updates/compose/Everything/$basearch/os/"],
|
||||
"arches": ["x86_64", "aarch64"],
|
||||
"repo": ["https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/compose/Everything/$arch/os/"],
|
||||
"ostree_url": "https://kojipkgs.fedoraproject.org/compose/iot/repo/",
|
||||
"ostree_ref": "fedora/rawhide/$arch/iot",
|
||||
"subvariant": "IoT",
|
||||
},
|
||||
{
|
||||
"name": "%s-ostree" % release_name,
|
||||
"distro": "fedora-40",
|
||||
"image_types": ["iot-installer"],
|
||||
"target": "f%s-candidate" % release_version,
|
||||
"arches": ["x86_64", "aarch64"],
|
||||
"repo": ["https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/compose/Everything/$arch/os/"],
|
||||
"ostree_url": "https://kojipkgs.fedoraproject.org/compose/iot/repo/",
|
||||
"ostree_ref": "fedora/rawhide/$arch/iot",
|
||||
"subvariant": "IoT",
|
||||
"manifest_type": "dvd-ostree",
|
||||
},
|
||||
{
|
||||
"name": "%s" % release_name,
|
||||
"distro": "fedora-40",
|
||||
"image_types": ["iot-bootable-container"],
|
||||
"target": "f%s-candidate" % release_version,
|
||||
"arches": ["x86_64", "aarch64"],
|
||||
"repo": ["https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/compose/Everything/$arch/os/"],
|
||||
"ostree_url": "https://kojipkgs.fedoraproject.org/compose/iot/repo/",
|
||||
"ostree_ref": "fedora/rawhide/$arch/iot",
|
||||
"subvariant": "IoT",
|
||||
"failable": ["*"],
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
ostree = {
|
||||
"^IoT$": {
|
||||
"version": "!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN",
|
||||
"force_new_commit": True,
|
||||
"unified_core": True,
|
||||
"treefile": "fedora-iot.yaml",
|
||||
"config_url": "https://pagure.io/fedora-iot/ostree.git",
|
||||
"config_branch": "main",
|
||||
"repo": [
|
||||
"IoT",
|
||||
"https://kojipkgs.fedoraproject.org/compose/rawhide/latest-Fedora-Rawhide/compose/Everything/$basearch/os/"
|
||||
]
|
||||
"tag_ref": False,
|
||||
"ostree_repo": "/mnt/koji/compose/iot/repo/",
|
||||
"ostree_ref": "fedora/rawhide/${basearch}/iot",
|
||||
"runroot_packages": ["selinux-policy-targeted"],
|
||||
"arches": ["x86_64", "aarch64"],
|
||||
"update_summary": True,
|
||||
}
|
||||
"failable": ['*'],
|
||||
"subvariant": "base",
|
||||
"name": "Fedora-base-bootc",
|
||||
},
|
||||
}
|
||||
|
||||
koji_profile = 'compose_koji'
|
||||
180
sync-bootc-base-containers.sh
Executable file
180
sync-bootc-base-containers.sh
Executable file
|
|
@ -0,0 +1,180 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
#
|
||||
# Sync latest docker image
|
||||
#
|
||||
# Docs in the f_help function
|
||||
f_ctrl_c() {
|
||||
printf "\n*** Exiting ***\n"
|
||||
exit $?
|
||||
}
|
||||
# trap int (ctrl-c)
|
||||
trap f_ctrl_c SIGINT
|
||||
f_help() {
|
||||
cat <<EOF
|
||||
NAME
|
||||
${0}
|
||||
SYNOPSIS
|
||||
${0} FEDORA_RELEASE IMAGE_URL [-s]
|
||||
OPTIONS
|
||||
-s - Sync the stage registries instead of production
|
||||
DESCRIPTION
|
||||
This is a stop-gap solution to identify parent inheritance of container
|
||||
images until the container release automation[0] is in place and we have
|
||||
fully automated rebuilds[1] in OSBS.
|
||||
This information should be used such that the images can be rebuilt and
|
||||
released in the appropriate order using flr-koji.
|
||||
[0] - https://pagure.io/releng-automation
|
||||
[1] - https://osbs.readthedocs.io/en/latest/multiarch.html#chain-rebuilds
|
||||
EXAMPLE
|
||||
${0} 26
|
||||
EOF
|
||||
}
|
||||
|
||||
ARCHES=("aarch64" "x86_64")
|
||||
|
||||
arch_to_goarch() {
|
||||
local a=$1; shift
|
||||
# See https://github.com/coreos/stream-metadata-go/blob/c5fe1b98ac1b1e6ab62a606b7580dc1f30703f83/arch/arch.go#L14
|
||||
case "$a" in
|
||||
aarch64) echo arm64 ;;
|
||||
x86_64) echo amd64 ;;
|
||||
*) echo $a ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# This is the release of Fedora that is currently stable, it will define if we
|
||||
# need to move the fedora:latest tag
|
||||
current_stable="41"
|
||||
# Define what is rawhide so we know to push that tag
|
||||
current_rawhide="42"
|
||||
# Sanity checking
|
||||
if ! [[ "${1}" =~ ^-?[0-9]+$ ]];
|
||||
then
|
||||
printf "ERROR: FEDORA_RELEASE missing or invalid\n"
|
||||
f_help
|
||||
exit 1
|
||||
fi
|
||||
# Determine if we want stage or not (yes, I know this should be getops but I
|
||||
# don't want this script to survive so we're doing quick and dirty.
|
||||
#
|
||||
# If ${stage} is a non-zero length string, then perform staging
|
||||
stage=""
|
||||
if [[ "${3}" == "-s" ]]; then
|
||||
printf "INFO: PERFORMING STAGE SYNC\n"
|
||||
stage="true"
|
||||
fi
|
||||
|
||||
basename="Fedora-IoT-bootc"
|
||||
format="oci-archive"
|
||||
vers=${1}
|
||||
compose=${2}
|
||||
compdate=`echo ${compose} | cut -c 4-`
|
||||
|
||||
# Obtain the latest build
|
||||
#
|
||||
# Need fXX-updates-canddiate to get actual latest nightly
|
||||
# Can't currently query koji for runroot tasks as they're not tagged
|
||||
#
|
||||
# base_build_nvr=$(koji -q latest-build --type=image f${1}-updates-candidate ${basename} | awk '{print $1}')
|
||||
base_build_nvr=${basename}-${vers}-${compdate}
|
||||
|
||||
if [[ ${1} -eq "$current_stable" ]]; then
|
||||
tagname="latest"
|
||||
fi
|
||||
if [[ ${1} -eq "$current_rawhide" ]]; then
|
||||
tagname="rawhide"
|
||||
fi
|
||||
if [[ -z "$stage" ]]; then
|
||||
registries=("registry.fedoraproject.org" "candidate-registry.fedoraproject.org" "quay.io/fedora")
|
||||
else
|
||||
registries=("registry.stg.fedoraproject.org" "candidate-registry.stg.fedoraproject.org")
|
||||
fi
|
||||
|
||||
# Copy a local image to all necessary remote registries
|
||||
copy_image() {
|
||||
local src=$1; shift
|
||||
local name=$1; shift
|
||||
for registry in ${registries[@]}; do
|
||||
skopeo copy $src docker://${registry}/${name}
|
||||
done
|
||||
}
|
||||
|
||||
# From already uploaded architecture-specific images, generate a manifest listed image
|
||||
# on all registries
|
||||
generate_manifest_list() {
|
||||
local name=$1; shift
|
||||
local version=$1; shift
|
||||
for registry in "${registries[@]}"
|
||||
do
|
||||
printf "Push manifest to ${registry}\n"
|
||||
if [ -n "$tagname" ]
|
||||
then
|
||||
printf "tag is set: ${tagname}\n"
|
||||
buildah rmi "${registry}/${name}:${tagname}" || true
|
||||
buildah manifest create "${registry}/${name}:${tagname}"
|
||||
for arch in "${ARCHES[@]}"; do
|
||||
buildah manifest add --arch=$(arch_to_goarch ${arch}) "${registry}/${name}:${tagname}" "docker://${registry}/${name}:${version}-${arch}"
|
||||
done
|
||||
buildah manifest push "${registry}/${name}:${tagname}" "docker://${registry}/${name}:${tagname}" --all
|
||||
fi
|
||||
buildah rmi "${registry}/${name}:${version}" || true
|
||||
buildah manifest create "${registry}/${name}:${version}"
|
||||
for arch in "${ARCHES[@]}"; do
|
||||
buildah manifest add --arch=$(arch_to_goarch ${arch}) "${registry}/${name}:${version}" "docker://${registry}/${name}:${version}-${arch}"
|
||||
done
|
||||
buildah manifest push "${registry}/${name}:${version}" "docker://${registry}/${name}:${version}" --all
|
||||
done
|
||||
}
|
||||
|
||||
find_and_copy_images() {
|
||||
local nvr=$1
|
||||
local registry_name=$2
|
||||
local release=$3
|
||||
local name
|
||||
if [[ ${registry_name} = "fedora-bootc" ]]; then
|
||||
name=${basename}
|
||||
else
|
||||
printf "Unexpected image type! If we added a new one, it needs mapping here"
|
||||
exit 1
|
||||
fi
|
||||
# Check both architectures completed in the build else exit
|
||||
if [ ! -f "/mnt/koji/compose/iot/Fedora-IoT-${release}-${compdate}/compose/bootc/x86_64/images/${basename}-${release}.${compdate}.ociarchive" ] && \
|
||||
[ ! -f "/mnt/koji/compose/iot/Fedora-IoT-${release}-${compdate}/compose/bootc/aarch64/images/${basename}-${release}.${compdate}.ociarchive" ]; then
|
||||
echo "One of the expected images are missing, exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
work_dir=$(mktemp -d)
|
||||
pushd ${work_dir} &> /dev/null
|
||||
# Import the image
|
||||
for arch in "${ARCHES[@]}"; do
|
||||
local filename
|
||||
filename="/mnt/koji/compose/iot/Fedora-IoT-${release}-${compdate}/compose/bootc/${arch}/images/${basename}-${release}.${compdate}.ociarchive"
|
||||
copy_image ${format}:${filename} ${registry_name}:${release}-${arch}
|
||||
done
|
||||
|
||||
popd &> /dev/null
|
||||
|
||||
generate_manifest_list ${registry_name} ${release}
|
||||
printf "Removing temporary directory\n"
|
||||
rm -rf $work_dir
|
||||
}
|
||||
|
||||
#
|
||||
# Version should not be higher than rawhide
|
||||
# Either there is a mistake or script is out of date
|
||||
#
|
||||
if [[ ${1} -gt "$current_rawhide" ]]; then
|
||||
printf "ERROR: VERSION HIGHER THAN RAWHIDE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf "Syncing compose contailers: ${vers} : ${compose}\n"
|
||||
|
||||
# For fedora-bootc
|
||||
if [[ -n ${base_build_nvr} ]]; then
|
||||
find_and_copy_images ${base_build_nvr} fedora-bootc ${vers} ${compose}
|
||||
fi
|
||||
|
|
@ -4,7 +4,7 @@ LABEL=$1
|
|||
# Remove the label from arguments. It gets special treatment. Other arguments
|
||||
# to the script are passed to pungi-koji directly.
|
||||
shift
|
||||
CONFIG="fedora-iot.conf"
|
||||
CONFIG="fedora-bootc.conf"
|
||||
TARGET_DIR="/mnt/koji/compose/iot"
|
||||
NIGHTLY=""
|
||||
DEST=$(pwd)
|
||||
|
|
@ -18,7 +18,7 @@ TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX`
|
|||
TOMAIL="iot@lists.fedoraproject.org"
|
||||
FROM="Fedora IoT Report <rawhide@fedoraproject.org>"
|
||||
RSYNCPREFIX="sudo -u ftpsync"
|
||||
RSYNCTARGET="/pub/alt/iot/rawhide/"
|
||||
RSYNCTARGET="/pub/alt/iot/branched/"
|
||||
OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)
|
||||
|
||||
# assume a releng dir is a git checkout of the releng repo
|
||||
|
|
@ -47,36 +47,6 @@ time $CMD "$@"
|
|||
if [ "$?" != "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
ostree summary --update --repo=/mnt/koji/compose/iot/repo/
|
||||
|
||||
NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)
|
||||
SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g')
|
||||
|
||||
./releng/scripts/build_composeinfo "$TARGET_DIR/$NEWCOMPOSE_ID/" --name "$NEWCOMPOSE_ID"
|
||||
|
||||
DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID
|
||||
# Public URL the synced compose will wind up at, we put it in fedmsgs
|
||||
LOCATION="https://dl.fedoraproject.org$RSYNCTARGET"
|
||||
# Update fedmsg template
|
||||
fedmsg_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID", "$LOCATION")
|
||||
fedmsg_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID" "$LOCATION")
|
||||
|
||||
$RSYNCPREFIX mkdir -p $DESTDIR
|
||||
# Tell interested persons that the rsync is starting (zomg!)
|
||||
send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start
|
||||
for dir in IoT metadata ;
|
||||
do
|
||||
$RSYNCPREFIX rsync -avhH --delete-after $DESTDIR/compose/$dir/ "$RSYNCTARGET/$dir/" ;
|
||||
$RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name $NEWCOMPOSE_ID
|
||||
done
|
||||
# Tell interested persons that the rsync is done.
|
||||
send_fedmsg "${fedmsg_json_done}" ${RELEASE} rsync.complete
|
||||
# Tell everyone by fedmsg about the compose
|
||||
send_fedmsg "${fedmsg_json_done}" ${RELEASE} complete
|
||||
SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes'
|
||||
#for tomail in $TOMAIL ; do
|
||||
# cat $DESTDIR/logs/*verbose $DESTDIR/logs/depcheck | \
|
||||
# mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail
|
||||
#done
|
||||
|
||||
find $TARGET_DIR -xdev -depth -maxdepth 2 -mtime +14 -name Fedora-IoT-${RELEASE}\* -exec rm -rf {} \;
|
||||
# Push containers
|
||||
#./sync-bootc-base-containers.sh ${RELEASE} ${LABEL}
|
||||
|
|
|
|||
|
|
@ -7,4 +7,10 @@
|
|||
<arch>x86_64</arch>
|
||||
</arches>
|
||||
</variant>
|
||||
<variant id="bootc" name="bootc" type="variant" is_empty="true">
|
||||
<arches>
|
||||
<arch>aarch64</arch>
|
||||
<arch>x86_64</arch>
|
||||
</arches>
|
||||
</variant>
|
||||
</variants>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue