A web user interface and API for our reproducible builds of MirageOS unikernels and host system tools.
Find a file
rand 0f493e9b47 Removing trailing slashes (#80)
This PR solves the issue of there being both "<url>/" and "<url>" paths, that in the builder-web context shouldn't mean different things.

The slashes are now removed using a `Dream` middleware, and the request is redirected using a permanent redirect (that doesn't change the method used): https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location

Notable changes:
* Trailing slashes from the hardcoded link urls were removed, as unneccesary redirects are then avoided.
* All links in `Views` were rewritten to be absolute instead of relative.
* As `Dream` deprecated `path` - `Utils.Path` was created containing some helpers for manipulating paths. *Note that `String.split_on_char` has a different semantics.*
* A blacklist `routeprefix_blacklist_when_removing_trailing_slash` was added, containing `Dream` route-prefixes to ignore.
* Only `GET` and `HEAD` requests are redirected.
* `redirect_parent` helper was rewritten using new `Utils.Path` functions to avoid brittle string manipulation + fixed the edgecase of redirecting to `/`.
* Added `Uri` dependency to make URL manipulation safer.

Co-authored-by: rand00 <oth.rand@gmail.com>
Co-authored-by: Reynir Björnsson <reynir@reynir.dk>
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/80
Co-authored-by: rand <rand@r7p5.earth>
Co-committed-by: rand <rand@r7p5.earth>
2022-04-21 10:40:21 +00:00
auth add explicit package dependencies 2021-06-09 16:03:03 +00:00
bin Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00
db Fixed that Builder_db_app.job_remove didn't take all related tables into account 2022-02-22 13:16:42 +01:00
http_status_middleware Add http status metrics middleware 2021-06-08 12:36:53 +00:00
lib Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00
opamdiff investigate differences in build, install, and uri when opam file differed (#48) 2021-07-06 08:34:17 +00:00
packaging packaging/visualizations.sh: Failing when unsupported platform 2022-03-23 20:54:35 +01:00
test Fix deprecated uuidm usage 2022-03-16 10:44:23 +00:00
.gitignore .gitignore: Emacs files 2022-02-01 11:30:44 +00:00
.ocp-indent Remove trailing whitespace 2022-02-07 13:51:56 +00:00
builder-web.opam Removing trailing slashes (#80) 2022-04-21 10:40:21 +00:00
CHANGES.md Prepare for initial public release 2021-11-12 13:42:26 +00:00
dune-project Initial commit 2020-12-04 18:10:21 +01:00
LICENSE.md debian packaging 2021-06-29 09:41:05 +00:00
README.md minor stylistic adjustments from reading git diff -w 0afec16..6f3c89c 2022-02-24 14:05:06 +01:00

Builder-web - a web frontend for reproducible builds

Builder-web takes in submissions of builds, typically from builder, and displays the produced artifacts in a way that makes it easy to compare checksums and build status. Produced binaries can be downloaded and executed. builds.robur.coop itself runs builder-web.

Overview

Builder-web is a single binary web server using a sqlite3 database with versioned schemas. Finished builds from builder are uploaded to builder-web, stored and indexed in the database and presented in the web interface to the user. Users can:

  • Get an overview of jobs - a job is typically script or opam package that is run and builds an artifact,
  • Browse all builds of a job - each job may have multiple builds, that are executed periodically by builder
  • Browse individual build and download artifacts and build information for reproducing the same binary.
  • Compare two builds, observing the differences in used opam packages, environment variables, and system packages.
  • Search for the SHA-256 hash of a binary to view a build that resulted in that binary.

Installation

Installing from source can be done with opam: opam install builder-web.

We also provide reproducible binary packages.

Setup

Builder-web consists of a binary builder-web that runs a web server on port 3000 listening on all interfaces by default. These values can be changed with the --port and --host flags respectively. See builder-web --help for more information.

Service scripts for FreeBSD and systemd are provided.

The web server expects a sqlite3 database in its data directory. An empty database can be created with builder-db migrate.

Database migrations

The sqlite3 database builder-web uses contains versioning information. On every schema change the database schema version is updated, and migration and rollback scripts are provided. The tool for database migrations is builder-migrations. See the builder-migrations --help output for each migration for further details.

Less common workflows

Here are listed some less common but useful workflows:

Extracting builds from one server to another

This is useful for development on a separate machine that doesn't run the build jobs itself.

On the source server:

builder-db extract-build <build-hash> --dest <build-hash>.full

After copying the file over the destination server (you need a user first, see builder-db user-add --help):

curl --data-binary @<build-hash>.full http://<user>:<passwd>@localhost:<builder-web-port>/upload