Beispiel #1
0
def masterConfig():
    c = {}
    from buildbot.config import BuilderConfig
    from buildbot.process.factory import BuildFactory
    from buildbot.plugins import steps, schedulers, reporters
    c['schedulers'] = [
        schedulers.AnyBranchScheduler(name="sched", builderNames=["testy"])
    ]
    f = BuildFactory()
    f.addStep(steps.ShellCommand(command='echo hello'))
    c['builders'] = [
        BuilderConfig(name="testy", workernames=["local1"], factory=f)
    ]
    notifier = reporters.PushoverNotifier(
        '1234',
        'abcd',
        mode="all",
        watchedWorkers=['local1'],
        messageFormatter=MessageFormatter(template='This is a message.'),
        messageFormatterMissingWorker=MessageFormatterMissingWorker(
            template='No worker.'))
    c['services'] = [
        reporters.MailNotifier("*****@*****.**", mode="all"), notifier
    ]
    return c
Beispiel #2
0
def setup_global_config(c):
    ####### PROJECT IDENTITY
    c['title'] = "Natural Intelligence"
    c['titleURL'] = "http://www.naturalint.com/"
    c['buildbotURL'] = os.environ.get("BUILDBOT_WEB_URL", "http://*****:*****@gmail.com",
            relayhost=os.environ.get("SMTP_SERVER", "smtp.gmail.com"),
            mode=('change', 'failing'),
            buildSetSummary=True,
            smtpPort=int(os.environ.get("SMTP_PORT", 465)),
            useSmtps=int(os.environ.get("USE_SMTPS", True)),
            smtpUser='******',
            smtpPassword='******')
    ]
Beispiel #3
0
def masterConfig():
    c = {}
    from buildbot.config import BuilderConfig
    from buildbot.process.factory import BuildFactory
    from buildbot.plugins import steps, schedulers, reporters
    c['schedulers'] = [
        schedulers.AnyBranchScheduler(name="sched", builderNames=["testy"])
    ]

    f = BuildFactory()
    f.addStep(steps.ShellCommand(command='echo hello'))
    c['builders'] = [
        BuilderConfig(name="testy", workernames=["local1"], factory=f)
    ]
    c['services'] = [reporters.MailNotifier("*****@*****.**", mode="all")]
    return c
Beispiel #4
0
def masterConfig(build_set_summary):
    c = {}
    from buildbot.config import BuilderConfig
    from buildbot.process.factory import BuildFactory
    from buildbot.plugins import steps, schedulers, reporters
    c['schedulers'] = [
        schedulers.AnyBranchScheduler(
            name="sched",
            builderNames=["testy"])
    ]
    f = BuildFactory()
    f.addStep(steps.ShellCommand(command='echo hello'))
    c['builders'] = [
        BuilderConfig(name="testy",
                      workernames=["local1"],
                      factory=f)
    ]

    formatter = MessageFormatter(template='This is a message.')
    formatter_worker = MessageFormatterMissingWorker(template='No worker.')

    if build_set_summary:
        generators_mail = [
            BuildSetStatusGenerator(mode='all'),
            WorkerMissingGenerator(workers='all'),
        ]
        generators_pushover = [
            BuildSetStatusGenerator(mode='all', message_formatter=formatter),
            WorkerMissingGenerator(workers=['local1'], message_formatter=formatter_worker),
        ]
    else:
        generators_mail = [
            BuildStatusGenerator(mode='all'),
            WorkerMissingGenerator(workers='all'),
        ]
        generators_pushover = [
            BuildStatusGenerator(mode='all', message_formatter=formatter),
            WorkerMissingGenerator(workers=['local1'], message_formatter=formatter_worker),
        ]

    c['services'] = [
        reporters.MailNotifier("*****@*****.**", generators=generators_mail),
        reporters.PushoverNotifier('1234', 'abcd', generators=generators_pushover)
    ]
    return c
Beispiel #5
0
        useColors=False,
        host=str(config.options.get('IRC', 'host')),
        nick=str(config.options.get('IRC', 'nick')),
        channels=str(config.options.get('IRC', 'channels')).split(','),
        #authz=... # TODO: Consider allowing "harmful" operations to authorizes users.
        useRevisions=False,  # FIXME: There is a bug in the buildbot
        showBlameList=True,
        notify_events=str(config.options.get('IRC',
                                             'notify_events')).split(','),
    ),
    reporters.MailNotifier(
        mode=('problem', ),
        fromaddr=
        "*****@*****.**",  # TODO: Change this to [email protected].
        extraRecipients=status_email,
        extraHeaders={"Reply-To": status_email[0]},  # The first from the list.
        lookup="lab.llvm.org",
        messageFormatter=LLVMInformativeMailNotifier,
        # TODO: For debug purposes only. Remove later.
        dumpMailsToLog=True,
    ),

    # In addition to that the following notifiers are defined for special
    # cases.
    reporters.MailNotifier(fromaddr="*****@*****.**",
                           sendToInterestedUsers=False,
                           extraRecipients=["*****@*****.**"],
                           subject="Build %(builder)s Failure",
                           mode="failing",
                           builders=[
                               "clang-aarch64-linux-build-cache",
Beispiel #6
0
def getReporters():

    # Should be a single e-mail address
    status_email = str(config.options.get('Master Options',
                                          'status_email')).split(',')

    return [

        # Note: reporters.GitHubStatusPush requires txrequests package to allow
        # interaction with GitHub REST API.
        reporters.GitHubStatusPush(
            str(config.options.get('GitHub Status', 'token')),
            context=Interpolate("%(prop:buildername)s"),
            verbose=
            True,  # TODO: Turn off the verbosity once this is working reliably.
            builders=[
                "llvm-clang-x86_64-expensive-checks-ubuntu",
                "llvm-clang-x86_64-win-fast",
                "clang-x86_64-debian-fast",
                "llvm-clang-x86_64-expensive-checks-debian",
            ]),
        reporters.IRC(
            useColors=False,
            host=str(config.options.get('IRC', 'host')),
            nick=str(config.options.get('IRC', 'nick')),
            channels=str(config.options.get('IRC', 'channels')).split(','),
            #authz=... # TODO: Consider allowing "harmful" operations to authorizes users.
            useRevisions=False,  # FIXME: There is a bug in the buildbot
            showBlameList=True,
            notify_events=str(config.options.get('IRC',
                                                 'notify_events')).split(','),
        ),
        reporters.MailNotifier(
            mode=('problem', ),
            fromaddr=
            "*****@*****.**",  # TODO: Change this to [email protected].
            extraRecipients=status_email,
            extraHeaders={"Reply-To":
                          status_email[0]},  # The first from the list.
            lookup="lab.llvm.org",
            messageFormatter=LLVMInformativeMailNotifier,
            # TODO: For debug purposes only. Remove later.
            dumpMailsToLog=True,
        ),

        # In addition to that the following notifiers are defined for special
        # cases.
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=[
                                   "clang-aarch64-linux-build-cache",
                                   "clang-armv7-linux-build-cache"
                               ]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["clang-x86_64-debian-fast"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["clang-x64-ninja-win7"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=False,
            extraRecipients=["*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=["clang-hexagon-elf"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=[
                                   "clang-s390x-linux",
                                   "clang-s390x-linux-multistage",
                                   "clang-s390x-linux-lnt"
                               ]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=[
                                   "*****@*****.**",
                                   "*****@*****.**"
                               ],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["clang-x86_64-linux-abi-test"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["llvm-avr-linux"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=False,
            extraRecipients=["*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=[
                "lld-x86_64-win", "lld-x86_64-freebsd", "lld-x86_64-darwin",
                "clang-x86_64-linux-abi-test", "clang-with-lto-ubuntu",
                "clang-with-thin-lto-ubuntu",
                "llvm-clang-x86_64-expensive-checks-win",
                "llvm-clang-x86_64-expensive-checks-ubuntu"
            ]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=False,
            extraRecipients=[
                "*****@*****.**", "*****@*****.**"
            ],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=[
                "polly-arm-linux",
                "aosp-O3-polly-before-vectorizer-unprofitable"
            ]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=True,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="problem",
                               builders=["reverse-iteration"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=False,
            extraRecipients=["*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=["clang-cuda-k80", "clang-cuda-p4", "clang-cuda-t4"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["llvm-riscv-linux"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=[
                                   "*****@*****.**",
                                   "*****@*****.**",
                                   "*****@*****.**",
                                   "*****@*****.**"
                               ],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["lldb-x64-windows-ninja"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=False,
            extraRecipients=["*****@*****.**", "*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=["mlir-windows"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["fuchsia-x86_64-linux"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=True,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["lldb-x86_64-fedora"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=True,
            extraRecipients=["*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=["fedora-llvm-x86_64", "x86_64-fedora-clang"]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=True,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["lldb-x86_64-debian"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=True,
            extraRecipients=["*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=["lldb-arm-ubuntu", "lldb-aarch64-ubuntu"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=True,
            extraRecipients=["*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=[
                "llvm-clang-x86_64-win-fast", "lld-x86_64-ubuntu-fast",
                "llvm-clang-x86_64-expensive-checks-ubuntu",
                "llvm-clang-win-x-armv7l", "llvm-clang-win-x-aarch64"
            ]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=["*****@*****.**"],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=["clang-ve-ninja"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=True,
            extraRecipients=["*****@*****.**", "*****@*****.**"],
            subject="Build %(builder)s Failure",
            mode="failing",
            builders=[
                "libc-x86_64-debian", "libc-x86_64_debian-dbg",
                "libc-x86_64-debian-dbg-asan"
            ]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=True,
                               extraRecipients=["*****@*****.**"],
                               subject="Sphinx build %(builder)s Failure",
                               mode="failing",
                               builders=["publish-sphinx-docs"]),
        reporters.MailNotifier(
            fromaddr="*****@*****.**",
            sendToInterestedUsers=True,
            extraRecipients=["*****@*****.**"],
            subject="ML Compiler Opt Failure: %(builder)s",
            mode="failing",
            builders=[
                "ml-opt-dev-x86-64", "ml-opt-rel-x86-64",
                "ml-opt-devrel-x86-64"
            ]),
        reporters.MailNotifier(fromaddr="*****@*****.**",
                               sendToInterestedUsers=False,
                               extraRecipients=[
                                   "*****@*****.**",
                                   "*****@*****.**"
                               ],
                               subject="Build %(builder)s Failure",
                               mode="failing",
                               builders=[
                                   "flang-aarch64-ubuntu",
                                   "flang-aarch64-ubuntu-clang",
                                   "flang-aarch64-ubuntu-gcc10"
                               ]),
    ]
mailMap = {
    'cross_ci': '*****@*****.**',
}

template = u'''\
<h4>Build status: {{ summary }}</h4>
<p> Worker used: {{ workername }}</p>
{% for step in build['steps'] %}
<p> {{ step['name'] }}: {{step['state_string']}}</p>
{% endfor %}
<p><b> -- The Buildbot</b></p>
'''

m = reporters.MailNotifier(
    fromaddr="*****@*****.**",  # the address from which mail is sent
    tags=[
        "cas"
    ],  # only send for builders that have this tag; useful for multi-project masters
    lookup=mailnotifier.IcdCslToEmail(
        mailMap
    ),  # our lookup function that takes the mailMap dict as an argument
    buildSetSummary=True,  # show a summary of the whole buildset in the e-mail
    messageFormatter=reporters.MessageFormatter(
        template=template,
        template_type='html',
        wantProperties=True,
        wantSteps=True))  # the HTML template to use in the message body

c['services'].append(m)
Beispiel #8
0
def make_config(worker_name, worker_password, worker_port, git_repo, branch,
                poll_interval, builder_name, project_name, project_url,
                buildbot_url, buildbot_web_port, buildbot_from_email):

    return {
        'workers': [worker.Worker(worker_name, worker_password)],
        'protocols': {
            'pb': {
                'port': worker_port
            }
        },
        'change_source': [
            changes.GitPoller(
                git_repo,
                workdir='gitpoller-workdir',
                branch=branch,
                pollinterval=poll_interval,
            ),
        ],
        'schedulers': [
            schedulers.SingleBranchScheduler(
                name="all",
                change_filter=util.ChangeFilter(branch=branch),
                treeStableTimer=poll_interval,
                builderNames=[builder_name],
            ),
            schedulers.ForceScheduler(
                name="force",
                builderNames=[builder_name],
            ),
        ],
        'builders': [
            util.BuilderConfig(
                name=builder_name,
                workernames=[worker_name],
                factory=util.BuildFactory([
                    # check out the source
                    steps.Git(repourl=git_repo, mode='incremental'),
                    # run the tests
                    steps.ShellCommand(command=[
                        "direnv",
                        "allow",
                        ".",
                    ], ),
                    steps.ShellCommand(
                        command=[
                            "direnv",
                            "exec",
                            ".",
                            "make",
                            "check",
                        ],
                        env={
                            'NIX_REMOTE': 'daemon',
                        },
                        # If we have to rebuild our dependencies from scratch,
                        # we can go a long time without receiving output from
                        # the compiler. Default timeout is 20 mins, bump to
                        # 1hr.
                        timeout=60 * 60,
                    ),
                ]),
            ),
        ],
        'status': [],
        'title':
        project_name,
        'titleURL':
        project_url,
        'buildbotURL':
        buildbot_url,
        'www': {
            'port': buildbot_web_port,
            'plugins': {
                'waterfall_view': {},
            },
        },
        'db': {
            'db_url': "sqlite:///state.sqlite",
        },
        'services': [
            reporters.MailNotifier(
                fromaddr=buildbot_from_email,
                # TODO(jml): Currently sending mail for all builds. We should
                # send mail under fewer circumstances once we have a better
                # idea about what we actually want.
                #
                # http://buildbot.readthedocs.io/en/latest/manual/cfg-reporters.html?highlight=github#mailnotifier-arguments
                mode='all',
                # XXX: Temporarily hard-code until we can figure out how to
                # get these automatically from commits.
                extraRecipients=[
                    "*****@*****.**",
                    "*****@*****.**",
                ],
            )
        ],
    }
from buildbot.plugins import reporters
mn = reporters.MailNotifier(fromaddr="*****@*****.**",
                            lookup="example.org")
c['services'].append(mn)