Skip to content

Commit

Permalink
Support --target-host for Docker
Browse files Browse the repository at this point in the history
Closes elastic#16
  • Loading branch information
danielmitterdorfer committed Feb 13, 2017
1 parent a202323 commit 798961a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions night_rally.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ def configure_rally(dry_run):


class BaseCommand:
def __init__(self, effective_start_date, root_dir):
def __init__(self, effective_start_date, target_host, root_dir):
self.effective_start_date = effective_start_date
self.target_host = target_host
self.root_dir = root_dir
self.ts = date_for_cmd_param(effective_start_date)
self.report_root_dir = config["report.base.dir"]
Expand All @@ -145,9 +146,8 @@ def command_line(self, track, challenge, car):

class NightlyCommand(BaseCommand):
def __init__(self, effective_start_date, target_host, root_dir, override_src_dir=None):
super().__init__(effective_start_date, root_dir)
super().__init__(effective_start_date, target_host, root_dir)
self.revision_ts = to_iso8601(effective_start_date)
self.target_host = target_host
self.pipeline = "from-sources-complete"
if override_src_dir is not None:
self.override = " --override-src-dir=%s" % override_src_dir
Expand All @@ -166,8 +166,7 @@ def command_line(self, track, challenge, car):

class ReleaseCommand(BaseCommand):
def __init__(self, effective_start_date, target_host, root_dir, distribution_version):
super().__init__(effective_start_date, root_dir)
self.target_host = target_host
super().__init__(effective_start_date, target_host, root_dir)
self.pipeline = "from-distribution"
self.distribution_version = distribution_version

Expand All @@ -180,19 +179,20 @@ def command_line(self, track, challenge, car):


class DockerCommand(BaseCommand):
def __init__(self, effective_start_date, root_dir, distribution_version):
super().__init__(effective_start_date, root_dir)
def __init__(self, effective_start_date, target_host, root_dir, distribution_version):
super().__init__(effective_start_date, target_host, root_dir)
self.pipeline = "docker"
self.distribution_version = distribution_version.replace("Docker ", "")

def runnable(self, track, challenge, car):
return car not in ["two_nodes", "verbose_iw"]

def command_line(self, track, challenge, car):
cmd = "rally --pipeline={6} --quiet --distribution-version={0} --effective-start-date \"{1}\" " \
cmd = "rally --target-host={7} --pipeline={6} --quiet --distribution-version={0} --effective-start-date \"{1}\" " \
"--track={2} --challenge={3} --car={4} --report-format=csv --report-file={5} --cluster-health=yellow " \
"--client-options=\"basic_auth_user:'elastic',basic_auth_password:'changeme',timeout:60000,request_timeout:60000\"". \
format(self.distribution_version, self.ts, track, challenge, car, self.report_path(track, challenge, car), self.pipeline)
format(self.distribution_version, self.ts, track, challenge, car, self.report_path(track, challenge, car), self.pipeline,
self.target_host)
return cmd


Expand Down Expand Up @@ -533,7 +533,7 @@ def main():
root_dir = config["root.dir"] if not args.override_root_dir else args.override_root_dir
if compare_mode:
if args.release.startswith("Docker"):
command = DockerCommand(args.effective_start_date, root_dir, args.release)
command = DockerCommand(args.effective_start_date, args.target_host, root_dir, args.release)
else:
command = ReleaseCommand(args.effective_start_date, args.target_host, root_dir, args.release)
else:
Expand Down

0 comments on commit 798961a

Please sign in to comment.