freeipa / freeipa-openshift-container

FreeIPA container for OpenShift 4
4 stars 7 forks source link

more local build improvements #15

Closed frasertweedale closed 4 years ago

frasertweedale commented 4 years ago
604b75a (Fraser Tweedale, 9 minutes ago)
   build: separate build step for devel package install

   To speed up building during development, make the installation of packages
   from the development repo a separate build step, after the initial dnf
   upgrade/install/clean.  This saves a lot of time during build because we
   already have a cached layer with packages upgraded and FreeIPA packages
   installed.

   To avoid having a layer with package metadata present, only to be cleaned
   in a subsequent build step (a waste of space in the image), both dnf build
   steps have to download (and clean up) all the repo metadata.  This is not
   ideal as it does waste some time downloading the repo data two times, but I
   don't see a good workaround.

0312e25 (Fraser Tweedale, 2 hours ago)
   build: avoid cache invalidation due to repo file

   Build caching is aware of not only the content of files that are added to
   the image via COPY, but also the mtime.  Therefore using curl to fetch the
   repo file defeats build caching.

   To avoid spurious cache invalidation, download the repo file to a temp
   file.  Only replace the existing repo file if the content changed, or if
   user demands is via $FORCE.

de565d9 (Fraser Tweedale, 3 hours ago)
   do not override storage driver for local build

   For compatibility with podman, use the default storage driver for a local
   build.  When podman is configured to use overlay, it cannot see or prune
   vfs images, even when you specify --storage-driver=vfs:

       % podman --storage-driver=vfs image prune
      Error: database storage graph driver "overlay" does not match our
      storage graph driver "vfs": database configuration mismatch

   Because buildah does not offer a prune command, this is very annoying - the
   caches grows and grows but the tooling provides no way to prune it. 
   Therefore it is better to just use the same storage driver as podman
   (overlay).

   Also add a message that prints whether the script is invoking buildah
   locally or in a container.
avisiedo commented 4 years ago

I have tested locally and it is working like a charm: BUILDAH_DIRECT=1 COPR_REPO="https://copr.fedorainfracloud.org/coprs/g/freeipa/freeipa-master/repo/fedora-32/group_freeipa-freeipa-master-fedora-32.repo" ./devel/build-from-repo.sh

The current build failure is handled at: https://github.com/freeipa/freeipa-openshift-container/pull/16 that is not related with the scope of this PR.

avisiedo commented 4 years ago

LGTM