Skip to content

Commit 798961a

Browse files
Support --target-host for Docker
Closes elastic#16
1 parent a202323 commit 798961a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

night_rally.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ def configure_rally(dry_run):
125125

126126

127127
class BaseCommand:
128-
def __init__(self, effective_start_date, root_dir):
128+
def __init__(self, effective_start_date, target_host, root_dir):
129129
self.effective_start_date = effective_start_date
130+
self.target_host = target_host
130131
self.root_dir = root_dir
131132
self.ts = date_for_cmd_param(effective_start_date)
132133
self.report_root_dir = config["report.base.dir"]
@@ -145,9 +146,8 @@ def command_line(self, track, challenge, car):
145146

146147
class NightlyCommand(BaseCommand):
147148
def __init__(self, effective_start_date, target_host, root_dir, override_src_dir=None):
148-
super().__init__(effective_start_date, root_dir)
149+
super().__init__(effective_start_date, target_host, root_dir)
149150
self.revision_ts = to_iso8601(effective_start_date)
150-
self.target_host = target_host
151151
self.pipeline = "from-sources-complete"
152152
if override_src_dir is not None:
153153
self.override = " --override-src-dir=%s" % override_src_dir
@@ -166,8 +166,7 @@ def command_line(self, track, challenge, car):
166166

167167
class ReleaseCommand(BaseCommand):
168168
def __init__(self, effective_start_date, target_host, root_dir, distribution_version):
169-
super().__init__(effective_start_date, root_dir)
170-
self.target_host = target_host
169+
super().__init__(effective_start_date, target_host, root_dir)
171170
self.pipeline = "from-distribution"
172171
self.distribution_version = distribution_version
173172

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

181180

182181
class DockerCommand(BaseCommand):
183-
def __init__(self, effective_start_date, root_dir, distribution_version):
184-
super().__init__(effective_start_date, root_dir)
182+
def __init__(self, effective_start_date, target_host, root_dir, distribution_version):
183+
super().__init__(effective_start_date, target_host, root_dir)
185184
self.pipeline = "docker"
186185
self.distribution_version = distribution_version.replace("Docker ", "")
187186

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

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

198198

@@ -533,7 +533,7 @@ def main():
533533
root_dir = config["root.dir"] if not args.override_root_dir else args.override_root_dir
534534
if compare_mode:
535535
if args.release.startswith("Docker"):
536-
command = DockerCommand(args.effective_start_date, root_dir, args.release)
536+
command = DockerCommand(args.effective_start_date, args.target_host, root_dir, args.release)
537537
else:
538538
command = ReleaseCommand(args.effective_start_date, args.target_host, root_dir, args.release)
539539
else:

0 commit comments

Comments
 (0)