From 7f40bf6b394d873962903a06cdd6fc857f1fc44d Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Mon, 25 May 2020 13:09:27 +0200 Subject: [PATCH] Use Rally's artifact cache cleanup (#263) With this commit we remove night-rally's custom artifact cache cleanup and instead rely on Rally's mechanism implemented in elastic/rally#998. We also set the cache duration to two days (instead of the default seven days) to ensure artifacts are cached for the nightlies but are still present for quick follow-up investigations without taking up too much space on disk. Relates elastic/rally#998 --- night_rally.sh | 1 - .../playbooks/evict-artifact-cache.yml | 16 ------ .../rally-configure/templates/rally.ini.j2 | 1 + night_rally/night_rally.py | 2 +- tests/night_rally_test.py | 50 +++++++++---------- 5 files changed, 27 insertions(+), 43 deletions(-) delete mode 100644 night_rally/fixtures/ansible/playbooks/evict-artifact-cache.yml diff --git a/night_rally.sh b/night_rally.sh index 60225cd4fce8f..11f54163671f8 100755 --- a/night_rally.sh +++ b/night_rally.sh @@ -208,7 +208,6 @@ then cd ${NIGHT_RALLY_HOME}/night_rally/fixtures/ansible ansible-playbook -i inventory/production -u rally playbooks/update-rally.yml --extra-vars="rally_environment=${RALLY_ENVIRONMENT} in_vagrant=${IN_VAGRANT} skip_rally_update=${SKIP_RALLY_UPDATE}" ansible-playbook -i inventory/production -u rally playbooks/check-drive-health.yml ${ANSIBLE_SKIP_TAGS_STRING} --extra-vars="in_vagrant=${IN_VAGRANT}" - ansible-playbook -i inventory/production -u rally playbooks/evict-artifact-cache.yml ansible-playbook -i inventory/production -u rally playbooks/setup.yml ${ANSIBLE_SKIP_TAGS_STRING} popd >/dev/null 2>&1 diff --git a/night_rally/fixtures/ansible/playbooks/evict-artifact-cache.yml b/night_rally/fixtures/ansible/playbooks/evict-artifact-cache.yml deleted file mode 100644 index dddd402dfc195..0000000000000 --- a/night_rally/fixtures/ansible/playbooks/evict-artifact-cache.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: remove cached artifacts -# ============================================ - hosts: target_hosts - gather_facts: true - become: true - become_user: jenkins - - vars: - distributions_dir: '{{ ansible_env.HOME }}/.rally/benchmarks/distributions/' - - tasks: - - name: delete distributions directory - file: - path: '{{ distributions_dir }}' - state: absent diff --git a/night_rally/fixtures/ansible/roles/rally-configure/templates/rally.ini.j2 b/night_rally/fixtures/ansible/roles/rally-configure/templates/rally.ini.j2 index 47c9bbbea5322..4066b6648cc62 100644 --- a/night_rally/fixtures/ansible/roles/rally-configure/templates/rally.ini.j2 +++ b/night_rally/fixtures/ansible/roles/rally-configure/templates/rally.ini.j2 @@ -12,6 +12,7 @@ env.name = {{rally_environment}} remote.repo.url = https://github.com/elastic/elasticsearch.git elasticsearch.src.subdir = elasticsearch cache = true +cache.days = 2 [benchmarks] local.dataset.cache = {{rally_homedir}}/.rally/benchmarks/data diff --git a/night_rally/night_rally.py b/night_rally/night_rally.py index c6559705728b9..2c0bae578fd24 100644 --- a/night_rally/night_rally.py +++ b/night_rally/night_rally.py @@ -184,7 +184,7 @@ class SourceBasedCommand(BaseCommand): def __init__(self, params, revision): self.params = ParamsFormatter(params=params + [ LicenseParams(distribution_version="master"), - ConstantParam("pipeline", "from-sources-complete"), + ConstantParam("pipeline", "from-sources"), ConstantParam("revision", revision) ]) diff --git a/tests/night_rally_test.py b/tests/night_rally_test.py index 8f1cbee8e9465..f7e4385921f69 100644 --- a/tests/night_rally_test.py +++ b/tests/night_rally_test.py @@ -361,14 +361,14 @@ def test_run_two_oss_challenges_successfully(self, mocked_wait_until_port_is_fre "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-append-1node,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" " + "--pipeline=\"from-sources\" " "--revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts-index-only\" --car=\"4gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-append-4g-1node,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--track-params=\"{{\\\"number_of_replicas\\\": 0}}\" --pipeline=\"from-sources-complete\" " + "--track-params=\"{{\\\"number_of_replicas\\\": 0}}\" --pipeline=\"from-sources\" " "--revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id) ] , @@ -414,7 +414,7 @@ def test_exclude_tasks_option(self, mocked_wait_until_port_is_free): "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-append-1node,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--exclude-tasks=\"delete,type:search\" --pipeline=\"from-sources-complete\" " + "--exclude-tasks=\"delete,type:search\" --pipeline=\"from-sources\" " "--revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id) ] , @@ -460,7 +460,7 @@ def test_overwrite_runtime_jdk_successfully(self, mocked_wait_until_port_is_free "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-append-1node,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"13\" " - "--pipeline=\"from-sources-complete\" " + "--pipeline=\"from-sources\" " "--revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id) ] , @@ -531,26 +531,26 @@ def test_run_two_mixed_license_challenges_successfully(self, mocked_wait_until_p "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" " + "--pipeline=\"from-sources\" " "--revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-4g,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults,basic-license\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,race-configs-id:{},license:basic\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap,basic-license\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-4g,setup:bare,race-configs-id:{},license:basic\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id) + "--pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"".format(race_configs_id) ] , system_call.calls @@ -617,13 +617,13 @@ def test_run_two_oss_tracks_successfully(self, mocked_wait_until_port_is_free): "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"127.0.0.2:9200\" " "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"percolator\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:percolator-4g,setup:bare,race-configs-id:{},license:oss\" " - "--runtime-jdk=\"8\" --pipeline=\"from-sources-complete\" " + "--runtime-jdk=\"8\" --pipeline=\"from-sources\" " "--revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id) ] , @@ -747,19 +747,19 @@ def test_run_three_sets_of_mixed_license_tracks_successfully(self, mocked_wait_u "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap,basic-license\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-append-4g-3nodes,setup:bare,race-configs-id:{},license:basic\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults,trial-license\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,race-configs-id:{},license:trial\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"@2016-10-01T00:00:00Z\"".format(race_configs_id), 'rally --skip-update --configuration-name="nightly" --quiet ' '--target-host="localhost:9200" --effective-start-date="2016-10-01 00:00:00" ' @@ -771,7 +771,7 @@ def test_run_three_sets_of_mixed_license_tracks_successfully(self, mocked_wait_u '--runtime-jdk="8" --car-params="{{\\"xpack_ml_enabled\\": false, ' '\\"xpack_monitoring_enabled\\": false, \\"xpack_watcher_enabled\\": false}}" ' '--track-params="{{\\"number_of_replicas\\": 0}}" ' - '--pipeline="from-sources-complete" --revision="@2016-10-01T00:00:00Z"'.format(race_configs_id), + '--pipeline="from-sources" --revision="@2016-10-01T00:00:00Z"'.format(race_configs_id), 'rally --skip-update --configuration-name="nightly" --quiet ' '--target-host="localhost:9200" --effective-start-date="2016-10-01 00:00:00" ' @@ -781,7 +781,7 @@ def test_run_three_sets_of_mixed_license_tracks_successfully(self, mocked_wait_u ',basic_auth_password:\'rally-password\'" ' '--user-tag="name:percolator-4g,setup:bare,race-configs-id:{},license:trial,x-pack:true" --runtime-jdk="8" ' '--car-params="{{\\"xpack_ml_enabled\\": false, \\"xpack_monitoring_enabled\\": false, ' - '\\"xpack_watcher_enabled\\": false}}" --pipeline="from-sources-complete" ' + '\\"xpack_watcher_enabled\\": false}}" --pipeline="from-sources" ' '--revision="@2016-10-01T00:00:00Z"'.format(race_configs_id), 'rally --skip-update --configuration-name="nightly" --quiet ' @@ -792,7 +792,7 @@ def test_run_three_sets_of_mixed_license_tracks_successfully(self, mocked_wait_u ',basic_auth_password:\'rally-password\'" ' '--user-tag="name:percolator,setup:bare,race-configs-id:{},license:trial,x-pack:true" --runtime-jdk="8" ' '--car-params="{{\\"xpack_ml_enabled\\": false, \\"xpack_monitoring_enabled\\": false, ' - '\\"xpack_watcher_enabled\\": false}}" --pipeline="from-sources-complete" ' + '\\"xpack_watcher_enabled\\": false}}" --pipeline="from-sources" ' '--revision="@2016-10-01T00:00:00Z"'.format(race_configs_id) ] , @@ -861,13 +861,13 @@ def test_run_adhoc_benchmark(self, mocked_wait_until_port_is_free): "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"eventdata\" --track=\"eventdata\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:eventdata-defaults,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"66202dc\"".format(race_configs_id), + "--pipeline=\"from-sources\" --revision=\"66202dc\"".format(race_configs_id), "rally --skip-update --configuration-name=\"lucene-7\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"percolator\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:percolator-4g,setup:bare,race-configs-id:{},license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"66202dc\"".format(race_configs_id) + "--pipeline=\"from-sources\" --revision=\"66202dc\"".format(race_configs_id) ] , system_call.calls @@ -1596,13 +1596,13 @@ def test_run_continues_on_error(self, mocked_wait_until_port_is_free): "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-10-01T00:00:00Z\"", + "--pipeline=\"from-sources\" --revision=\"@2016-10-01T00:00:00Z\"", "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-10-01 00:00:00\" --track-repository=\"default\" --track=\"percolator\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:percolator-4g,setup:bare,license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-10-01T00:00:00Z\"" + "--pipeline=\"from-sources\" --revision=\"@2016-10-01T00:00:00Z\"" ] , system_call.calls @@ -1652,7 +1652,7 @@ def test_run_with_telemetry_from_command_line(self, mocked_wait_until_port_is_fr "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,license:oss\" --runtime-jdk=\"8\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"" + "--pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"" ] , system_call.calls @@ -1713,19 +1713,19 @@ def test_run_with_telemetry_from_race_config(self, mocked_wait_until_port_is_fre "--challenge=\"append-no-conflicts\" --car=\"defaults\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-defaults,setup:bare,license:oss\" --runtime-jdk=\"8\" " "--telemetry=\"jfr,gc,jit\" --telemetry-params=\"{\\\"recording-template\\\": \\\"profile\\\"}\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"", + "--pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"", "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"4gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-4g,setup:bare,license:oss\" --runtime-jdk=\"8\" " - "--telemetry=\"gc\" --pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"", + "--telemetry=\"gc\" --pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"", "rally --skip-update --configuration-name=\"nightly\" --quiet --target-host=\"localhost:9200\" " "--effective-start-date=\"2016-01-01 00:00:00\" --track-repository=\"default\" --track=\"geonames\" " "--challenge=\"append-no-conflicts\" --car=\"8gheap\" --client-options=\"timeout:240\" " "--user-tag=\"name:geonames-8g,setup:bare,license:oss\" --runtime-jdk=\"8\" --on-error=\"abort\" " - "--pipeline=\"from-sources-complete\" --revision=\"@2016-01-01T00:00:00Z\"", + "--pipeline=\"from-sources\" --revision=\"@2016-01-01T00:00:00Z\"", ] , system_call.calls @@ -1741,7 +1741,7 @@ def test_finds_race_meta_data(self, client_factory): "trial-timestamp": "20200310T200052Z", "race-id": "6a7527a5-79ba-4cbf-a41c-d09a4b254b2a", "race-timestamp": "20200310T200000Z", - "pipeline": "from-sources-complete", + "pipeline": "from-sources", "user-tags": { "name": "geonames-append-4g-3nodes", "setup": "bare-oss",