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,30 @@ enable_thrust_tests=False, ), 'category' : 'clang'}, - + {'name': "clang-cuda-gce-build", + 'slavenames' :["cuda-gce-build-0"], + 'builddir': "clang-cuda-gce-build", + 'factory': AnnotatedBuilder.getAnnotatedBuildFactory(script="external.py", + extra_args=["cuda-build"]), + 'category' : 'clang'}, + {'name': "clang-cuda-gce-test-k80", + 'slavenames' :["cuda-gce-test-k80-0"], + 'builddir': "clang-cuda-gce-test-k80", + 'factory': AnnotatedBuilder.getAnnotatedBuildFactory(script="external.py", + extra_args=['cuda-test', 'k80']), + 'category' : 'clang'}, + {'name': "clang-cuda-gce-test-p4", + 'slavenames' :["cuda-gce-test-p4-0"], + 'builddir': "clang-cuda-gce-test-p4", + 'factory': AnnotatedBuilder.getAnnotatedBuildFactory(script="external.py", + extra_args=['cuda-test', 'p4']), + 'category' : 'clang'}, + {'name': "clang-cuda-gce-test-t4", + 'slavenames' :["cuda-gce-test-t4-0"], + 'builddir': "clang-cuda-gce-test-t4", + 'factory': AnnotatedBuilder.getAnnotatedBuildFactory(script="external.py", + extra_args=['cuda-test', 't4']), + '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-0", max_builds=1), + create_slave("cuda-gce-test-k80-0", max_builds=1), + create_slave("cuda-gce-test-p4-0", max_builds=1), + create_slave("cuda-gce-test-t4-0", 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/buildbot/osuosl/master/config/status.py b/buildbot/osuosl/master/config/status.py --- a/buildbot/osuosl/master/config/status.py +++ b/buildbot/osuosl/master/config/status.py @@ -182,7 +182,9 @@ extraRecipients = ["tra+buildbot@google.com"], subject="Build %(builder)s Failure", mode = "failing", - builders = ["clang-cuda-build"], + builders = ["clang-cuda-build", + "clang-cuda-gce-build", "clang-cuda-gce-test-k80", + "clang-cuda-gce-test-p4", "clang-cuda-gce-test-t4"], addLogs=False, num_lines = 15), InformativeMailNotifier( diff --git a/zorg/buildbot/builders/annotated/external.py b/zorg/buildbot/builders/annotated/external.py new file mode 100644 --- /dev/null +++ b/zorg/buildbot/builders/annotated/external.py @@ -0,0 +1,49 @@ +#!/usr/bin/python + +# Runs external script which is expected to produce log annotations for the +# AnnotatedBuilder. + +import os +import subprocess +import sys +import traceback +import util +from contextlib import contextmanager + +def main(argv): + with step('post-build script', halt_on_fail=True): + # Run external script to do the actual work + cmd = sys.argv[1:] + if not cmd: + util.report("No external command provided.") + util.report('@@@STEP_FAILURE@@@') + return + + run_command(cmd) + +@contextmanager +def step(step_name, halt_on_fail=False): + util.report('@@@BUILD_STEP {}@@@'.format(step_name)) + if halt_on_fail: + util.report('@@@HALT_ON_FAILURE@@@') + try: + yield + except Exception as e: + if isinstance(e, subprocess.CalledProcessError): + util.report( + '{} exited with return code {}.'.format(e.cmd, e.returncode) + ) + util.report('The build step threw an exception...') + traceback.print_exc() + + util.report('@@@STEP_FAILURE@@@') + finally: + sys.stdout.flush() + + +def run_command(cmd, directory='.'): + util.report_run_cmd(cmd, cwd=directory) + +if __name__ == '__main__': + sys.path.append(os.path.dirname(__file__)) + sys.exit(main(sys.argv))