← Back to team overview

ubuntu-docker-images team mailing list archive

Specs for image-builder.py

 

Hi,

Today on MM Bryce and I discussed the possibility of having a new script
to help us build/rebuild/mass-rebuild OCI images.  The need for this is
becoming more and more apparent with every mass-rebuild we have to do,
and with the prospect of having more images and series supported.  The
Launchpad "OCI recipe" page, while informative, requires a lot of clicks
in order to get the job done.

So anyway, Bryce asked me to come up with a list of requirements and
things that I want this script to do.  Here's what comes to mind.

First, a fictitious usage for the script:


  image-builder.py -- Nice text here

  Usage:

    image-builder.py [-h] [--series MM.YY] [--arch ARCH] [--wait] [--auto-retry-uploads] [-- IMAGE_1 IMAGE_2 ... IMAGE_N ]

  Where:

    --series MM.YY        Build only images from the MM.YY series.
                          Optional, can be passed multiple times.
                          If not provided, all series will be built.
                          Supporte series: 20.04, 21.04

    --arch ARCH           Build images only for architecture ARCH.
                          Optional, can be passed multiple times.
                          If not provided, all architectures will be built.
                          Supported architectures: amd64, arm64, ppc64el,
                          s390x

    --wait                Wait until all builds finished, and print
                          their statuses.  This can take a long time.

    --auto-retry-uploads  Auto-retry any failed uploads to the
                          registries.
                          Optional.  Implies "--wait".

    -- IMAGE_N...         Image(s) to build.
                          Optional.
                          If not provided, all images will be built.


A few comments:

- I don't know how feasible it is to implement the auto-retry-uploads
  option; not sure whether Launchpad offers such granularity in their
  API.  I also don't know if it makes sense to embed it into this
  script, or create a separate script just for that (which may make more
  sense).  However, given the number and frequency of failed uploads we
  are having, and especially considering the fact that they are
  currently not being reported anywhere in the LP recipe page (one has
  to go to the specific build page in order to check the upload status;
  check LP#1918908), this IMO is a must-have.

- I considered whether to add the "--wait" option or not.  I decided to
  do it, but I understand that it might be a bit tricky to implement.

- I also thought about having a "--retag" option that would invoke the
  tag-images.sh script automatically after everything is done, but I'm
  not entirely sure this is something fit for this script.  I like
  separating things into logical blocks, so perhaps after this script is
  done we can have a "build-and-retag.{sh,py}" script.

Bryce, if you want to talk more about this tomorrow (possibly involving
Athos, since he will be part of the OCI effort very soon), we can then
come up with a nice way to split the work.

Thanks,

-- 
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0  EB2F 106D A1C8 C3CB BF14

Attachment: signature.asc
Description: PGP signature


Follow ups