Skip to content
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

ofg: prepare use of cached images #12693

Merged
merged 9 commits into from
Nov 7, 2024
Merged

ofg: prepare use of cached images #12693

merged 9 commits into from
Nov 7, 2024

Conversation

DavidKorczynski
Copy link
Collaborator

Signed-off-by: David Korczynski <[email protected]>
Signed-off-by: David Korczynski <[email protected]>
Signed-off-by: David Korczynski <[email protected]>
@DavidKorczynski
Copy link
Collaborator Author

The CACHE_IMAGE is defined as argument to the Dockerfile as created in this PR: google/oss-fuzz-gen#696

@@ -387,7 +387,8 @@ def get_docker_build_step(image_names,
directory,
use_buildkit_cache=False,
src_root='oss-fuzz',
architecture='x86_64'):
architecture='x86_64',
cache_name=''):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: replace cache_name with cache_image to be clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if use_caching:
# Use cached built image.
build_steps = []
cache_name = ('us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we reuse the existing stuff here instead?

return self.cached_image(self.cached_sanitizer)

We probably need to just remove lines 188-189, and just have:

  def cached_image(self):
    return _CACHED_IMAGE.format(name=self.real_name, sanitizer=self.cached_sanitizer)

We'll also have to delete lines 380-381 in this file, and just move the project.cached_sanitizer = project.sanitizers[0] here. Please also add a TODO here to support multiple sanitizers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add a TODO here to support multiple sanitizers.

I don't think we need this because we set it one at the time:

project_yaml['sanitizers'] = ['address']

and

build = build_project.Build('libfuzzer', 'coverage', 'x86_64')

@oliverchang oliverchang merged commit e3ccf89 into master Nov 7, 2024
16 of 18 checks passed
@oliverchang oliverchang deleted the add-arg-cloud-build branch November 7, 2024 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants