WIP: Tests: Add option to run GPU tests on buildbot #2

Closed
Brecht Van Lommel wants to merge 3 commits from gpu-tests into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 18 additions and 12 deletions
Showing only changes of commit 2a18b38873 - Show all commits

View File

@ -266,7 +266,7 @@ def create_code_worker_command_args(props, devops_env_id, track_id, pipeline_typ
args += ["--python-module"] args += ["--python-module"]
if needs_full_clean: if needs_full_clean:
args += ["--needs-full-clean"] args += ["--needs-full-clean"]
if step_name in ["compile-gpu", "compile-install"]: if step_name in ["compile-gpu", "compile-install", "test-code"]:
if needs_package_delivery or needs_gpu_binaries: if needs_package_delivery or needs_gpu_binaries:
args += ["--needs-gpu-binaries"] args += ["--needs-gpu-binaries"]
if needs_gpu_tests: if needs_gpu_tests:
@ -405,18 +405,22 @@ def create_deliver_test_results_step(worker_config, track_id, pipeline_type):
def next_worker_code(worker_names_gpu, builder, workers, request): def next_worker_code(worker_names_gpu, builder, workers, request):
# Use a GPU worker if needed and supported for this platform. # Use a GPU worker if needed and supported for this platform.
if not workers: # GPU worker is currently reserved for GPU builds only.
return None compatible_workers = []
if request.properties.getProperty("needs_gpu_tests", False) and worker_names_gpu:
if not request.properties.getProperty("needs_gpu_tests", False) or not worker_names_gpu:
return random.choice(workers)
for worker in workers: for worker in workers:
if worker.worker.workername in worker_names_gpu: if worker.worker.workername in worker_names_gpu:
return worker compatible_workers.append(worker)
else:
for worker in workers:
if worker.worker.workername not in worker_names_gpu:
compatible_workers.append(worker)
if not compatible_workers:
return None return None
return random.choice(compatible_workers)
def populate(devops_env_id): def populate(devops_env_id):
builders = [] builders = []

View File

@ -43,8 +43,10 @@ def package_for_upload(builder: worker.blender.CodeBuilder, success: bool) -> No
shutil.make_archive(str(package_filepath), "zip", package_tests_dir, package_filename) shutil.make_archive(str(package_filepath), "zip", package_tests_dir, package_filename)
shutil.rmtree(package_filepath) shutil.rmtree(package_filepath)
# Always upload unpacked folder for main and release tracks. # Always upload unpacked folder for main and release tracks,
if builder.track_id != "vexp": # when using GPU tests. This is useful for debugging GPU
# differences.
if builder.track_id != "vexp" and builder.needs_gpu_tests:
branch = builder.branch_id.replace("blender-", "").replace("-release", "") branch = builder.branch_id.replace("blender-", "").replace("-release", "")
name = f"{branch}-{builder.platform}-{builder.architecture}" name = f"{branch}-{builder.platform}-{builder.architecture}"
shutil.copytree(build_tests_dir, package_tests_dir / name) shutil.copytree(build_tests_dir, package_tests_dir / name)