Example #1
0
 def test_core_count(self):
     """Test getting core count."""
     for core_count in [get_avail_core_count(), get_core_count()]:
         self.assertTrue(
             isinstance(core_count,
                        int), "core_count has type int: %s, %s" %
             (core_count, type(core_count)))
         self.assertTrue(core_count > 0, "core_count %d > 0" % core_count)
Example #2
0
def get_build_stats(app, starttime):
    """
    Return build statistics for this build
    """

    buildtime = round(time.time() - starttime, 2)
    buildstats = OrderedDict([
                              ('easybuild-framework_version', str(FRAMEWORK_VERSION)),
                              ('easybuild-easyblocks_version', str(EASYBLOCKS_VERSION)),
                              ('host', os.uname()[1]),
                              ('platform' , platform.platform()),
                              ('cpu_model', systemtools.get_cpu_model()),
                              ('core_count', systemtools.get_core_count()),
                              ('timestamp', int(time.time())),
                              ('build_time', buildtime),
                              ('install_size', app.det_installsize()),
                             ])

    return buildstats
def get_build_stats(app, starttime):
    """
    Return build statistics for this build
    """

    buildtime = round(time.time() - starttime, 2)
    buildstats = OrderedDict([
                              ('easybuild-framework_version', str(FRAMEWORK_VERSION)),
                              ('easybuild-easyblocks_version', str(EASYBLOCKS_VERSION)),
                              ('host', os.uname()[1]),
                              ('platform' , platform.platform()),
                              ('cpu_model', systemtools.get_cpu_model()),
                              ('core_count', systemtools.get_core_count()),
                              ('timestamp', int(time.time())),
                              ('build_time', buildtime),
                              ('install_size', app.det_installsize()),
                             ])

    return buildstats
Example #4
0
def get_build_stats(app, starttime):
    """
    Return build statistics for this build
    """

    buildtime = round(time.time() - starttime, 2)
    buildstats = OrderedDict(
        [
            ("easybuild-framework_version", str(FRAMEWORK_VERSION)),
            ("easybuild-easyblocks_version", str(EASYBLOCKS_VERSION)),
            ("host", os.uname()[1]),
            ("platform", platform.platform()),
            ("cpu_model", systemtools.get_cpu_model()),
            ("core_count", systemtools.get_core_count()),
            ("timestamp", int(time.time())),
            ("build_time", buildtime),
            ("install_size", app.det_installsize()),
        ]
    )

    return buildstats
 def test_core_count(self):
     """Test getting core count."""
     core_count = get_core_count()
     self.assertTrue(isinstance(core_count, int))
     self.assertTrue(core_count > 0)
Example #6
0
        perform_step('postproc', app, lambda x: x.postproc())
        perform_step('sanity check', app, lambda x: x.sanitycheck())
        perform_step('cleanup', app, lambda x: x.cleanup())
        perform_step('make module', app, lambda x: x.make_module())

        # remove handler
        app.log.removeHandler(handler)

        if app not in build_stopped:
            # gather build stats
            build_time = round(time.time() - start_time, 2)

            buildstats = {
                          'build_time': build_time,
                          'platform': platform.platform(),
                          'core_count': systemtools.get_core_count(),
                          'cpu_model': systemtools.get_cpu_model(),
                          'install_size': app.installsize(),
                          'timestamp': int(time.time()),
                          'host': os.uname()[1],
                         }
            succes.append((app, buildstats))

    for result in test_results:
        log.info("%s crashed with an error during fase: %s, error: %s" % result)

    failed = len(build_stopped)
    total = len(apps)

    log.info("%s from %s packages failed to build!" % (failed, total))
Example #7
0
            os.chdir(os.getenv("HOME"))

            # walk install dir to determine total size
            for dirpath, _, filenames in os.walk(app.installdir):
                for filename in filenames:
                    fullpath = os.path.join(dirpath, filename)
                    if os.path.exists(fullpath):
                        installsize += os.path.getsize(fullpath)
        except OSError, err:
            log.error("Failed to determine install size: %s" % err)

        currentbuildstats = app.getcfg("buildstats")
        buildstats = {
            "build_time": buildtime,
            "platform": platform.platform(),
            "core_count": systemtools.get_core_count(),
            "cpu_model": systemtools.get_cpu_model(),
            "install_size": installsize,
            "timestamp": int(time.time()),
            "host": os.uname()[1],
        }
        log.debug("Build stats: %s" % buildstats)

        if app.getcfg("stop"):
            ended = "STOPPED"
            newLogDir = os.path.join(app.builddir, config.logPath())
        else:
            newLogDir = os.path.join(app.installdir, config.logPath())

            try:
                ## Upload spec to central repository
 def test_core_count(self):
     """Test getting core count."""
     core_count = get_core_count()
     self.assertTrue(isinstance(core_count, int))
     self.assertTrue(core_count > 0)
 def test_core_count(self):
     """Test getting core count."""
     for core_count in [get_avail_core_count(), get_core_count()]:
         self.assertTrue(isinstance(core_count, int), "core_count has type int: %s, %s" % (core_count, type(core_count)))
         self.assertTrue(core_count > 0, "core_count %d > 0" % core_count)