Skip to content

Commit f04a5d9

Browse files
committed
feat(build): Add version tag support to runner image and update project build steps
1 parent 0b00121 commit f04a5d9

File tree

4 files changed

+298
-251
lines changed

4 files changed

+298
-251
lines changed

infra/build/functions/build_lib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,15 @@ def get_gcb_url(build_id, cloud_project='oss-fuzz'):
677677
f'{build_id}?project={cloud_project}')
678678

679679

680-
def get_runner_image_name(test_image_suffix):
680+
def get_runner_image_name(test_image_suffix, version_tag=None):
681681
"""Returns the runner image that should be used. Returns the testing image if
682682
|test_image_suffix|."""
683683
image = f'gcr.io/{BASE_IMAGES_PROJECT}/base-runner'
684684
if test_image_suffix:
685685
image += '-' + test_image_suffix
686+
687+
if version_tag:
688+
image += ':' + version_tag
686689
return image
687690

688691

infra/build/functions/build_project.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class Config:
8383
build_type: Optional[str] = None
8484
fuzzing_engine: Optional[str] = None
8585
fuzz_target: Optional[str] = None
86+
version_tag: Optional[str] = None
8687

8788

8889
# Allow the WORKDIR to be commented out for OSS-Fuzz-Gen, which creates new
@@ -457,7 +458,7 @@ def get_build_steps_for_project(project,
457458
'*' * 80)
458459
# Test fuzz targets.
459460
test_step = {
460-
'name': build_lib.get_runner_image_name(config.test_image_suffix),
461+
'name': build_lib.get_runner_image_name(config.test_image_suffix, config.version_tag),
461462
'env': env,
462463
'args': [
463464
'bash', '-c',
@@ -488,7 +489,7 @@ def get_build_steps_for_project(project,
488489
# Generate targets list.
489490
{
490491
'name':
491-
build_lib.get_runner_image_name(config.test_image_suffix),
492+
build_lib.get_runner_image_name(config.test_image_suffix, config.version_tag),
492493
'env':
493494
env,
494495
'args': [
@@ -829,7 +830,8 @@ def create_config(args, build_type):
829830
experiment=args.experiment,
830831
build_type=build_type,
831832
fuzzing_engine=args.fuzzing_engine,
832-
fuzz_target=args.fuzz_target)
833+
fuzz_target=args.fuzz_target,
834+
version_tag=getattr(args, 'version_tag', None))
833835

834836

835837
def build_script_main(script_description,

infra/build/functions/run_single_project_build.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)