Script for triggering builds in ImageFactory
AbandonedPublic

Authored by jskladan on Dec 16 2015, 12:57 PM.

Details

Summary

Use the trigger_build.py to trigger new builds of images in ImageFactory.
ImageFactory's base-url needs to be configured in the code for now (defaults to localhost:8075).

Example usage:

trigger_build.py build --version 23
trigger_build.py build --version 23 --flavor minimal --arch x86_64

The command now only supports minimal flavor, support for more will come, when needed.

There is also a basic functionality for pruning the old and failed-to-build images.
To remove failed builds:

trigger_build.py prune-failed

To remove old images - this means images of a common version, flavor and arch, which became obsolete by new successfully built ones:

trigger_build.py prune-old

By default, the newest image plus one older are kept. If you wish to keep more in the history, use --keep parameter:

trigger_build.py prune-old --keep X
Test Plan

Tested against locally running ImageFactory

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
jskladan retitled this revision from to Script for triggering builds in ImageFactory.Dec 16 2015, 12:57 PM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added a reviewer: libtaskotron.
jskladan added a project: libtaskotron.
tflink accepted this revision.Dec 17 2015, 7:19 AM

I think it's going to need some tweaking going forward but overall, it looks good

This revision is now accepted and ready to land.Dec 17 2015, 7:19 AM

I like how commented the code is :) Some comments below.

trigger_build/kickstarts/minimal.ks
1

I see you're using my kickstart, copycat! Firewall disabled, selinux permissive, root password 'fedora', that has to be mine :-)

I'm not sure all of those settings are perfect for our purposes, food for thought.

10

It might be a good idea to set the default local timezone to be the same as UTC timezone (which means Iceland, which seems to be specified as Atlantic/Reykjavik), so that no matter whether the command in question prints in local time or UTC, it will always be same as UTC.

23

This will probably need to be configurable, so that we can set our internal repo here, when deployed in Fedora infrastructure.

trigger_build/tdl/fedora.tdl
10

I guess this should match the kickstart one.

trigger_build/trigger_build.py
12

I'd rather not use the Fedora master mirror as the default one. You could pick one of the high-bandwidth ones in appropriate location, or probably the best default would be download.fedoraproject.org, which automatically redirects to the closest one. But it shouldn't be used more than once consequently (otherwise you might start pulling files from different mirrors, unsynchronized). I don't know whether oz-install supports that (first resolve the url, check redirection, then pull everything from the new location), but I guess it should be fairly easy to do this with requests beforehand and then give the new location to oz-install. (We should start doing this in libtaskotron as well, I've seen several issues caused by the lack of this).

35–40

If you didn't want to hardcode this, we could possible use yumrepoinfo.conf for this (extend it to know about flavors). Same for RAWHIDE.

jskladan abandoned this revision.Feb 8 2016, 8:43 AM