Closed Bug 1569274 Opened 6 years ago Closed 6 years ago

Updated Dockerfile and circleci configuration to build dependencies into a new bmo-slim image based on Perl 5.30

Categories

(bugzilla.mozilla.org :: Infrastructure, enhancement)

Staging
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dkl, Assigned: dkl)

Details

Attachments

(1 file)

Currently we use a separate repo mozilla-bteam/bmo-systems for building slim images tha contain only the Perl dependency related software and no actual BMO code. When we want to add a new Perl module, etc. we add it that repo, and circleci creates a new mozillabteam/bmo-slim image on Docker Hub. Since Docker now supports multi-stage builds we can add the dependency building part to the first stage of the Dockerfile. The second stage will then copy in only the Perl modules themselves and then add the BMO code and other things needed for a fully working BMO image. This allows the final image to still be as small as possible.

Along with the Dockerfile changes, the circleci config needed to updated to build the new image each time as part of the workflow. And then the tests are ran against the new image that was built earlier.

Attached file GitHub Pull Request

Plan has changed a bit due to issues with CircleCI account and docker layer caching. The caching was important for this in order to get around using an intermediate docker image in the deployment process. Once the Circle CI problems have been solved we can revisit this in a new bug that brings back the single image deployment plan.

For now, I have made the following changes in order to get this landed:

  1. Instead of replying on building the intermediate image from a separate bmo-systems github repo, I have created a Dockerfile.bmo-slim file that lives in the standard BMO repo. The new Dockerfile.bmo-slim uses the same perl-5.30 base image instead of Centos6 as we do currently.
  2. I have updated the README.rst to describe the process for building a new bmo-sim docker image and pushing it to hub.docker.com. This can happen outside of normal deployments by someone with admin access to the Dockerhub registry.
  3. I have updated the CircleCI config to use the new bmo-slim image before performing the automated test and then the final build and push of the completed bmo image.

So whenever we change any dependency requirements in the Makefile.PL or extensions, we will need to first generate the new cpanfile and cpanfile.snapshot, commit those to the repo, and then use the Dockerfile.bmo-slim to generate a new bmo-slim image and push to Dockerhub.

dkl

Summary: Update Dockerfile and circleci config to build dependencies dynamically instead of relying on bmo-slim images → Updated Dockerfile and circleci configuration to build dependencies into a new bmo-slim image based on Perl 5.30

Merged to master.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: