Ideally, new platforms can be supported without requiring any changes to the ClusterFuzzLite code base. In most cases however some changes are required or desirable to make configuration work. For example, a new CI platform might call one of the configuration variables needed by ClusterFuzzLite by a different name. For example, GitHub actions refers to
GITHUB_BASE_COMMIT. Handling configuration differences is easy in ClusterFuzzLite. Add a new module to
infra/cifuzz/platform_config/ that implements a
PlatformConfig class. Your
- Be named
- Be defined in a new submodule within
- Inherit from
BasePlatformConfigwhich is defined in
infra/cifuzz/platform_config/__init__.pyYou can refer to the platform_config module for Google Cloud Build (GCB) as an example. Then specify the name of your module using the
CFL_PLATFORMenvironment variable when running ClusterFuzzLite. One of the more important configuration properties your
PlatformConfigclass should define is a filestore. It may be better to let users override this, but it is not required.
The filestore configuration property determines which filestore implementation is used by ClusterFuzzLite. The filestore implementation, as the name suggests, is responsible for storing files that persist after ClusterFuzzLite finishes running a task. These files include:
- Coverage Implementing a filestore may be necessary or desirable for your platform.
If your platform does not offer a way of storing files you can either reuse one of the existing filestores such as
gsutil which supports Google Cloud Storage Buckets and Amazon S3 Buckets or use the
no_filestore implementation. The
no_filestore implementation of every filestore operation is a no-op. Using ClusterFuzzLite with
no_filestore should allow you to run ClusterFuzzLite on your platform without any exceptions, but without most of the important features of ClusterFuzzLite.
You can refer to the filestore module for gsutil as an example for implementing your filestore. To implement a new filestore:
- Create a new subdirectory in
infra/cifuzz/filestorenamed for your filestore.
- Create a file
__init__.pyin this subdirectory that implements the filestore class (which can be named anything).
- Your filestore class must inherit from
BaseFilestorewhich is defined in
- Add a mapping from the filestore name to the class you implemented in