docs/dev/ci/README.md
Buildkite has a feature called dynamic pipelines that allows for generate the pipeline.yaml file using any language. We implemented the new chef pipelines using bash instead of expeditor so that the pipeline configuration would be part of the chef/chef repo and not a proprietary tool which the community does not have access to change.
The new verify pipeline runs on pull-requests, merges to main (release builds). It runs all of the previous unit, functional and integration tests but inside of an omnibus-toolchain docker container. At run time, the .buildkite-platform.json file is used to determine the version of omnibus-toolchain and chef-foundation to install. This will help keep the dependencies used to build chef in source control for reproducing builds later on.
This pipeline also builds and tests omnibus packages in a subset of the supported platforms. This is to ensure a pull-requests does not break an omnibus build before merging. All of these platforms are now running in omnibus-toolchain docker containers as well so developers can debug locally easier and the build & test environments are never tainted by previous executions. Omnibus packages built by a pull-request are available from the buildkite artifact store.
The release pipeline is just the verify pipeline again but with additional steps to upload the artifacts to artifactory and make them available in the "current" channel of omnitruck.
The new adhoc pipeline can be used by a chef organization member to test an omnibus build & test of "esoteric" platforms or a specific platform before merging a pull-request.
The adhoc pipeline is just the verify pipeline again but only the omnibus build & test steps.
The build-test-omnibus script is a shared script executed by both the verify pipeline and adhoc pipeline. It is meant to keep the pipelines DRY.
Chef pipelines upload and make available the artifacts they create to the following locations.
| Location | verify | validate/release | validate/adhoc |
|---|---|---|---|
| Buildkite Artifacts | Yes | Yes | Yes |
| Artifactory | No | Yes | No |
Omnibus packages for chef-infra-client are built & tested on either a docker container or a virtual machine.
| Name | Compute | Pipeline |
|---|---|---|
| amazon-2 | :whale: | verify, validate/adhoc, validate/release |
| centos-6 | :whale: | verify, validate/adhoc, validate/release |
| centos-7 | :whale: | verify, validate/adhoc, validate/release |
| centos-8 | :whale: | verify, validate/adhoc, validate/release |
| rhel-9 | :whale: | verify, validate/adhoc, validate/release |
| debian-9 | :whale: | verify, validate/adhoc, validate/release |
| debian-10 | :whale: | verify, validate/adhoc, validate/release |
| debian-11 | :whale: | verify, validate/adhoc, validate/release |
| ubuntu-1604 | :whale: | verify, validate/adhoc, validate/release |
| ubuntu-1804 | :whale: | verify, validate/adhoc, validate/release |
| ubuntu-2004 | :whale: | verify, validate/adhoc, validate/release |
| ubuntu-2204 | :whale: | verify, validate/adhoc, validate/release |
| sles-15 | :whale: | verify, validate/adhoc, validate/release |
| windows-2019 | :whale: | verify, validate/adhoc, validate/release |
| windows-2012 | :computer: / :whale: | verify, validate/adhoc, validate/release |
| windows-2012r2 | :computer: / :whale: | verify, validate/adhoc, validate/release |
| windows-2016 | :computer: / :whale: | verify, validate/adhoc, validate/release |
| windows-2022 | :computer: / :whale: | verify, validate/adhoc, validate/release |
| windows-10 | :computer: / :whale: | verify, validate/adhoc, validate/release |
| windows-11 | :computer: / :whale: | verify, validate/adhoc, validate/release |
Containers exist for windows platforms but integration tests cannot pass inside a docker container.
| Name | Compute | Pipeline |
|---|---|---|
| aix-7.1-powerpc | :computer: | validate/adhoc, validate/release |
| aix-7.2-powerpc | :computer: | validate/adhoc, validate/release |
| aix-7.3-powerpc | :computer: | validate/adhoc, validate/release |
| el-7-ppc64 | :computer: | validate/adhoc, validate/release |
| el-7-ppc64le | :computer: | validate/adhoc, validate/release |
| el-7-s390x | :computer: | validate/adhoc, validate/release |
| el-8-s390x | :computer: | validate/adhoc, validate/release |
| freebsd-12-amd64 | :computer: | validate/adhoc, validate/release |
| freebsd-13-amd64 | :computer: | validate/adhoc, validate/release |
| mac_os_x-10.15-x86_64 | :computer: | validate/adhoc, validate/release |
| mac_os_x-11-x86_64 | :computer: | validate/adhoc, validate/release |
| mac_os_x-12-x86_64 | :computer: | validate/adhoc, validate/release |
| mac_os_x-11-arm64 | :computer: | validate/adhoc, validate/release |
| mac_os_x-12-arm64 | :computer: | validate/adhoc, validate/release |
| solaris2-5.11-i386 | :computer: | validate/adhoc, validate/release |
| solaris2-5.11-sparc | :computer: | validate/adhoc, validate/release |
| sles-12-s390x | :computer: | validate/adhoc, validate/release |
| sles-15-s390x | :computer: | validate/adhoc, validate/release |
Esoteric platforms have limited availability so they are not tested on pull-requests unless using the adhoc pipeline
There are three ways to trigger chef's verify pipeline.
bk build create command.bk build create --pipeline=chef-oss/chef-main-verify
There are three ways to trigger chef's validate/release pipeline.
bk build create command.bk build create --pipeline=chef/chef-main-validate-release
There are two ways we recommend to trigger you validate/adhoc pipeline.
bk build create command.bk build create --pipeline=chef/chef-main-validate-adhoc
The OMNIBUS_FILTER feature of the expeditor-generated omnibus pipelines is supported by the dynamic buildkite pipeline. See the OMNIBUS_FILTER section of the expeditor docs for a description of how that works.
There are two ways of viewing the pipeline YAML that is generated by .buildkite/verify.pipeline.sh.
Via the Buildkite UI. Once a build has been triggered, navigate to the job and expand the upload step. There is a tab labeled timeline that will show the YAML generated by the dynamic pipeline.
Via executing the script. Generate the pipeline YAML by executing the script, passing the required environment variables.
export OMNIBUS_TOOLCHAIN_VERSION=3.0.0
export CHEF_FOUNDATION_VERSION=3.0.3
export BUILDKITE_ORGANIZATION_SLUG="chef" # or chef-oss
export BUILDKITE_PIPELINE_SLUG="chef-main-validate-release"
./.buildkite/verify.pipeline.sh
Let's break down the steps of the chef verify pipeline build and walk through all the processes.
.buildkite-platform.json file for the versions of tools it needs to install at runtime and exports them as environment variables.We chose docker containers because they provide a clean-room environment for each omnibus build. It also makes it much easier to add support for platforms when they can be containerized. We realize this adds complexity to the pipeline because there are 2 different types of compute now but the trade-offs are (hopefully) worth it.
</details> <details> <summary>2. Why did we introduce chef-foundation?</summary>The introduction of chef-foundation is to help prevent the need to compile runtime dependencies for chef with each release. It is also meant to help speed up builds and make adding newer versions of runtime dependencies like ruby easier.
</details> <details> <summary>3. Why are the previous adhoc and release pipelines still there?</summary>They are kept around for historical purposes. Once this pipeline is backported to chef 16 and 17 and deemed stable, they can be removed. Removing them from .expeditor/config.yml will delete the pipelines in buildkite.