Skip to content

Move remaining Chef cookbooks to the new CI process

As part of this OKR, and a continuation of the work performed in this issue, we need to complete the migration of our Chef cookbooks to the new CI process established.

It may make sense to start working through a list, starting with the most commonly used cookbooks, and adding the new process as well as Ubuntu 22.04 platforms to the test suites. An initial list with count of nodes using them:

{
  "counts": {
    "cookbooks": {
      "gitlab_users": 765, # done
      "gitlab-server": 765, # done
      "gitlab-vault": 765, # done
      "gitlab-openssh": 765, # done
      "gitlab_secrets": 765, # done
      "gitlab_sudo": 765, # done
      "gitlab-exporters": 758, # done
      "gitlab_fluentd": 744, # done
      "gitlab-mtail": 611, # done
      "gitlab_consul": 609, # done
      "gitlab_osquery": 604, # done
      "gitlab-teleport": 583, # done
      "gitlab-mitigate-sackpanic": 220, # done
      "omnibus-gitlab": 208, # done
      "gitlab-wiz-sensor": 197, # done
      "gitlab-redis-cluster": 174, # done
      "cookbook-gitlab-runner": 135, # done
      "cookbook-wrapper-gitlab-runner": 135, # done
      "gitlab-pgbouncer": 123, # done
      "gitlab-monitor": 91, # done
      "gitlab-haproxy": 89, # done
      "gitlab_redis_backup": 81, # done
      "gitlab-prometheus": 80, # done
      "gitlab-patroni": 78, # done
      "gitlab_walg": # done
      "gitlab_redis_analysis": 33 # done
    }
  },
  "unused": {}
}

The above was generated using this script

be chef-artifacts.rb --no-unused --count --cookbooks -j > used-cookbooks.json

Note: This output contains community managed cookbooks that don't need to be addressed by this issue, we only need to be addressing cookbooks that we directly maintain, I've attempted to prune the list, but I may have missed some.

The general process I've been using to prepare the cookbooks with the new CI process, and add Ubuntu 22.04 support is as follows:

  1. Ensure both the cookbook in question AND the template cookbook are checked out in the same $COOKBOOK_PATH directory.
  2. Execute this script with the only parameter being the name of the cookbook you're updating. This script is currently only in the mattmi/scripts-for-upgrading-chef branch
  3. In the cookbook repository, run git diff to sanity check the changes. Notably, ensure that kitchen suites are populated in .gitlab-ci.yml.
  4. A new branch will have already been created locally, commit your changes and push to remote.
  5. Verify that the pipelines succeed.

It's possible that pipelines may not immediately succeed on the new Ubuntu platforms, and minor changes will need to be made to the cookbook. In my initial testing, these cases have been fairly rare. If there are non-trivial changes needed to get the pipelines to pass, an issue should be created detailing the problem.

Edited by Matt Miller