SOme ground work to support Windows for benchmark farm
Mainly straightforward changes, the only tricky part: detect number of CPU sockets. Didn't figure out yet how to do this on Windows.
This commit is contained in:
@@ -169,8 +169,8 @@ def downloadLatestBlender(directory):
|
||||
"""
|
||||
Download latets Blender from buildbot to given directory.
|
||||
"""
|
||||
# TODO(sergey): This we need to change to currently running configuration.
|
||||
latest_blender_url = buildbot.buildbotGetLatetsVersion("Linux", "64bit")
|
||||
platform = sys.platform
|
||||
latest_blender_url = buildbot.buildbotGetLatetsVersion(platform, "64bit")
|
||||
if not latest_blender_url:
|
||||
logger.ERROR("Unable to figure out latest Blender version")
|
||||
return
|
||||
@@ -203,6 +203,8 @@ def findBlenderInDirectory(directory):
|
||||
platform = sys.platform
|
||||
if platform == 'linux':
|
||||
return os.path.join(blender_dir, "blender")
|
||||
elif platform == "win32":
|
||||
return os.path.join(blender_dir, "blender.exe")
|
||||
else:
|
||||
raise Exception("Need to support your OS!")
|
||||
|
||||
|
@@ -49,6 +49,11 @@ def _getBuildbotPlatformRegex(platform, bitness):
|
||||
return re.compile(".*linux-glibc[0-9]+-x86_64.*")
|
||||
elif bitness.startswith("32"):
|
||||
return re.compile(".*linux-glibc[0-9]+-i686.*")
|
||||
elif platform_lower in ("win32"):
|
||||
if bitness.startswith("64"):
|
||||
return re.compile(".*win64.*")
|
||||
elif bitness.startswith("32"):
|
||||
return re.compile(".*win32.*")
|
||||
else:
|
||||
# TOGO(sergey): Needs implementation
|
||||
pass
|
||||
|
@@ -69,6 +69,9 @@ def getNumPhysicalCPUs_Linux():
|
||||
def getNumPhysicalCPUs():
|
||||
if sys.platform == 'linux':
|
||||
return getNumPhysicalCPUs_Linux()
|
||||
elif sys.platform == 'win32':
|
||||
# TODO(sergey): Currently all WIndows machines here are single socket.
|
||||
return 1
|
||||
else:
|
||||
raise Exception("Needs implementation")
|
||||
|
||||
|
@@ -4,6 +4,7 @@ from foundation import progress
|
||||
import os
|
||||
import requests
|
||||
import tarfile
|
||||
import zipfile
|
||||
|
||||
|
||||
def humanReadableTimeDifference(seconds):
|
||||
@@ -111,6 +112,10 @@ def unpackArchive(filename, directory):
|
||||
if filename.endswith(".tar.bz2"):
|
||||
tar = tarfile.open(name=filename, mode="r:bz2")
|
||||
tar.extractall(directory)
|
||||
elif filename.endswith(".zip"):
|
||||
zip_ref = zipfile.ZipFile(filename, 'r')
|
||||
zip_ref.extractall(directory)
|
||||
zip_ref.close()
|
||||
else:
|
||||
# TODO(sergey): Need to support more archive types.
|
||||
pass
|
||||
|
Reference in New Issue
Block a user