From ec591c06b3669dc11e552abd3068c1a111a52113 Mon Sep 17 00:00:00 2001
From: P. J. McDermott <pehjota>
Date: Sat, 04 Aug 2012 13:45:15 -0400
Subject: Describe programs in build daemon infrastructure.

---
(limited to 'dev/todo')

diff --git a/dev/todo/buildd-infra.mdwn b/dev/todo/buildd-infra.mdwn
index c190031..099d5c7 100644
--- a/dev/todo/buildd-infra.mdwn
+++ b/dev/todo/buildd-infra.mdwn
@@ -38,3 +38,121 @@ The general process is as follows:
     built binary packages.
  6. Users can finally download the source and binary packages from the archive
     using opkg.
+
+
+Daemons and Utilities
+=====================
+
+buildq
+------
+
+**buildq** will be a utility used by upload reviewer(s) to either accept or
+reject package uploads.
+
+This utility handles step 2 in the process above.
+
+Usage:
+
+    buildq accept <source> <version>
+    buildq reject <source> <version>
+
+Operation:
+
+    write remarks template to file
+    $EDITOR $remarks
+    if action == accept
+        touch src:$source_$version_src.opk
+        ln src:$source_$version_src.opk $masterbuildqueue/
+        remove " all " from space-padded Architecture field value
+        if value changed
+            foreach archbuildqueue
+                ln src:$source_$version_src.opk $archbuildqueue/
+        else
+            foreach archbuildqueue
+                if Architecture value matches queue arch (use libopkh for this)
+                    ln src:$source_$version_src.opk $archbuildqueue/
+    rm src:$source_$version_src.opk
+    mail maintainer and uploader
+
+Example mail message:
+
+    From: Distro upload reviewer <uploads@distroname.com>
+    Subject: Accepted foo 1.0-1
+    
+    Remarks:
+     Your upload has been accepted.  The package will be serviced by the 
+     build daemons shortly.  You will be notified if your package fails to
+     build for any architectures or platforms.
+    Source: foo
+    Version: 1.0-1
+    Architecture: any all
+    Distribution: trunk
+    Maintainer: Foo Maintainers <distroname-foo-maint@lists.distroname.com>
+    Changed-By: "P. J. McDermott" <pehjota@distroname.com>
+    Date: Sat, 04 Aug 2012 10:31:40 -0400
+    Changes:
+     foo (1.0-1) trunk
+     .
+       * New package.
+
+buildd
+------
+
+**buildd** will be a daemon that builds packages in its queue(s).
+
+One **buildd** instance can be responsible for multiple architectures if the
+queues are linked together.
+
+This daemon handles step 3 in the process above.
+
+Operation:
+
+    while true
+        headsrcopk = peek $queue (ls -1cr $queue | head -n 1)
+        if no $headsrcopk
+            sleep 00:05:00
+            continue
+        foreach host architecture+platform
+            run builder on $headsrcopk
+            if success
+                mv *.opk $archivequeue/$source
+            else
+                rm *.opk
+                touch $masterbuildqueue/$source_$version.fail
+                mail log to maintainer and uploader
+        pop $headsrcopk (rm $headsrcopk)
+
+builddd
+-------
+
+**builddd** will be a daemon that watches the build daemons and acts on
+successful and failed builds.
+
+This daemon handles step 4 in the process above.
+
+Operation:
+
+    while true
+        doneheadsrcopk = oldest opk in $masterbuildqueue with exactly 1 link
+        if no $doneheadsrcopk
+            sleep 00:05:00
+            continue
+        if no $masterbuildqueue/$source_$version.fail
+            mv $doneheadsrcopk $archivequeue/$package_$version
+        else
+            rm -Rf $archivequeue/$package_$version
+
+archived
+--------
+
+This daemon handles step 5 in the process above.
+
+**archived** will be a daemon that includes built binary packages into the
+package archive.
+
+Operation:
+
+    while true
+        foreach dir in $archivequeue
+            if exists src opk in $dir
+                include $dir/*.opk
--
cgit v0.9.1