Job builder on freebsd-14
README
Skip to buildsbuilder - scheduling and executing jobs
This consists of three programs, a worker, a server, and a client. The single server contains a queue of jobs, which are consumed by a worker. Any number of worker can be connected to the server. The client can modify the schedule: add/remove/modify jobs, also observe a concrete job.
The server keeps persistent state of the job queue (so restarts / crashes are dealt with). A worker connects, provides some information about itself, and then waits for a job. Once a job is read and accepted, it is executed by the worker. Resulting artifacts can be transferred by the client to the server.
The client has the ability to schedule jobs at regular intervals - similar to crontab - but workers are usually executed in sandboxes/ jailed environments.
Handled and unhandled error conditions:
- worker execution fails (timeout, restart, killed): not handled, but server has a timeout
- worker execution gets a signal: reported to server
- worker can't write job data files -> failure is captured and reported
- worker can't read job output -> logged to client's console (without artifacts gathered)
- worker errors when submitting console output -> exits
- worker fails communication with server -> job is ignored (the server is responsible for restarting)
A templating mechanism is available, look for orb-build.template
as examples.
Currently FreeBSD, Debian and Ubuntu are supported, and a repository that
receives jobs is live at https://builds.robur.coop/
Linux installation
Install the binary package, edit the "builder" and "builder-worker" services and
start them via systemd. Common things to add to "builder" service scripts are to
set the IP --ip 172.17.0.1
(take care to mark "docker.service" as a dependency
in the After=
line) and an upload URL
--upload https://user:pass@builder-web-host/upload
.
To execute multiple workers, copy the builder-worker service multiple times. You can configure the distribution to use in that as well.
FreeBSD installation
To install a ZFS snapshot for a builder jail, the poudriere utility can be used.
After setting the ZROOT in /usr/local/etc/poudriere.conf, you can setup your
jail snapshots via: poudriere jail -c -j 13-0-REL -m ftp-archive -v 13.0-RELEASE
where the argument -j
is the jailname, and -v
describes the version to
download (NB: look into man poudriere-jail
for further options).
A jail.conf
and a shell script (load.sh
installed as builder_worker.sh
) to
launch a jail are provided in the FreeBSD subdirectory of this repository.
Rename jail.conf.sample
and adjust the exec.start in jail.conf
(and other
paths, such as path) if appropriate. In builder_worker.sh
, adapt the zpool
and zfs snapshot source name.
Before starting your jails, they'll need an Internet connection for downloading
and installing packages, e.g. /etc/pf.conf:
nat pass on "wlan0" inet from "127.0.2.0/24" to any -> ("wlan")
Edit the configuration of the builder
service and the builder_worker
service
by editing your /etc/rc.conf
(again, if you like multiple workers, copy the
service script):
cloned_interfaces="lo1"
- clone the localhost interfaceifconfig_lo1_name="orb"
- name itorb
ipv4_addrs_orb="127.0.2.1/24"
- configure the IP address to 127.0.2.1builder_enable="YES"
- enable builderbuilder_flags="--ip 127.0.2.1 --upload https://user:pass@builder-web-host/upload"
builder_worker_enable="YES"
- enable a builder (using /usr/local/libexec/builder_worker.sh, which uses /usr/local/etc/builder/jail.conf)
Builds
Back to readme- ☑ freebsd-14 2024-12-01 00:27:10Z builder.pkg
SHA256:e6a9cf56e5c71d9fb49f118d37aea19f4902c4408249da6e82b0e4c9012d7a48
(5.66MB) - ☑ freebsd-14 2024-11-14 23:52:51Z builder.pkg
SHA256:09ca3ff9ce01311c9ab4b650423637964b7205da28abde58876f161e288a88c4
(5.15MB) - ☑ freebsd-14 2024-11-06 23:14:50Z builder.pkg
SHA256:1fa07e67872b1cc0fef42f8f8be9fe9b1a47f677ff9e19aa8fb6d9f8f6405d9a
(5.66MB) - ☑ freebsd-14 2024-10-23 23:02:28Z builder.pkg
SHA256:8bd26b41ab2afb5484c3459721c00e76a519b69a1941ca1c5fd71014ac567ef1
(5.16MB) - ☑ freebsd-14 2024-10-10 22:50:56Z builder.pkg
SHA256:ea07b2de2697d57f076b0f9dd8856801a5cb6a9cac90204025785341571c8d83
(5.66MB) - ☑ freebsd-14 2024-09-29 15:04:45Z builder.pkg
SHA256:94dd198a4432331b3c475c770d496d42d5df90b8960a1c89857cba6e09fc58f2
(5.16MB) - ☑ freebsd-14 2024-09-27 14:57:32Z builder.pkg
SHA256:992269e6a9d63af2d1d6397f77ca66ba18528cacc25c7956e3377f53af7a4fd1
(5.65MB) - ☑ freebsd-14 2024-09-13 14:44:58Z builder.pkg
SHA256:20fb7bd4eaf8fda394fd979326be11832b64b823297b53f8a83bb6eb13329500
(5.65MB) - ☑ freebsd-14 2024-09-11 14:48:20Z builder.pkg
SHA256:5085c6d823d0f16af5add043a5db8d998118829e8093893ff8e494b46a91bbf8
(5.01MB) - ☑ freebsd-14 2024-09-05 17:09:32Z builder.pkg
SHA256:cfa9e95a936b7eee1773c35978dbda9e53f1f19369529f9a269464de83d6da8f
(5.02MB) - ☑ freebsd-14 2024-09-05 14:37:27Z builder.pkg
SHA256:cd780794c004e6860d3eb6dd0832c02dcf2b059e71b32a0e8cf76a6a9cf0e91c
(6.45MB) - ☑ freebsd-14 2024-08-28 14:29:58Z builder.pkg
SHA256:8cf05b0552f0dd93547b9299a0ffd3a03f7f42fb11bac1b595a1b995284d8fb3
(5.95MB) - ☑ freebsd-14 2024-08-15 14:17:37Z builder.pkg
SHA256:637a1328cea65a887e148af3c7a9cb35ad9a9a14eff7c27da0869223a16184c9
(5.93MB) - ☑ freebsd-14 2024-07-20 13:58:30Z builder.pkg
SHA256:6c30a79c7fd748bbd4fe84df70db34cecafc5a9386e2207971837d4c7ca4d827
(5.94MB) - ☑ freebsd-14 2024-07-15 11:13:02Z builder.pkg
SHA256:1d4b0eb6b6c4675bdeacc6d7b411fb3db3a2a6ce396b1711b419f29c59c0fa1b
(5.25MB)
Including failed builds here.