Project

General

Profile

Actions

Bug #5017

closed

ttcn3-*-test/Dockerfile: Does not invalidate cache on changes of deps/Makefile

Added by laforge about 3 years ago. Updated about 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Start date:
02/10/2021
Due date:
% Done:

100%

Spec Reference:

Description

The typical docker files for packaging one of our test suites looks like this:

ARG     USER
FROM    $USER/debian-stretch-titan

RUN     git clone git://git.osmocom.org/osmo-ttcn3-hacks.git

RUN     cd osmo-ttcn3-hacks && \
        git checkout -f -B master origin/master && \
        make deps

ARG     OSMO_TTCN3_BRANCH="master" 

ADD     http://git.osmocom.org/osmo-ttcn3-hacks/patch?h=$OSMO_TTCN3_BRANCH /tmp/commit
RUN     cd osmo-ttcn3-hacks && \
        git fetch && \
        git checkout $OSMO_TTCN3_BRANCH && \
        (git symbolic-ref -q HEAD && git reset --hard origin/$OSMO_TTCN3_BRANCH || exit 1); \
        git rev-parse --abbrev-ref HEAD && git rev-parse HEAD && \
        make ggsn_tests

We just ran into massive build failures, as an update to Makefile/deps does not trigger re-build of the Docker images. The "ADD" of the http;//git.osmocom.org URL is done only after the "build dependencies step. So no matter what one commits to deps/Makefile, the container will always start at that "ADD", keeping the old dependencies without any way to force a related rebuild other than manually logging into all build slaves and deleting the respective images (basically all of them).

Now we could simply move that ADD line up in all dockerfiles, but I think the solution is actually rather to include the 'deps' in the debian-stretch-titan image altogether. We could then (hopefully)
  • use jenkins to trigger a build of that image whenever there's a change in the deps/ subdirectory of osmo-ttcn3-hacks.git only
  • push that image to registry.osmocom.org
  • make all other build jobs use that image from the registry, rather than rebuilding from scratch

This approach has the added benefit of reducing build times (cloning dozens of 'deps' git repositories on each build of each slave) and of course reduce traffic and unneccessary load on the git servers.


Checklist

  • clone osmo-ttcn3-hacks and deps in debian-stretch-titan instead of ttcn3-*/Dockerfile
  • make sure 'make deps' runs if OSMO_TTCN3_BRANCH change results in different deps
  • set it up to push debian-stretch-titan to registry.osmocom.org
  • make all other build jobs use that image from the registry, rather than rebuilding from scratch
  • trigger rebuilds of debian-stretch-titan for registry.osmocom.org, if deps change
Actions #1

Updated by osmith about 3 years ago

  • Status changed from New to In Progress
Actions #2

Updated by osmith about 3 years ago

  • Checklist item clone osmo-ttcn3-hacks and deps in debian-stretch-titan instead of ttcn3-*/Dockerfile added
  • Checklist item make sure 'make deps' runs if OSMO_TTCN3_BRANCH change results in different deps added
  • Checklist item set it up to push debian-stretch-titan to registry.osmocom.org added
  • Checklist item make all other build jobs use that image from the registry, rather than rebuilding from scratch added
  • Checklist item trigger rebuilds of debian-stretch-titan for registry.osmocom.org, if deps change added
  • % Done changed from 0 to 60

[...] the solution is actually rather to include the 'deps' in the debian-stretch-titan image altogether

Done (and while at it, some related redundancy moved from ttcn3-*/Dockerfile to debian-stretch-titan):

https://gerrit.osmocom.org/q/topic:ttcn3-move-deps

Actions #3

Updated by osmith about 3 years ago

  • Checklist item set it up to push debian-stretch-titan to registry.osmocom.org set to Done
  • Checklist item make all other build jobs use that image from the registry, rather than rebuilding from scratch set to Done
  • Checklist item trigger rebuilds of debian-stretch-titan for registry.osmocom.org, if deps change set to Done
  • % Done changed from 60 to 90

docker-playground patches rolled out, and new registry related patches submitted (under same topic, see link above).

Actions #4

Updated by osmith about 3 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)