Implement support for DATAGEN Workloads through the genfens interface (#200)

This commit is contained in:
Andrew Grant authored and GitHub committed 2024-03-12 21:22:07 -04:00
1 parent 45302fa347
commit 2fcb7329ce
57 files changed
+1096 -131

No files matched your search

+21
View File
@@ -28,6 +28,9 @@ import subprocess
import tempfile
import zipfile
IS_WINDOWS = platform.system() == 'Windows' # Don't touch this
IS_LINUX = platform.system() != 'Windows' # Don't touch this
class OpenBenchBuildFailedException(Exception):
def __init__(self, message, logs):
self.message = message
@@ -65,6 +68,20 @@ class OpenBenchBadServerResponseException(Exception):
self.message = ''
super().__init__(self.message)
class OpenBenchFailedGenfensException(Exception):
def __init__(self, message):
self.message = message
super().__init__(self.message)
def kill_process_by_name(process_name):
if IS_LINUX:
subprocess.run(['pkill', '-f', process_name])
if IS_WINDOWS:
subprocess.run(['taskkill', '/f', '/im', process_name])
def url_join(*args, trailing_slash=True):
@@ -200,6 +217,10 @@ def download_opening_book(book_sha, book_source, book_name):
book_path = os.path.join('Books', book_name)
# Datagen workloads might not include a book
if book_name.upper() == 'NONE':
return
# Book might already have been downloaded
if not os.path.exists(book_path):