-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
Signed-off-by: David Korczynski <[email protected]>
Signed-off-by: David Korczynski <[email protected]>
Signed-off-by: David Korczynski <[email protected]>
The CACHE_IMAGE is defined as argument to the Dockerfile as created in this PR: google/oss-fuzz-gen#696 |
infra/build/functions/build_lib.py
Outdated
@@ -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=''): |
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.
nit: replace cache_name
with cache_image
to be clearer.
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.
done
if use_caching: | ||
# Use cached built image. | ||
build_steps = [] | ||
cache_name = ('us-central1-docker.pkg.dev/oss-fuzz/oss-fuzz-gen/' |
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.
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.
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.
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') |
Signed-off-by: David Korczynski <[email protected]>
Signed-off-by: David Korczynski <[email protected]>
Ref: google/oss-fuzz-gen#696