Ejemplo n.º 1
0
    def software_options(self):
        # software build options
        descr = ("Software search and build options", (
            "Specify software search and build options: EasyBuild will search for a "
            "matching easyconfig and build it. When called with the try prefix "
            "(i.e. --try-X ), EasyBuild will search for a matching easyconfig "
            "and if none are found, try to generate one based on a close matching one "
            "(NOTE: --try-X is best effort, it might produce wrong builds!)"))

        opts = OrderedDict({
            'amend':
            (("Specify additional search and build parameters (can be used multiple times); "
              "for example: versionprefix=foo or patches=one.patch,two.patch)"
              ), None, 'append', None, {
                  'metavar': 'VAR=VALUE[,VALUE]'
              }),
            'software-name':
            ("Search and build software with name", None, 'store', None, {
                'metavar': 'NAME'
            }),
            'software-version':
            ("Search and build software with version", None, 'store', None, {
                'metavar': 'VERSION'
            }),
            'toolchain': ("Search and build with toolchain (name and version)",
                          None, 'extend', None, {
                              'metavar': 'NAME,VERSION'
                          }),
            'toolchain-name':
            ("Search and build with toolchain name", None, 'store', None, {
                'metavar': 'NAME'
            }),
            'toolchain-version': ("Search and build with toolchain version",
                                  None, 'store', None, {
                                      'metavar': 'VERSION'
                                  }),
        })

        longopts = opts.keys()
        for longopt in longopts:
            hlp = opts[longopt][0]
            hlp = "Try to %s (USE WITH CARE!)" % (hlp[0].lower() + hlp[1:])
            opts["try-%s" % longopt] = (hlp, ) + opts[longopt][1:]

        # additional options that don't need a --try equivalent
        opts.update({
            'from-pr':
            ("Obtain easyconfigs from specified PR", int, 'store', None, {
                'metavar': 'PR#'
            }),
        })

        self.log.debug("software_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
Ejemplo n.º 2
0
    def software_options(self):
        # software build options
        descr = ("Software search and build options",
                 ("Specify software search and build options: EasyBuild will search for a "
                  "matching easyconfig and build it. When called with the try prefix "
                  "(i.e. --try-X ), EasyBuild will search for a matching easyconfig "
                  "and if none are found, try to generate one based on a close matching one "
                  "(NOTE: --try-X is best effort, it might produce wrong builds!)")
                 )

        opts = OrderedDict({
            'amend': (("Specify additional search and build parameters (can be used multiple times); "
                       "for example: versionprefix=foo or patches=one.patch,two.patch)"),
                      None, 'append', None, {'metavar': 'VAR=VALUE[,VALUE]'}),
            'software': ("Search and build software with given name and version",
                         None, 'extend', None, {'metavar': 'NAME,VERSION'}),
            'software-name': ("Search and build software with given name",
                              None, 'store', None, {'metavar': 'NAME'}),
            'software-version': ("Search and build software with given version",
                                 None, 'store', None, {'metavar': 'VERSION'}),
            'toolchain': ("Search and build with given toolchain (name and version)",
                          None, 'extend', None, {'metavar': 'NAME,VERSION'}),
            'toolchain-name': ("Search and build with given toolchain name",
                               None, 'store', None, {'metavar': 'NAME'}),
            'toolchain-version': ("Search and build with given toolchain version",
                                  None, 'store', None, {'metavar': 'VERSION'}),
        })

        longopts = opts.keys()
        for longopt in longopts:
            hlp = opts[longopt][0]
            hlp = "Try to %s (USE WITH CARE!)" % (hlp[0].lower() + hlp[1:])
            opts["try-%s" % longopt] = (hlp,) + opts[longopt][1:]

        # additional options that don't need a --try equivalent
        opts.update({
            'from-pr': ("Obtain easyconfigs from specified PR", int, 'store', None, {'metavar': 'PR#'}),
        })

        self.log.debug("software_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
Ejemplo n.º 3
0
def get_build_stats(app, start_time, command_line):
    """
    Return build statistics for this build
    """

    time_now = time.time()
    build_time = round(time_now - start_time, 2)

    buildstats = OrderedDict([
        ('easybuild-framework_version', str(FRAMEWORK_VERSION)),
        ('easybuild-easyblocks_version', str(EASYBLOCKS_VERSION)),
        ('timestamp', int(time_now)),
        ('build_time', build_time),
        ('install_size', app.det_installsize()),
        ('command_line', command_line),
        ('modules_tool', app.modules_tool.buildstats()),
    ])
    for key, val in sorted(get_system_info().items()):
        buildstats.update({key: val})

    return buildstats