diff --git a/buildbot/osuosl/master/config/builders.py b/buildbot/osuosl/master/config/builders.py --- a/buildbot/osuosl/master/config/builders.py +++ b/buildbot/osuosl/master/config/builders.py @@ -1569,7 +1569,16 @@ enable_thrust_tests=False, ), 'category' : 'clang'}, - + {'name': "clang-cuda-gce-build", + 'slavenames' :["cuda-gce-build"], + 'builddir': "clang-cuda-gce-build", + 'factory': CUDATestsuiteBuilder.getCUDAAnnotatedBuildFactory(), + 'category' : 'clang'}, + {'name': "clang-cuda-gce-test", + 'slavenames' :["cuda-gce-test-k80", "cuda-gce-test-p4", "cuda-gce-test-t4"], + 'builddir': "clang-cuda-gce-test", + 'factory': CUDATestsuiteBuilder.getCUDAAnnotatedBuildFactory(), + 'category' : 'clang'}, {'name': "clang-ve-ninja", 'slavenames':["nec-arrproto41"], 'builddir':"clang-ve-ninja", diff --git a/buildbot/osuosl/master/config/slaves.py b/buildbot/osuosl/master/config/slaves.py --- a/buildbot/osuosl/master/config/slaves.py +++ b/buildbot/osuosl/master/config/slaves.py @@ -155,6 +155,11 @@ # Ubuntu 16.04 x86_64, 2 x Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz, 64GB of RAM create_slave("cuda-build-test-01", properties={'jobs': 72}, max_builds=1), + # WIP migration of the CUDA buildbot to GCE. + create_slave("cuda-gce-build", max_builds=1), + create_slave("cuda-gce-test-k80", max_builds=1), + create_slave("cuda-gce-test-p4", max_builds=1), + create_slave("cuda-gce-test-t4", max_builds=1), # Ubuntu 14.04 x86_64, AMD Athlon(tm) 5150 APU with Radeon(tm) R3, 8GiB RAM create_slave("am1i-slv1", properties={'jobs': 8}), diff --git a/zorg/buildbot/builders/CUDATestsuiteBuilder.py b/zorg/buildbot/builders/CUDATestsuiteBuilder.py --- a/zorg/buildbot/builders/CUDATestsuiteBuilder.py +++ b/zorg/buildbot/builders/CUDATestsuiteBuilder.py @@ -216,3 +216,62 @@ env=merged_env)) return f + +# Simplified CUDA builder which uses external script to perform build & test. +def getCUDAAnnotatedBuildFactory( + script=None, # build/test script that will generate annotated logs. + clean=False, + is_legacy_mode=False, + timeout=1200, + env=None, # Environmental variables for all steps. + is_legacy_mode=False): + + # Prepare environmental variables. Set here all env we want for all steps. + merged_env = { + 'TERM': 'dumb' # Make sure Clang doesn't use color escape sequences. + } + + if env is not None: + # Overwrite pre-set items with the given ones, so user can set + # anything. + merged_env.update(env) + + depends_on_projects = [ + "llvm", + "clang", + "compiler-rt", + "libcxx", + "libcxxabi", + "libunwind", + "lld"] + + # Explicitly use '/' as separator, because it works on *nix and Windows. + # The bot script is expected to be provided + cuda_bot_dir = "cuda_buildbot" + if script: + cuda_bot_script = script + else: + cuda_bot_script = bot_dir + "/run_cuda_bot" + + f = LLVMBuildFactory( + is_legacy_mode=is_legacy_mode, + clean=always_clean, + depends_on_projects=depends_on_projects, + llvm_srcdir=cuda_bot_dir) + + # Determine the build directory. + f.addStep(SetProperty(name="get_builddir", + command=["pwd"], + property="builddir", + description="set build dir", + workdir=".", + env=merged_env)) + + # Run annotated command for cuda bot. + f.addStep(AnnotatedCommand(name="annotate", + description="annotate", + timeout=timeout, + haltOnFailure=True, + command=cuda_bot_script, + env=merged_env)) + return f