def main(self):
     globalErrorUtility.configure(self.name)
     set_default_timeout_function(
         lambda: config.request_daily_builds.timeout)
     source = getUtility(ISourcePackageRecipeBuildSource)
     builds = source.makeDailyBuilds(self.logger)
     self.logger.info('Requested %d daily recipe builds.' % len(builds))
     builds = getUtility(ISnapSet).makeAutoBuilds(self.logger)
     self.logger.info('Requested %d automatic snap package builds.' %
                      len(builds))
     transaction.commit()
Beispiel #2
0
    def __init__(self, name=None, dbuser=None, test_args=None, logger=None):
        super(LaunchpadCronScript, self).__init__(
            name, dbuser, test_args=test_args, logger=logger)

        # self.name is used instead of the name argument, since it may have
        # have been overridden by command-line parameters or by
        # overriding the name property.
        enabled = cronscript_enabled(
            config.canonical.cron_control_url, self.name, self.logger)
        if not enabled:
            sys.exit(0)

        # Configure the IErrorReportingUtility we use with defaults.
        # Scripts can override this if they want.
        globalErrorUtility.configure()

        # WARN and higher log messages should generate OOPS reports.
        # self.name is used instead of the name argument, since it may have
        # have been overridden by command-line parameters or by
        # overriding the name property.
        oops_hdlr = OopsHandler(self.name, logger=self.logger)
        logging.getLogger().addHandler(oops_hdlr)
Beispiel #3
0
    def __init__(self, name=None, dbuser=None, test_args=None, logger=None,
                 ignore_cron_control=False):
        super(LaunchpadCronScript, self).__init__(
            name, dbuser, test_args=test_args, logger=logger)

        # self.name is used instead of the name argument, since it may have
        # have been overridden by command-line parameters or by
        # overriding the name property.
        if not ignore_cron_control:
            enabled = cronscript_enabled(
                config.canonical.cron_control_url, self.name, self.logger)
            if not enabled:
                sys.exit(0)

        # Configure the IErrorReportingUtility we use with defaults.
        # Scripts can override this if they want.
        globalErrorUtility.configure()

        # WARN and higher log messages should generate OOPS reports.
        # self.name is used instead of the name argument, since it may have
        # have been overridden by command-line parameters or by
        # overriding the name property.
        oops_hdlr = OopsHandler(self.name, logger=self.logger)
        logging.getLogger().addHandler(oops_hdlr)
Beispiel #4
0
    # There is no test for this (it would involve a great number of moving
    # parts) but it has been verified to work on production.  Also see
    # https://bugs.launchpad.net/bzr/+bug/82086
    from bzrlib.transport import register_lazy_transport
    register_lazy_transport('http://', 'bzrlib.transport.http._urllib',
                            'HttpTransport_urllib')
    register_lazy_transport('https://', 'bzrlib.transport.http._urllib',
                            'HttpTransport_urllib')


if __name__ == '__main__':
    parser = OptionParser()
    (options, arguments) = parser.parse_args()
    (source_url, destination_url, branch_id, unique_name, branch_type_name,
     default_stacked_on_url) = arguments

    branch_type = BranchType.items[branch_type_name]
    if branch_type == BranchType.IMPORTED and 'http_proxy' in os.environ:
        del os.environ['http_proxy']
    section_name = 'supermirror_%s_puller' % branch_type_map[branch_type]
    globalErrorUtility.configure(section_name)
    shut_up_deprecation_warning()
    force_bzr_to_use_urllib()

    resource.setrlimit(resource.RLIMIT_AS, (1500000000, 1500000000))

    protocol = PullerWorkerProtocol(sys.stdout)
    install_worker_ui_factory(protocol)
    PullerWorker(source_url, destination_url, int(branch_id), unique_name,
                 branch_type, default_stacked_on_url, protocol).mirror()
    # parts) but it has been verified to work on production.  Also see
    # https://bugs.launchpad.net/bzr/+bug/82086
    from bzrlib.transport import register_lazy_transport
    register_lazy_transport('http://', 'bzrlib.transport.http._urllib',
                            'HttpTransport_urllib')
    register_lazy_transport('https://', 'bzrlib.transport.http._urllib',
                            'HttpTransport_urllib')


if __name__ == '__main__':
    parser = OptionParser()
    (options, arguments) = parser.parse_args()
    (source_url, destination_url, branch_id, unique_name,
     branch_type_name, default_stacked_on_url) = arguments

    branch_type = BranchType.items[branch_type_name]
    if branch_type == BranchType.IMPORTED and 'http_proxy' in os.environ:
        del os.environ['http_proxy']
    section_name = 'supermirror_%s_puller' % branch_type_map[branch_type]
    globalErrorUtility.configure(section_name)
    shut_up_deprecation_warning()
    force_bzr_to_use_urllib()

    resource.setrlimit(resource.RLIMIT_AS, (1500000000, 1500000000))

    protocol = PullerWorkerProtocol(sys.stdout)
    install_worker_ui_factory(protocol)
    PullerWorker(
        source_url, destination_url, int(branch_id), unique_name, branch_type,
        default_stacked_on_url, protocol).mirror()
    def main(self):
        globalErrorUtility.configure('codeimportdispatcher')

        dispatcher = CodeImportDispatcher(self.logger, self.options.max_jobs)
        dispatcher.findAndDispatchJobs(
            ServerProxy(config.codeimportdispatcher.codeimportscheduler_url))
Beispiel #7
0
    def main(self):
        globalErrorUtility.configure('codeimportdispatcher')

        dispatcher = CodeImportDispatcher(self.logger, self.options.max_jobs)
        dispatcher.findAndDispatchJobs(
            ServerProxy(config.codeimportdispatcher.codeimportscheduler_url))
 def main(self):
     globalErrorUtility.configure(self.name)
     source = getUtility(ISourcePackageRecipeBuildSource)
     builds = source.makeDailyBuilds(self.logger)
     self.logger.info('Requested %d daily builds.' % len(builds))
     transaction.commit()
Beispiel #9
0
 def main(self):
     globalErrorUtility.configure(self.name)
     manager = ProductJobManager(self.logger)
     job_count = manager.createAllDailyJobs()
     self.logger.info('Requested %d total product jobs.' % job_count)
     transaction.commit()