We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.
Contributions to any Google project must be accompanied by a Contributor License Agreement. This is necessary because you own the copyright to your changes, even after your contribution becomes part of this project. So this agreement simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
The tool is designed to support multiple commands. Currently, the tool only
supports one command: reproduce
.
The entry point for reproduce
is tool/clusterfuzz/commands/reproduce.py
.
There are 3 main components:
Testcase
(intool/clusterfuzz/testcase.py
) provides testcase info, downloads a testcase, and provides path to it.BinaryProvider
(intool/clusterfuzz/binary_providers.py
) prepares a binary. It builds the binary, provides path to it, and provides path to source location.Reproducers
(intool/clusterfuzz/reproducers.py
) prepares environment for reproducing (e.g. asan options, putting files in appropriate places), run the binary, and get the result (e.g. symbolize stacktrace).
./pants -V
to bootstrap Pants.- Run the tool's tests:
./pants test.pytest --coverage=1 tool:test
. - Run the ci's tests:
./pants test.pytest --coverage=1 ci/continuous_integration:test
. - Run the tool binary:
./pants run tool:clusterfuzz-ci -- reproduce -h
.
- Check the pip version with
pip --version
. If it's 1.5.4, remove pip withapt-get uninstall python-pip
. Then, install pip version 9 or later. - Install necessary packages with
sudo pip install ansible==2.3.0.0 apache-libcloud==1.5.0 backports.ssl-match-hostname==3.5.0.1
. You should use these exact versions. - Ensure that
~/.ssh/google_compute_engine
exists. If not, please rungcloud compute ssh <instance_name>
to generate one.
From the ci
directory, perform the below steps:
- Increment the version of
image_name
ingroup_vars/all
. - Create and merge the pull request.
- Run
ansible-playbook image.yml
to create an image. This step might take an hour - Re-deploy all CI instances.
The image provides a pre-installed chromium's src. This improves the speed of CI deployment because a deployed CI instance can avoid cloning chromium's src; that could take an hour.
From the ci
directory, perform the below steps:
- Ensure all the latest binaries are present and symlinked in
/google/data/ro/teams/clusterfuzz-tools/releases
. - Run
ansible-playbook playbook.yml -e release=<release-type> -e machine=<machine-name>
whererelease-type
is one of[release, release-candidate, master]
andmachine-name
is the prefix of the machine you wish to update or deploy (for example,machine=release
corresponds to the boot diskrelease-ci-boot
and the machinerelease-ci
).
In general, we deploy 3 CI instances with canonical names:
- Release:
ansible-playbook playbook.yml -e release=release -e machine=release
. - Release Candidate:
ansible-playbook playbook.yml -e release=release-candidate -e machine=release-candidate
. - Master:
ansible-playbook playbook.yml -e release=master -e machine=master
.
The list of deployed CI instances can be seen here. And their success/failure logs can be seen here.
- The CI log is at
/var/log/python-daemon/current
. The reproduce tool's log is at/home/clusterfuzz/.clusterfuzz/logs/output.log
. - The CI should be deployed, at least, once every month because of goma update.
- Runit is used as the process supervision. Its
supervised services live under
/etc/sv
. - Our CI config for Runit lives under
/etc/sv/python-daemon
. - Our CI binary lives under
/python-daemon
. - Our CI's data (e.g. env variables, reproduce binary) lives in
/python-daemon-data
.
We publish our binary to 2 places: Cloud Storage (for public) and X20 (for Googlers).
- Increment the version number in
tool/clusterfuzz/resources/VERSION
. - Create and merge a pull request to increase the version number.
- Run
./pants run butler -- release
.
To see the usage from our users, please see the data in BigQuery. Here are useful links: