Uploaded image for project: 'Machine Config Operator'
  1. Machine Config Operator
  2. MCO-468

MCO should use a build_root image in OpenShift CI

XMLWordPrintable

    • 0
    • 0

      Reviewing the MCO's OpenShift CI config as well as how the repository itself is set up, there are some opportunities to improve how our various checks and static analysis are run.

      Currently, the way we install golangci-lint, go-junit-report, envtest binaries, etc. leaves much to be desired. We do this by running $ go get for each one, which pulls the source code and builds those tools. In the case of golangci-lint, we've added it to our tools.go file, which means it (and its dependencies) are now vendored into our repository, even though none of the MCOs code directly depends on it. This muddies our dependency graph and adds several minutes onto each stage of our CI jobs as these tools must be built from scratch every time.

      OpenShift CI has a way to pre-build the container images used for your build environment. We're partially using this technique now, but not in the most effective way. Using the https://docs.ci.openshift.org/docs/architecture/ci-operator/#build-root-image configuration technique in OpenShift CI, we can have a separate Dockerfile that lives in our repository which contains prebuilt golangci-lint and go-junit-reporter binaries that are cached, reducing our overall test times and allowing us to more readily adopt specialty static analysis checks in the future. Those additional checks could enable us to catch template misconfiguration issues, etc. much faster than in an e2e test.

       

      Done When:

      • The MCO has a Dockerfile.ci image within its repository that installs golangci-lint, go-junit-reporter, etc.
      • The MCO's CI configuration (found in https://github.com/openshift/release) has been adjusted to take advantage of this new Dockerfile.ci image to enable caching as well as having the unit test, bootstrap-unit, and verify tests be adjusted to take advantage of it.
      • The references to golangci-lint are removed from the tools.go file and its vendored source code is deleted from our repository.

              Unassigned Unassigned
              zzlotnik@redhat.com Zack Zlotnik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: