#3896 user and cron script point for automated nightly or weekly cloud image builds
Closed: Fixed None Opened 10 years ago by mattdm.

Background from https://fedoraproject.org/wiki/Features/FirstClassCloudImages/KojiPlan

[[Image(https://fedoraproject.org/w/uploads/f/f1/Kojiplan.jpg)]]

This ticket is for the thing on the very leftmost of the picture -- a cron job that automatically starts the image builds. This should go "live" right after the F20 branch, although having it run against rawhide until then to get the bugs shaken out would be ideal.

It would be convenient, I think, if this were somewhere where I could edit exactly ''which'' images get built without needing to go through someone else, but if that needs to go through process that's okay too.

Likewise, we initially spoke of weekly, but if we have the storage and processing resources to do nightly, that's even better.

In addition to the cron job, I think it makes sense for the koji task started to run under dedicated credentials, with a pseudo-user "image-builder" which would not be used for anything else. Failing that, if an existing real user is required, I guess mattdm is as good as any.

The cron commands would call the following script, with parameters releasever, arch, and repolist.

Eventually, I hope we can get rid of "arch" as parameter and have it build for all archs automatically.

{{{
RELEASE=$1
ARCH=$2
REPOLIST=$3
DATE=$( date +%Y%m%d )
VERSION=$DATE
NAME=Fedora-$RELEASE-cloud-$ARCH
if [[ "$RELEASE" == "rawhide" ]]; then
TARGET=rawhide
else
TARGET=dist-$RELEASE
fi
KICKSTART=cloud-kickstarts/generic/fedora-$RELEASE-$ARCH-cloud.ks

KICKSTARTDIR=$( mktemp -d )

pushd $KICKSTARTDIR

git clone https://git.fedorahosted.org/cgit/cloud-kickstarts.git

koji spin-appliance $NAME $VERSION $TARGET $ARCH $KICKSTART --repo=$REPOLIST

popd
rm -rf $KICKSTARTDIR

}}}


So, we have this in place now for rawhide and branched, nightly.

http://koji.fedoraproject.org/koji/tasks?state=all&view=tree&method=appliance&order=-id

These still don't show up on the fedmsg bus as they are scratch builds, but we have another ticket ( ticket #3929 ) to add messages for those.

Is there anything further on this ticket? Or can we close it out now?

That's awesome -- thanks!

I think we can close this and make new tickets for further enhancements as needed.

Login to comment on this ticket.

Metadata