#1304 Add eln-nightly.sh and switch to Kiwi for images
Merged 7 months ago by kevin. Opened 9 months ago by sgallagh.
sgallagh/pungi-fedora nightly-compose  into  eln

file added
+165
@@ -0,0 +1,165 @@ 

+ #!/bin/sh

+ 

+ 

+ export LC_ALL=C

+ 

+ CONFIG="eln.conf"

+ TARGET_DIR="/mnt/koji/compose/eln"

+ MD_ARCHIVE_DIR="/mnt/koji/compose/metadata-archive"

+ SERIES_DIR="$MD_ARCHIVE_DIR/series"

+ NIGHTLY="--nightly"

+ SKIP_PHASES=""

+ DEST=$(pwd)

+ DATE=$(date "+%Y%m%d")

+ SHORT="Fedora"

+ RELEASE="eln"

+ COMPSFILE="comps-eln.xml"

+ TMPDIR=`mktemp -d /tmp/$RELEASE.$DATE.XXXX`

+ TOMAIL="devel@lists.fedoraproject.org test-reports@lists.fedoraproject.org"

+ FROM="Fedora ELN Report <rawhide@fedoraproject.org>"

+ RSYNCPREFIX="sudo -u ftpsync"

+ RSYNCTARGET="/pub/eln/"

+ OSTREESRCREPO="/mnt/koji/compose/ostree/repo/"

+ OSTREEDESTREPO="/mnt/koji/ostree/repo/"

+ OLDCOMPOSE_ID=$(cat $TARGET_DIR/LAST_COMPOSE_ID)

+ OLDCOMPOSE_DATE=$(echo $OLDCOMPOSE_ID|sed -e 's|Fedora-.*-||g'|cut -d "." -f1)

+ # uncomment and edit for resuming a failed compose

+ #COMPOSE_ID="Fedora-23-20150530.n.0"

+ 

+ # assume a releng dir is a git checkout of the releng repo

+ # if it does not exist clone it

+ if [ -d releng ]; then

+     pushd releng

+     git pull --rebase

+     popd

+ else

+     git clone https://pagure.io/releng.git

+ fi

+ 

+ # Set up our fedora messaging function, using the releng repo definition

+ FEDMSG_MODNAME="compose"

+ FEDMSG_CERTPREFIX="releng"

+ . ./releng/scripts/fedora-messaging.sh

+ 

+ # Announce that we are starting, even though we don't know the compose_id yet..

+ fedora_message_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s"}' "$RELEASE" "$ARCH" "$SHORT")

+ send_fedora_message "${fedora_message_json_start}" ${RELEASE} start

+ 

+ CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --notification-script=pungi-wait-for-signed-ostree-handler --config=$CONFIG --old-composes=$TARGET_DIR $OLD_COMPOSES_DIR $NIGHTLY $SKIP_PHASES"

+ 

+ if [ -z "$COMPOSE_ID" ]; then

+     CMD="$CMD --target-dir=$TARGET_DIR"

+ else

+     CMD="$CMD --debug-mode --compose-dir=$TARGET_DIR/$COMPOSE_ID"

+ fi

+ 

+ time $CMD "$@"

+ if [ "$?" != "0" ]; then

+     exit 1

+ fi

+ 

+ NEWCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE/COMPOSE_ID)

+ NEWCOMPOSE_DATE=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g'|cut -d "." -f1)

+ SHORTCOMPOSE_ID=$(echo $NEWCOMPOSE_ID|sed -e 's|Fedora-.*-||g')

+ 

+ # Set this to use later for a few items include depcheck

+ DESTDIR=$TARGET_DIR/$NEWCOMPOSE_ID

+ # Public URLs the synced compose will wind up at, we put them in fedora-messaging

+ LOCATION="https://dl.fedoraproject.org$RSYNCTARGET"

+ ALT_LOCATION="https://dl.fedoraproject.org$RSYNCALTTARGET"

+ SECONDARY_LOCATION="https://dl.fedoraproject.org$RSYNCSECTARGET"

+ # Update fedora_message template

+ fedora_message_json_start=$(printf '{"log": "start", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s", "alt_location": "%s", "secondary_location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID", "$LOCATION", "$ALT_LOCATION", "$SECONDARY_LOCATION")

+ fedora_message_json_done=$(printf '{"log": "done", "branch": "%s", "arch": "%s", "short": "%s", "compose_id": "%s", "location": "%s", "alt_location": "%s", "secondary_location": "%s"}' "$RELEASE" "$ARCH" "$SHORT" "$NEWCOMPOSE_ID" "$LOCATION" "$ALT_LOCATION" "$SECONDARY_LOCATION")

+ 

+ # Fix permissions on the grub efi files and fonts (they're 0600)

+ chmod -R go+r $DESTDIR/compose/*/*/os/EFI/

+ 

+ if ! compose-changelog -p "$DESTDIR/logs/" "$TARGET_DIR/$OLDCOMPOSE_ID/" "$DESTDIR/" 2>"$DESTDIR/logs/changelog.stderr"; then

+     # Generating changelog failed. We should not send an empty announcement to

+     # general public.

+     TOMAIL=""

+     VERSION="$(rpm -q compose-utils)"

+     # Instead report it to rel-eng@ list.

+     mutt -e "set from=\"$FROM\"" \

+         -e 'set envelope_from=yes' \

+         -s "Generating changelog for $NEWCOMPOSE_ID failed (with $VERSION)" \

+         rel-eng@lists.fedoraproject.org \

+         < "$DESTDIR/logs/changelog.stderr"

+ fi

+ 

+ [ -z "$ARCH" ] && {

+ ./releng/scripts/critpath.py --composeurl file://$DESTDIR/compose -o $DESTDIR/logs/critpath.txt rawhide &> $DESTDIR/logs/critpath.log

+ }

+ 

+ # Tell interested persons that the rsync is starting (zomg!)

+ send_fedora_message "${fedora_message_json_start}" ${RELEASE} rsync.start

+ 

+ # Sync the content to /pub/fedora-eln

+ if [ ! -d "$RSYNCTARGET" ]; then

+   $RSYNCPREFIX mkdir -p "$RSYNCTARGET"

+ fi

+ 

+ included_variants=(

+     AppStream

+     BaseOS

+     CRB

+     Extras

+     HighAvailability

+     NFV

+     ResilientStorage

+     RT

+     SAP

+     SAPHANA

+ )

+ $RSYNCPREFIX compose-partial-copy \

+     --arch=aarch64 --arch=x86_64 --arch=ppc64le --arch=s390x --arch=src \

+     "$DESTDIR" "$RSYNCTARGET/" \

+     ${variants[@]/#/--variant } \

+     --exclude=repodata

+ $RSYNCPREFIX compose-partial-copy \

+     --arch=aarch64 --arch=x86_64 --arch=ppc64le --arch=s390x --arch=src \

+     "$DESTDIR" "$RSYNCTARGET/" \

+     ${variants[@]/#/--variant } \

+     --delete-after

+ $RSYNCPREFIX rm "$RSYNCTARGET/.composeinfo"

+ $RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name "$NEWCOMPOSE_ID"

+ 

+ # hardlink content

+ time hardlink -v "$RSYNCTARGET"

+ 

+ # Tell interested persons that the rsync is done.

+ send_fedora_message "${fedora_message_json_done}" ${RELEASE} rsync.complete

+ 

+ 

+ # Tell everyone by fedora_message about the compose

+ send_fedora_message "${fedora_message_json_done}" ${RELEASE} complete

+ 

+ # Tell everyone by email about the compose

+ # "$DESTDIR/logs/depcheck" lets not cat out depcheck for now as it does

+ # not understand rich dependencies

+ if [[ $NEWCOMPOSE_DATE -gt $OLDCOMPOSE_DATE ]]; then

+     # Only send one compose report per day or we'll be spamming

+     # the devel list.

+     SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes'

+     for tomail in $TOMAIL ; do

+         cat $DESTDIR/logs/*verbose  | \

+             mutt -e "set from=\"$FROM\"" -e 'set envelope_from=yes' -s "$SUBJECT" $tomail

+     done

+ 

+     # Save the new compose ID so we don't resend again until the next day

+     echo -n $NEWCOMPOSE_ID > $TARGET_DIR/LAST_COMPOSE_ID

+ fi

+ 

+ # Copy the metadata to the non-garbage-collected metadata archive

+ YEAR=$(echo "${SHORTCOMPOSE_ID}" | cut -c1-4)

+ mkdir -p "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ID}"

+ cp "${DESTDIR}"/compose/metadata/*.json "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ID}/"

+ # Add the compose ID to the 'series' file which records the

+ # compose IDs for each SHORT name in order

+ mkdir -p "${SERIES_DIR}"

+ echo "${NEWCOMPOSE_ID}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}"

+ 

+ # Removed all the older than 14 days composes

+ find $TARGET_DIR  -xdev -depth -maxdepth 2 -mtime +14  -exec rm -rf {} \;

+ send_fedora_message "${fedora_message_json_done}" ${RELEASE} cleanup.complete

file modified
+42 -42
@@ -69,51 +69,51 @@ 

  # live_images ignores this in favor of live_target

  global_target = 'eln'

  

- translate_paths = [ # required by image-build

-         ("/srv/odcs", "https://odcs.fedoraproject.org/composes"),

- ]

+ # kiwi images need another target that uses old mock chroot

+ kiwibuild_target = 'eln-kiwi'

+ 

+ # kiwi image global configuration

+ kiwibuild_description_scm = 'git+https://pagure.io/fedora-kiwi-descriptions.git?#HEAD'

+ kiwibuild_description_path = 'Fedora-ELN.kiwi'

+ kiwibuild_version = '11'

+ kiwibuild_repo_releasever = 'eln'

+ 

+ # <name>-<version>-<ID>.<arch>

+ kiwibuild_bundle_name_format = '%N-%v-%I.%A'

  

- image_build = {

-     "^BaseOS$": [

+ kiwibuild = {

+     '^BaseOS$': [

+         {

+             'kiwi_profile': 'Cloud-Base-Generic',

+             'arches': ['aarch64', 'ppc64le', 's390x', 'x86_64'],

+             'repos': ['AppStream', 'CRB'],

+             'failable': ['*']

+         },

          {

-             "image-build": {

-                 "format": [("qcow2", "qcow2")],

-                 "name": "Fedora-ELN-Guest",

-                 "version": "11.0",

-                 "kickstart": "fedora-eln-guest.ks",

-                 "ksversion": "F26",

-                 "distro": "Fedora-20",

-                 "disk-size": "10",

-                 "arches": ["x86_64", "aarch64"],

-                 'install_tree_from': 'BaseOS',

-                 "repo": ["BaseOS","AppStream","CRB"],

-                 "subvariant": "generic",

-                 "failable": ["*"],

-             },

-             "factory-parameters": {

-                 "generate_icicle": False,

-             }

+             'kiwi_profile': 'Cloud-Base-Azure',

+             'arches': ['aarch64', 'x86_64'],

+             'repos': ['AppStream', 'CRB'],

+             'failable': ['*']

          },

          {

-             'image-build': {

-                     'format': [('docker', 'tar.xz')],

-                     'name': 'Fedora-Container-Base',

-                     'kickstart': 'fedora-eln-container-base.ks',

-                     'distro': 'Fedora-22',

-                     'disk_size': 10,

-                     'repo': ["BaseOS","AppStream","CRB"],

-                     'install_tree_from': 'BaseOS',

-                     'subvariant': 'Container_Base',

-                     'arches': ['aarch64', 'ppc64le', 's390x', 'x86_64'],

-                     'failable': ['*'],

-                     },

-             'factory-parameters': {

-                 'dockerversion': "1.10.1",

-                 'docker_cmd':  '[ "/bin/bash" ]',

-                 'docker_env': '[ "DISTTAG=elncontainer", "FGC=eln", "container=oci" ]',

-                 'docker_label': '{ "name": "fedora-eln", "license": "MIT", "vendor": "Fedora Project", "version": "eln"}',

-             },

+             'kiwi_profile': 'Cloud-Base-AmazonEC2',

+             'arches': ['aarch64', 'x86_64'],

+             'repos': ['AppStream', 'CRB'],

+             'failable': ['*']

          },

-     ],

+         {

+             'kiwi_profile': 'Cloud-Base-GCE',

+             'arches': ['aarch64', 'x86_64'],

+             'repos': ['AppStream', 'CRB'],

+             'failable': ['*']

+         },

+         {

+             'kiwi_profile': 'Container-Base-Generic',

+             'arches': ['aarch64', 'ppc64le', 's390x', 'x86_64'],

+             'repos': ['AppStream', 'CRB'],

+             'target': global_target,

+             'failable': ['*'],

+             'bundle_name_format': '%N-%s-%I.%A.%T'

+         },

+     ]

  }

- 

file modified
+8 -1
@@ -3,10 +3,11 @@ 

  release_version = RELEASE_VERSION

  release_is_layered = False

  

- link_type = "abspath-symlink"

  product_id_allow_missing = True

  productimg = False

  

+ koji_profile = 'compose_koji'

+ 

  create_jigdo = False

  

  # Wait for 60 * 20 seconds (20 minutes) for packages to sign.
@@ -33,3 +34,9 @@ 

          "*": EXTRA_FILES,

      }),

  ]

+ 

+ # Needed for Kiwi image builds since they don't have access to /mnt/koji

+ translate_paths = [

+    ('/mnt/koji/compose/', 'https://kojipkgs.fedoraproject.org/compose/'),

+    ("/srv/odcs", "https://odcs.fedoraproject.org/composes"),

+ ]

This script will replace the ODCS compose that ELN has been using as well as its reliance on ImageFactory.

Signed-off-by: Stephen Gallagher sgallagh@redhat.com

COMPSFILE="comps-eln.xml" ??

Does this need to be rawhide@?

Is this section supposed to be commented out?

Looks like TREENAME needs a change for ELN?

Which is aarch64 excluded here?

COMPSFILE="comps-eln.xml" ??

Good catch

Does this need to be rawhide@?

I'm not sure about that; I don't know if that's a real address that can accept replies. I know eln@ wouldn't be. @kevin ?

Is this section supposed to be commented out?

It exists and is commented out in the Fedora version too. I left it in out of caution, but I can kill it.

Looks like TREENAME needs a change for ELN?

Weird, I definitely remember changing that... or planning to. I'll fix that up.

Which is aarch64 excluded here?

That was copied as-is from the Fedora one. I have no idea what that line does, to be honest.

1 new commit added

  • First round of review fixes
9 months ago

Yeah, it has to be 'rawhide' as thats whats subscribed to those lists. I mean I guess we could make a eln alias and subscribe that, but it's just to get it to post...

The comps file checkout can be removed (both here and rawhide's) as pungi checks that out/makes that these days.

We actually don't send broken deps emails anymore, so that could just be removed.

There were dep issues/dnf solver issues with that script for a long while.
I think you can just disable / remove the call to it... unless you wish to use it for eln and get it working. ;)

I'd remove the block_retired calls, they aren't used anymore even in rawhide.

The sync section needs a bunch of work. rawhide is weird because we split things into fedora and fedora-secondary.
Since I doubt eln is going to need that, perhaps we could just remove the entire syncing section for now? That way you could test making composes and then when things look as you like, we can sort the sync out? I am thinking we should just sync to /pub/fedora/eln/ ?

as far as testing... I have made a /mnt/koji/compose/eln/ dir, so you should be able to try a compose in there.

Can we get the metadata keep stuff I wrote recently added to this one, too?

rebased onto 6e6d863

8 months ago

we fixed the depcheck issues years ago, I think - if you look at the file it generates, e.g. https://kojipkgs.fedoraproject.org/compose/rawhide/Fedora-Rawhide-20240828.n.0/logs/depcheck , it looks pretty correct to me.

We turned off sending the emails in 2018 with the note that "when we think its good enough, then we can enable sending emails". I would say we could probably turn it back on again (and we could've done two years ago).

...still, it may not make sense to email a report for ELN. I would expect it to be pretty redundant with the Rawhide report, and we never mailed reports for any branch other than Rawhide before.

Well, IMHO, we have FTI now, which does this same thing, but by filing bugs (which is better than spamming people). I don't see the point in doing both.

nm that last deleted comment, not relevant for a nightly script.

rebased onto 6e6d863

8 months ago

1 new commit added

  • fixup! Replace ImageFactory with Kiwi
8 months ago

rebased onto 6e6d863

8 months ago

rebased onto 6e6d863

8 months ago

3 new commits added

  • Only generate compose changelogs once per day
  • Include translate paths for kiwi
  • Only send email to sgallagh while developing
8 months ago

rebased onto 6e6d863

8 months ago

6 new commits added

  • Only generate compose changelogs once per day
  • Only send email to sgallagh while developing
  • Keep metadata where it won't be garbage collected
  • Review changes vol. 2
  • First round of review fixes
  • Add eln-nightly.sh
8 months ago

rebased onto 6e6d863

8 months ago

1 new commit added

  • Use new bundle_name_format
8 months ago

8 new commits added

  • Only generate compose changelogs once per day
  • Only send email to sgallagh while developing
  • Keep metadata where it won't be garbage collected
  • Review changes vol. 2
  • First round of review fixes
  • Add eln-nightly.sh
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

rebased onto 6e6d863

8 months ago

8 new commits added

  • NOPUSH: Only send email to sgallagh while developing
  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Review changes vol. 2
  • First round of review fixes
  • Add eln-nightly.sh
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

8 new commits added

  • NOPUSH: Only send email to sgallagh while developing
  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Review changes vol. 2
  • First round of review fixes
  • Add eln-nightly.sh
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

9 new commits added

  • NOPUSH: Only send email to sgallagh while developing
  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Review changes vol. 2
  • First round of review fixes
  • Add eln-nightly.sh
  • Temporarily drop the UEFI-UKI image
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

6 new commits added

  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Add eln-nightly.sh
  • Temporarily drop the UEFI-UKI image
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

6 new commits added

  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Add eln-nightly.sh
  • Temporarily drop the UEFI-UKI image
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

1 new commit added

  • Enable rsync to /pub/fedora-eln
8 months ago

7 new commits added

  • Enable rsync to /pub/fedora-eln
  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Add eln-nightly.sh
  • Temporarily drop the UEFI-UKI image
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
8 months ago

I think this is ready for proper review now.

7 new commits added

  • Enable rsync to /pub/eln
  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Add eln-nightly.sh
  • Temporarily drop the UEFI-UKI image
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
7 months ago

7 new commits added

  • Enable rsync to /pub/eln
  • Only generate compose changelogs once per day
  • Keep metadata where it won't be garbage collected
  • Add eln-nightly.sh
  • Temporarily drop the UEFI-UKI image
  • Use new bundle_name_format
  • Replace ImageFactory with Kiwi
7 months ago

Rebased atop changes to https://pagure.io/pungi-fedora/pull-request/1324 and adjusted the rsync location to /pub/eln after pushback against using /pub/fedora-eln.

rebased onto 9daa92f

7 months ago

Looking at https://kojipkgs.fedoraproject.org/compose/eln/Fedora-eln-20240905.n.1/ some more changes in the configuration are needed. The compose is still using link_type = "abspath-symlink", which should IMO be changed to the default hardlink-or-copy (or just delete the option completely, hardlinking is the default).

rebased onto a651aed

7 months ago

Looking at https://kojipkgs.fedoraproject.org/compose/eln/Fedora-eln-20240905.n.1/ some more changes in the configuration are needed. The compose is still using link_type = "abspath-symlink", which should IMO be changed to the default hardlink-or-copy (or just delete the option completely, hardlinking is the default).

Thanks, I dropped that option in the latest push.

rebased onto a4d62dc

7 months ago

This MR contains all of the contents from https://pagure.io/pungi-fedora/pull-request/1324 and has superseded it. Please see that thread for history of those patches.

rebased onto a4d62dc

7 months ago

Lets give it a go. ;)

Pull-Request has been merged by kevin

7 months ago