Skip to content

Commit

Permalink
Disable x-pack for Docker in 5.x
Browse files Browse the repository at this point in the history
With this commit we explicitly disable x-pack for the 5.x Docker images.
We did this previously directly in Rally but have removed this recently
and that's why night-rally needs to do this now.
  • Loading branch information
danielmitterdorfer committed Sep 7, 2018
1 parent acaa464 commit aa3da3c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 6 deletions.
14 changes: 12 additions & 2 deletions night_rally/night_rally.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,20 @@ class DockerCommand(BaseCommand):
def __init__(self, params, distribution_version):
self.pipeline = "docker"
self.distribution_version = distribution_version
self.params = ParamsFormatter(params=params + [

docker_params = [
ConstantParam("distribution-version", distribution_version),
ConstantParam("pipeline", "docker")
])
]
if int(self.distribution_version[0]) < 6:
# 5.x needs additional settings as we removed this from Rally in c805ccda0ea05f15bdae22a1eac601bb33a66eae
docker_params.append(
ConstantParam("car-params", "{\\\"additional_cluster_settings\\\": {\\\"xpack.security.enabled\\\": \\\"false\\\", "
"\\\"xpack.ml.enabled\\\": \\\"false\\\", \\\"xpack.monitoring.enabled\\\": \\\"false\\\", "
"\\\"xpack.watcher.enabled\\\": \\\"false\\\"}}")
)

self.params = ParamsFormatter(params=params + docker_params)

def runnable(self, race_config):
# we don't support (yet?) clusters with multiple Docker containers
Expand Down
55 changes: 51 additions & 4 deletions tests/night_rally_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def test_do_not_run_release_benchmark_with_transport_nio_on_old_version(self, mo
self.assertEqual(0, len(system_call.calls))

@mock.patch('night_rally.night_rally.wait_until_port_is_free', return_value=True)
def test_run_docker_benchmark(self, mocked_wait_until_port_is_free):
def test_run_docker_5x_benchmark(self, mocked_wait_until_port_is_free):
system_call = RecordingSystemCall(return_value=False)

tracks = [
Expand All @@ -494,7 +494,7 @@ def test_run_docker_benchmark(self, mocked_wait_until_port_is_free):
]
start_date = datetime.datetime(2016, 1, 1)
params = [night_rally.StandardParams("release", start_date, 8, {"env": "docker"})]
cmd = night_rally.DockerCommand(params, "5.3.0")
cmd = night_rally.DockerCommand(params, "5.6.0")

night_rally.run_rally(tracks, ["localhost"], cmd, skip_ansible=True, system=system_call)
self.assertEqual(2, len(system_call.calls))
Expand All @@ -503,12 +503,59 @@ def test_run_docker_benchmark(self, mocked_wait_until_port_is_free):
"rally --skip-update --configuration-name=\"release\" --quiet --target-host=\"localhost:39200\" "
"--effective-start-date=\"2016-01-01 00:00:00\" --track=\"geonames\" --challenge=\"append-no-conflicts\" "
"--car=\"defaults\" --user-tag=\"env:docker,name:geonames-defaults\" --runtime-jdk=\"8\" "
"--distribution-version=\"5.3.0\" --pipeline=\"docker\"",
"--distribution-version=\"5.6.0\" --pipeline=\"docker\" --car-params=\"{\\\"additional_cluster_settings\\\": "
"{\\\"xpack.security.enabled\\\": \\\"false\\\", \\\"xpack.ml.enabled\\\": \\\"false\\\", "
"\\\"xpack.monitoring.enabled\\\": \\\"false\\\", \\\"xpack.watcher.enabled\\\": \\\"false\\\"}}\"",

"rally --skip-update --configuration-name=\"release\" --quiet --target-host=\"localhost:39200\" "
"--effective-start-date=\"2016-01-01 00:00:00\" --track=\"geonames\" --challenge=\"append-no-conflicts\" "
"--car=\"4gheap\" --user-tag=\"env:docker,name:geonames-4g\" --runtime-jdk=\"8\" "
"--distribution-version=\"5.3.0\" --pipeline=\"docker\""
"--distribution-version=\"5.6.0\" --pipeline=\"docker\" --car-params=\"{\\\"additional_cluster_settings\\\": "
"{\\\"xpack.security.enabled\\\": \\\"false\\\", \\\"xpack.ml.enabled\\\": \\\"false\\\", "
"\\\"xpack.monitoring.enabled\\\": \\\"false\\\", \\\"xpack.watcher.enabled\\\": \\\"false\\\"}}\""
]
,
system_call.calls
)

@mock.patch('night_rally.night_rally.wait_until_port_is_free', return_value=True)
def test_run_docker_6x_benchmark(self, mocked_wait_until_port_is_free):
system_call = RecordingSystemCall(return_value=False)

tracks = [
{
"track": "geonames",
"configurations": [
{
"name": "geonames-defaults",
"challenge": "append-no-conflicts",
"car": "defaults"
},
{
"name": "geonames-4g",
"challenge": "append-no-conflicts",
"car": "4gheap"
}
]
}
]
start_date = datetime.datetime(2016, 1, 1)
params = [night_rally.StandardParams("release", start_date, 8, {"env": "docker"})]
cmd = night_rally.DockerCommand(params, "6.3.0")

night_rally.run_rally(tracks, ["localhost"], cmd, skip_ansible=True, system=system_call)
self.assertEqual(2, len(system_call.calls))
self.assertEqual(
[
"rally --skip-update --configuration-name=\"release\" --quiet --target-host=\"localhost:39200\" "
"--effective-start-date=\"2016-01-01 00:00:00\" --track=\"geonames\" --challenge=\"append-no-conflicts\" "
"--car=\"defaults\" --user-tag=\"env:docker,name:geonames-defaults\" --runtime-jdk=\"8\" "
"--distribution-version=\"6.3.0\" --pipeline=\"docker\"",

"rally --skip-update --configuration-name=\"release\" --quiet --target-host=\"localhost:39200\" "
"--effective-start-date=\"2016-01-01 00:00:00\" --track=\"geonames\" --challenge=\"append-no-conflicts\" "
"--car=\"4gheap\" --user-tag=\"env:docker,name:geonames-4g\" --runtime-jdk=\"8\" "
"--distribution-version=\"6.3.0\" --pipeline=\"docker\""
]
,
system_call.calls
Expand Down

0 comments on commit aa3da3c

Please sign in to comment.