Esempio n. 1
0
 def resolve_binary(self):
     try:
         path = os.path.join(self.src_dir,
                             self.template_renderer.render(self.car.mandatory_var("system.artifact_path_pattern")))
         return glob.glob(path)[0]
     except IndexError:
         raise SystemSetupError("Couldn't find a tar.gz distribution. Please run Rally with the pipeline 'from-sources-complete'.")
Esempio n. 2
0
 def resolve_binary(self):
     try:
         name = glob.glob("%s/plugins/%s/build/distributions/*.zip" % (self.es_src_dir, self.plugin.name))[0]
         return "file://%s" % name
     except IndexError:
         raise SystemSetupError("Couldn't find a plugin zip file for [%s]. Please run Rally with the pipeline 'from-sources-complete'." %
                                self.plugin.name)
Esempio n. 3
0
    def run(self, task):
        try:
            src_dir = self._config.opts("source", "local.src.dir")
        except config.ConfigError:
            logging.exception("Rally is not configured to build from sources")
            raise SystemSetupError(
                "Rally is not setup to build from sources. You can either benchmark a binary distribution or "
                "install the required software and reconfigure Rally with %s --configure."
                % PROGRAM_NAME)

        logger.info("Building Elasticsearch from sources in [%s]." % src_dir)
        gradle = self._config.opts("build", "gradle.bin")
        java_home = self._config.opts("runtime", "java8.home")
        log_dir = self._config.opts("system", "log.dir")

        logger.info("Executing %s %s..." % (gradle, task))
        io.ensure_dir(log_dir)
        log_file = "%s/build.log" % log_dir

        # we capture all output to a dedicated build log file

        if process.run_subprocess(
                "export JAVA_HOME=%s; cd %s; %s %s >> %s 2>&1" %
            (java_home, src_dir, gradle, task, log_file)):
            msg = "Executing '%s %s' failed. The last 20 lines in the build log file are:\n" % (
                gradle, task)
            msg += "=========================================================================================================\n"
            with open(log_file, "r") as f:
                msg += "\t"
                msg += "\t".join(f.readlines()[-20:])
            msg += "=========================================================================================================\n"
            msg += "The full build log is available at [%s]." % log_file
            raise BuildError(msg)
Esempio n. 4
0
 def add_binary_to_config(self):
     src_dir = self._config.opts("source", "local.src.dir")
     try:
         binary = glob.glob("%s/distribution/tar/build/distributions/*.tar.gz" % src_dir)[0]
     except IndexError:
         raise SystemSetupError("Couldn't find a tar.gz distribution. Please run Rally with the pipeline 'from-sources-complete'.")
     self._config.add(config.Scope.invocation, "builder", "candidate.bin.path", binary)
Esempio n. 5
0
 def resolve_binary(self):
     artifact_path = _config_value(self.src_config, "plugin.%s.build.artifact.subdir" % self.plugin.name)
     try:
         name = glob.glob("%s/%s/*.zip" % (self.plugin_src_dir, artifact_path))[0]
         return "file://%s" % name
     except IndexError:
         raise SystemSetupError("Couldn't find a plugin zip file for [%s]. Please run Rally with the pipeline 'from-sources-complete'." %
                                self.plugin.name)
Esempio n. 6
0
 def resolve_binary(self):
     try:
         return glob.glob("{}/{}".format(
             self.src_dir, self.value_of("artifact_path_pattern")))[0]
     except IndexError:
         raise SystemSetupError(
             "Couldn't find a tar.gz distribution. Please run Rally with the pipeline 'from-sources-complete'."
         )
Esempio n. 7
0
def resolve_es_binary(src_dir):
    try:
        return glob.glob("%s/distribution/tar/build/distributions/*.tar.gz" %
                         src_dir)[0]
    except IndexError:
        raise SystemSetupError(
            "Couldn't find a tar.gz distribution. Please run Rally with the pipeline 'from-sources-complete'."
        )