FAQ | This is a LIVE service | Changelog

Skip to content

Make Django and Python image building dynamic

Dr Rich Wareham requested to merge django-jobs into master

Move to generating image build jobs for Django, Logan/terraform and Python dynamically by querying the appropriate upstream APIs.

An example pipeline is at https://gitlab.developers.cam.ac.uk/uis/devops/infra/dockerimages/-/pipelines/417382.

This is mostly a genericisation of the previous logan terraform work. We extend our version parsing code to understand PEP440-style versions and code in some knowledge about which Django versions are compatible with which Python versions.

Aside from a fair amount of Python code, the only changes to image building are as follows:

  • The Python alpine image has been updated to allow passing Django versions dynamically rather than having a requirements/django-{...}.txt file for each Django release.
  • We've had to put in some horrible hackery to support both envsubst and build args for Docker image building.
  • Building of django, Python and logan/terraform images are serialised by means of a resource_group since, in testing, the number of dynamic jobs could easily overwhelm the VM runners.

Anticipated Python version support changes for Django 5.0 have been coded in so that we don't get taken by surprise on Django 5.0 release day.

Closes #78 (closed)

Merge request reports