Skip to content

Modify sbuild task to use artifacts

Use an artifact as input

On the input side, nothing should have to be changed in the interface. We get an URL to a .dsc, we can submit an URL that points inside a debusine artifact.

The only thing that we need to pay attention to is that if it's an URL pointing to our debusine server, we should send the worker token so that we can access private artifacts too. Currently we were lazy and we were relying on sbuild to download the source package for us. But we can't do that any longer if we want to be able to download private files with the worker token.

Use artifacts as output

When sbuild has done its job, we want to upload the result with multiple artifacts:

  • usually one debian:binary-package (can be two if the build generated arch-specific + arch-all packages)
  • one debian:binary-upload corresponding to the .changes file that has been generated
  • one debian:package-build-log with the build log

The package build log is always uploaded, even for failed builds.

All those artifacts should be owned by the user who submitted the work request.

The task creates relationships between all those artifacts:

  • binary-package has "built-using" with the source package artifact as target
  • binary-upload has "extends" on all the "binary-package" artifacts created
  • binary-upload has "relates-to" on all the "binary-package" artifacts created
  • package-build-log has "relates-to" on all the "binary-package" artifacts created

The way to create relationships between artifact is through the API documented in #65 (closed)

Record the created artifacts

It seems likely that we will want to be able to (programmatically) figure out what artifacts have been created by a given work request. So we should also modify the API used to report a work request as completed so that we can indicate the list of artifacts that have been created. Or maybe that should be recorded as a side-effect of the artifact creation? I'm not sure.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information