-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Migrate CIFuzz and ClusterFuzzLite to Ubuntu 24.04 #14382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/gcbrun trial_build.py zlib |
infra/cifuzz/config_utils.py
Outdated
| def pivot_to_ubuntu_24_04(image_suffix, script_path, check_result=True): | ||
| """Pivots execution to an Ubuntu 24.04 container if needed.""" | ||
| with open('/etc/os-release') as file_handle: | ||
| if 'Noble Numbat' not in file_handle.read(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave a comment what "Noble Numbat" is -- at least I had to look it up for it to make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing major though, am happy to land it without as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just look for the string "24.04" instead :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. I updated it to 24.04 to make it clearer what we are referring to.
DavidKorczynski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…OS version detection logic.
|
/gcbrun trial_build.py zlib |
| ``` | ||
|
|
||
| For OSS-Fuzz projects, this file is located at `projects/<project_name>/project.yaml`. | ||
| For external projects (ClusterFuzzLite), this file is typically located at `.clusterfuzzlite/project.yaml`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it's a bit harder than that. I pointed the action to evverx/clusterfuzzlite@96f6b81 (where the ubuntu-24-04-v1 images are used). The fuzz targets were built successfully and then it all failed with
Traceback (most recent call last):
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 106, in <module>
sys.exit(main())
^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 102, in main
return run_fuzzers_entrypoint()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/run_fuzzers_entrypoint.py", line 56, in run_fuzzers_entrypoint
if config.base_os_version == 'ubuntu-24-04':
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/oss-fuzz/infra/cifuzz/config_utils.py", line 212, in base_os_version
project_yaml_path = os.path.join(self.project_src_path,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen posixpath>", line 76, in join
TypeError: expected str, bytes or os.PathLike object, not NoneTypehttps://github.com/evverx/avahi/actions/runs/19843002708/job/56855185731?pr=3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having taken a closer look it seems PROJECT_SRC_PATH isn't passed on by run_fuzzers. I updated my fork, pointed the action to evverx/clusterfuzzlite@0477702 and triggered ClusterFuzzLite in https://github.com/evverx/avahi/actions/runs/19844232403/job/56858862729?pr=3. It did work.
I don't think it should be necessary to tweak forks but it should be discussed in google/clusterfuzzlite#145 probably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use https://google.github.io/clusterfuzzlite/running-clusterfuzzlite/github-actions/. I'll take a look at #14388 shortly.
**Fix TypeError in ClusterFuzzLite** This PR fixes a TypeError that occurs in ClusterFuzzLite projects when the PROJECT_SRC_PATH environment variable is not set. This issue was introduced in #14382, which added the base_os_version property to check for Ubuntu 24.04 migration. In ClusterFuzzLite (external projects), base_os_version attempts to read project.yaml using PROJECT_SRC_PATH, which can be missing in some configurations. The fix adds a fallback to self.workspace when PROJECT_SRC_PATH is missing, which is the default behavior for ClusterFuzzLite on GitHub Actions. A warning is also logged when this fallback occurs. **Fix CloudBuild tags**: The CloudBuild for infra/cifuzz was failing because it was trying to use the ubuntu-24-04 tag for the base image, but only ubuntu-24-04-v1 was available in GCR. The fix updates infra/cifuzz/cloudbuild.yaml to create both ubuntu-24-04 and ubuntu-24-04-v1 tags for all images. This ensures compatibility with existing configurations while supporting the new versioned tags.
The ubuntu-24-04 images are built now (google/oss-fuzz#14382) and the issue where the PROJECT_SRC_PATH kludge had to be added is addressed in google/oss-fuzz#14388. It can be merged once the action starts fetching the ubuntu-24-04 images in google/clusterfuzzlite#146.
Description
This PR migrates CIFuzz and ClusterFuzzLite to support Ubuntu 24.04. This allows projects to opt-in to a newer build environment by adding
base_os_version: ubuntu-24-04to theirproject.yaml.Changes
infra/cifuzz/cifuzz-base/ubuntu-24-04.Dockerfileinfra/build_fuzzers.ubuntu-24-04.Dockerfileinfra/run_fuzzers.ubuntu-24-04.Dockerfileinfra/cifuzz/build-images.shto build the new images.infra/cifuzz/build_fuzzers_entrypoint.pyandinfra/cifuzz/run_fuzzers_entrypoint.pyto support pivoting to Ubuntu 24.04.infra/cifuzz/config_utils.pyto handle the new base OS version.docs/getting-started/continuous_integration.md.Evidence
Verified the changes by running an external project (zlib) with Ubuntu 24.04.
Build Log Snippet (Ubuntu 24.04)
Run Log Snippet