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:
2017-08-28 15:05:04 +02:00
parent 4bed7a3f8a
commit 3c3c8cbaad
4 changed files with 17 additions and 2 deletions

View File

@@ -169,8 +169,8 @@ def downloadLatestBlender(directory):
""" """
Download latets Blender from buildbot to given directory. Download latets Blender from buildbot to given directory.
""" """
# TODO(sergey): This we need to change to currently running configuration. platform = sys.platform
latest_blender_url = buildbot.buildbotGetLatetsVersion("Linux", "64bit") latest_blender_url = buildbot.buildbotGetLatetsVersion(platform, "64bit")
if not latest_blender_url: if not latest_blender_url:
logger.ERROR("Unable to figure out latest Blender version") logger.ERROR("Unable to figure out latest Blender version")
return return
@@ -203,6 +203,8 @@ def findBlenderInDirectory(directory):
platform = sys.platform platform = sys.platform
if platform == 'linux': if platform == 'linux':
return os.path.join(blender_dir, "blender") return os.path.join(blender_dir, "blender")
elif platform == "win32":
return os.path.join(blender_dir, "blender.exe")
else: else:
raise Exception("Need to support your OS!") raise Exception("Need to support your OS!")

View File

@@ -49,6 +49,11 @@ def _getBuildbotPlatformRegex(platform, bitness):
return re.compile(".*linux-glibc[0-9]+-x86_64.*") return re.compile(".*linux-glibc[0-9]+-x86_64.*")
elif bitness.startswith("32"): elif bitness.startswith("32"):
return re.compile(".*linux-glibc[0-9]+-i686.*") 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: else:
# TOGO(sergey): Needs implementation # TOGO(sergey): Needs implementation
pass pass

View File

@@ -69,6 +69,9 @@ def getNumPhysicalCPUs_Linux():
def getNumPhysicalCPUs(): def getNumPhysicalCPUs():
if sys.platform == 'linux': if sys.platform == 'linux':
return getNumPhysicalCPUs_Linux() return getNumPhysicalCPUs_Linux()
elif sys.platform == 'win32':
# TODO(sergey): Currently all WIndows machines here are single socket.
return 1
else: else:
raise Exception("Needs implementation") raise Exception("Needs implementation")

View File

@@ -4,6 +4,7 @@ from foundation import progress
import os import os
import requests import requests
import tarfile import tarfile
import zipfile
def humanReadableTimeDifference(seconds): def humanReadableTimeDifference(seconds):
@@ -111,6 +112,10 @@ def unpackArchive(filename, directory):
if filename.endswith(".tar.bz2"): if filename.endswith(".tar.bz2"):
tar = tarfile.open(name=filename, mode="r:bz2") tar = tarfile.open(name=filename, mode="r:bz2")
tar.extractall(directory) tar.extractall(directory)
elif filename.endswith(".zip"):
zip_ref = zipfile.ZipFile(filename, 'r')
zip_ref.extractall(directory)
zip_ref.close()
else: else:
# TODO(sergey): Need to support more archive types. # TODO(sergey): Need to support more archive types.
pass pass