Skip to content

Commit f64d2d5

Browse files
Remove untrusted_runner code from setup.
It's not used anymore.
1 parent a8aafb7 commit f64d2d5

File tree

1 file changed

+3
-49
lines changed
  • src/clusterfuzz/_internal/bot/tasks

1 file changed

+3
-49
lines changed

src/clusterfuzz/_internal/bot/tasks/setup.py

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,6 @@ def setup_testcase(testcase: data_types.Testcase, job_type: str,
286286
if environment.is_android():
287287
_copy_testcase_to_device_and_setup_environment(testcase, testcase_file_path)
288288

289-
# Push testcases to worker.
290-
if take_trusted_host_path():
291-
from clusterfuzz._internal.bot.untrusted_runner import file_host
292-
file_host.push_testcases_to_worker()
293-
294289
# Copy global blacklist into local blacklist.
295290
if setup_input.global_blacklisted_functions:
296291
# Get local blacklist without this testcase's entry.
@@ -467,12 +462,6 @@ def _prepare_update_data_bundle(fuzzer, data_bundle):
467462
return data_bundle_directory
468463

469464

470-
def take_trusted_host_path():
471-
if environment.is_uworker():
472-
return False
473-
return environment.is_trusted_host()
474-
475-
476465
def update_data_bundle(
477466
fuzzer: data_types.Fuzzer,
478467
data_bundle_corpus: uworker_msg_pb2.DataBundleCorpus) -> bool: # pylint: disable=no-member
@@ -491,26 +480,9 @@ def update_data_bundle(
491480
# case, the fuzzer will generate testcases from a gcs bucket periodically.
492481
if not _is_search_index_data_bundle(data_bundle.name):
493482

494-
if not (take_trusted_host_path() and data_bundle.sync_to_worker):
495-
logs.info('Data bundles: normal path.')
496-
result = corpus_manager.sync_data_bundle_corpus_to_disk(
497-
data_bundle_corpus, data_bundle_directory)
498-
else:
499-
logs.info('Data bundles: untrusted runner path.')
500-
from clusterfuzz._internal.bot.untrusted_runner import \
501-
corpus_manager as untrusted_corpus_manager
502-
from clusterfuzz._internal.bot.untrusted_runner import file_host
503-
worker_data_bundle_directory = file_host.rebase_to_worker_root(
504-
data_bundle_directory)
505-
506-
file_host.create_directory(
507-
worker_data_bundle_directory, create_intermediates=True)
508-
result = untrusted_corpus_manager.RemoteGSUtilRunner().rsync(
509-
data_bundle_corpus.gcs_url,
510-
worker_data_bundle_directory,
511-
delete=False)
512-
result = result.return_code == 0
513-
483+
logs.info('Data bundles: normal path.')
484+
result = corpus_manager.sync_data_bundle_corpus_to_disk(
485+
data_bundle_corpus, data_bundle_directory)
514486
if not result:
515487
logs.error(f'Failed to sync data bundle {data_bundle.name}.')
516488
return False
@@ -522,11 +494,6 @@ def update_data_bundle(
522494
# Write last synced time in the sync file.
523495
sync_file_path = _get_data_bundle_sync_file_path(data_bundle_directory)
524496
utils.write_data_to_file(time_before_sync_start, sync_file_path)
525-
if take_trusted_host_path() and data_bundle.sync_to_worker:
526-
from clusterfuzz._internal.bot.untrusted_runner import file_host
527-
worker_sync_file_path = file_host.rebase_to_worker_root(sync_file_path)
528-
file_host.copy_file_to_worker(sync_file_path, worker_sync_file_path)
529-
530497
return True
531498

532499

@@ -697,13 +664,6 @@ def update_fuzzer_and_data_bundles(
697664

698665
# For launcher script usecase, we need the entire fuzzer directory on the
699666
# worker.
700-
if take_trusted_host_path():
701-
from clusterfuzz._internal.bot.untrusted_runner import file_host
702-
worker_fuzzer_directory = file_host.rebase_to_worker_root(
703-
fuzzer_directory)
704-
file_host.copy_directory_to_worker(
705-
fuzzer_directory, worker_fuzzer_directory, replace=True)
706-
707667
return fuzzer
708668

709669

@@ -717,12 +677,6 @@ def _is_data_bundle_up_to_date(data_bundle, data_bundle_directory):
717677
"""Return true if the data bundle is up to date, false otherwise."""
718678
sync_file_path = _get_data_bundle_sync_file_path(data_bundle_directory)
719679

720-
if take_trusted_host_path() and data_bundle.sync_to_worker:
721-
from clusterfuzz._internal.bot.untrusted_runner import file_host
722-
worker_sync_file_path = file_host.rebase_to_worker_root(sync_file_path)
723-
shell.remove_file(sync_file_path)
724-
file_host.copy_file_from_worker(worker_sync_file_path, sync_file_path)
725-
726680
if not os.path.exists(sync_file_path):
727681
return False
728682

0 commit comments

Comments
 (0)