Skip to content

Commit

Permalink
Add tags to cloud build from target_experiment.py (#12520)
Browse files Browse the repository at this point in the history
This helps us to identify and debug cloud build from OFG.
  • Loading branch information
DonggeLiu authored Sep 20, 2024
1 parent a958ed8 commit bf53d7f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions infra/build/functions/target_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

def run_experiment(project_name, target_name, args, output_path, errlog_path,
build_output_path, upload_corpus_path, upload_coverage_path,
experiment_name, upload_reproducer_path):
experiment_name, upload_reproducer_path, tags):
config = build_project.Config(testing=True,
test_image_suffix='',
repo=build_project.DEFAULT_OSS_FUZZ_REPO,
Expand Down Expand Up @@ -279,15 +279,13 @@ def run_experiment(project_name, target_name, args, output_path, errlog_path,
credentials, _ = google.auth.default()
# Empirically, 3 hours is more than enough for 30-minute fuzzing cloud builds.
build_lib.BUILD_TIMEOUT = 3 * 60 * 60
build_id = build_project.run_build(project_name,
steps,
credentials,
'experiment',
experiment=True,
extra_tags=[
f'experiment-{experiment_name}',
f'experiment-{project_name}'
])
build_id = build_project.run_build(
project_name,
steps,
credentials,
'experiment',
experiment=True,
extra_tags=[experiment_name, project_name] + tags)

print('Waiting for build', build_id)
try:
Expand Down Expand Up @@ -328,12 +326,13 @@ def main():
parser.add_argument('--experiment_name',
required=True,
help='Experiment name.')
parser.add_argument('--tags', nargs='*', help='Tags for cloud build.')
args = parser.parse_args()

run_experiment(args.project, args.target, args.args, args.upload_output_log,
args.upload_err_log, args.upload_build_log, args.upload_corpus,
args.upload_coverage, args.experiment_name,
args.upload_reproducer)
args.upload_reproducer, args.tags)


if __name__ == '__main__':
Expand Down

0 comments on commit bf53d7f

Please sign in to comment.