From a4bc23909b873b60630123e3e42b7a7d1d5ee939 Mon Sep 17 00:00:00 2001 From: Oliver Chang Date: Tue, 17 Aug 2021 16:36:06 +1000 Subject: Don't upload builds in run_fuzzers. (#6151) The current way adds a lot of ordering assumptions, and doesn't fit too well with parallel batch fuzzing either. Add a "upload-build" boolean action input that can be added to "build_fuzzers" to upload latest builds instead. Builds are now uploaded by commit hash, rather than a fixed "latest" name. ClusterFuzzLite's download_latest_build will check the last 3 commits and download the first available build by git hash. --- infra/cifuzz/build_fuzzers.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'infra/cifuzz/build_fuzzers.py') diff --git a/infra/cifuzz/build_fuzzers.py b/infra/cifuzz/build_fuzzers.py index 978b50fb6..94478fdc2 100644 --- a/infra/cifuzz/build_fuzzers.py +++ b/infra/cifuzz/build_fuzzers.py @@ -111,6 +111,14 @@ class Builder: # pylint: disable=too-many-instance-attributes self.handle_msan_postbuild(docker_container) return True + def upload_build(self): + """Upload build.""" + if self.config.upload_build: + self.clusterfuzz_deployment.upload_build( + self.repo_manager.get_current_commit()) + + return True + def handle_msan_postbuild(self, container): """Post-build step for MSAN builds. Patches the build to use MSAN libraries.""" @@ -133,7 +141,7 @@ class Builder: # pylint: disable=too-many-instance-attributes and then removes the unaffectted fuzzers. Returns True on success.""" methods = [ self.build_image_and_checkout_src, self.build_fuzzers, - self.remove_unaffected_fuzz_targets + self.upload_build, self.remove_unaffected_fuzz_targets ] for method in methods: if not method(): -- cgit v1.2.3