#777 Config and script to generate modular build repos using overrides
Closed 2 years ago by mohanboddu. Opened 4 years ago by mohanboddu.
mohanboddu/pungi-fedora modular-build-repo  into  main

@@ -0,0 +1,63 @@ 

+ #!/bin/sh

+ 

+ export LC_ALL=C

+ 

+ CONFIG="fedora-modular-build.conf"

+ TARGET_DIR="/mnt/koji/repos/f32-modular-build/"

+ NIGHTLY="--nightly"

+ SKIP_PHASES="--skip-phase=productimg"

+ DEST=$(pwd)

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

+ SHORT="Fedora-Modular-Build"

+ RELEASE_TITLE="Rawhide"

+ RELEASE="Fedora-Modular-Build-Rawhide"

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

+ OLDCOMPOSE_ID=$(cat $TARGET_DIR/latest-$SHORT-$RELEASE_TITLE/COMPOSE_ID)

+ 

+ # 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 fedmsg function, using the releng repo definition

+ FEDMSG_MODNAME="compose"

+ FEDMSG_CERTPREFIX="releng"

+ . ./releng/scripts/fedmsg-functions.sh

+ 

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

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

+ send_fedmsg "${fedmsg_json_start}" ${RELEASE} start

+ 

+ CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --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_TITLE/COMPOSE_ID)

+ 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

+ # Update fedmsg template

+ fedmsg_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")

+ fedmsg_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")

+ 

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

+ send_fedmsg "${fedmsg_json_start}" ${RELEASE} rsync.start

+ 

+ # Removed all the older than 14 days composes

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

+ send_fedmsg "${fedmsg_json_done}" ${RELEASE} cleanup.complete

@@ -0,0 +1,46 @@ 

+ # PRODUCT INFO

+ release_name = 'Fedora-Modular-Build'

+ release_short = 'Fedora-Modular-Build'

+ release_version = 'Rawhide'

+ release_is_layered = False

+ 

+ module_defaults_dir = {

+     'scm': 'git',

+     'repo': 'https://pagure.io/releng/fedora-module-defaults.git',

+     'branch': 'master',

+     'dir': '.'

+     'module_defaults_override_dir': 'overrides'

+ }

+ 

+ sigkeys = ['12C944D0']

+ 

+ # limit tree architectures

+ # if undefined, all architectures from variants.xml will be included

+ tree_arches = ['aarch64', 'armhfp', 'ppc64le', 's390x', 'x86_64']

+ 

+ hashed_directories = True

+ 

+ # PKGSET

+ pkgset_source = 'koji' # koji, repos

+ 

+ # PKGSET - KOJI

+ pkgset_koji_tag = 'f32-modular-build'

+ pkgset_koji_inherit = False

+ 

+ filter_system_release_packages = False

+ 

+ # GATHER

+ gather_method = {

+     '^.*': {                # For all variants

+         'comps': 'deps',    # resolve dependencies for packages from comps file

+         'module': 'nodeps', # but not for packages from modules

+     }

+ }

+ gather_backend = 'dnf'

+ gather_profiler = True

+ check_deps = False

+ greedy_method = 'build'

+ 

+ repoclosure_backend = 'dnf'

+ 

+ koji_profile = 'compose_koji'

WIP and may be pushed to infra ansible.

Just for review purposes and once approved/decided on location, then we can merge or move it to infra ansible.

Signed-off-by: Mohan Boddu mboddu@bhujji.com

rebased onto 8fd0f8b

4 years ago

Looks ok to me... perhaps @sgallagh and/or @psabata could give it a glance too.

Looks sane to me as well.

@mohanboddu is this relevant? If so could you please rebase it? the Web UI does not allow it.
Also, I can see fedmsg mentioned there should we migrate it to fedora-messaging?

Closing this one for now.

Pull-Request has been closed by mohanboddu

2 years ago