forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read metrics store credentials from Vault
With this commit we allow Rally to use different metrics stores and read the respective credentials from Vault. This change is also integrated into the Vagrant workflow as well as night-rally-admin which can still be used locally. Relates elastic#103
- Loading branch information
1 parent
2eb1a1e
commit 435f5f1
Showing
19 changed files
with
317 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
test: | ||
python3 setup.py test | ||
|
||
install: | ||
install: configure | ||
@ ./install.sh | ||
|
||
.PHONY: test install | ||
configure: | ||
@ ./night_rally/fixtures/ansible/configure.sh | ||
|
||
.PHONY: test install configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
SOURCE="${BASH_SOURCE[0]}" | ||
while [[ -h $SOURCE ]]; do # resolve $SOURCE until the file is no longer a symlink | ||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
SOURCE="$(readlink "$SOURCE")" | ||
[[ ${SOURCE} != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | ||
done | ||
SCRIPT_HOME="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | ||
|
||
cd ${SCRIPT_HOME} | ||
|
||
export RALLY_METRICS_STORE_CREDENTIAL_PATH=${RALLY_METRICS_STORE_CREDENTIAL_PATH:-"/secret/rally/cloud/nightly-rally-metrics"} | ||
# attempt to read so we can determine early on whether the user is logged in | ||
set +e | ||
vault read ${RALLY_METRICS_STORE_CREDENTIAL_PATH} > /dev/null 2>&1 | ||
exit_code=$? | ||
set -e | ||
if [[ ${exit_code} -ne 0 ]]; then | ||
echo "Failed to read from ${RALLY_METRICS_STORE_CREDENTIAL_PATH}. Please log in to Vault." | ||
exit 1 | ||
fi | ||
|
||
virtualenv --python=python2.7 .venv | ||
.venv/bin/pip install -q -r requirements.txt | ||
source ./.venv/bin/activate | ||
# Workaround for https://github.com/ansible/ansible/issues/31869 which is | ||
# basically a Python deficiency (see | ||
# http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html | ||
# for details). | ||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES | ||
|
||
ansible-playbook --connection=local playbooks/configure-rally.yml --extra-vars="rally_environment=nightly local_setup=true" | ||
ansible-playbook --connection=local playbooks/configure-rally.yml --extra-vars="rally_environment=release local_setup=true" | ||
# TODO: Remove this after the cutover period. | ||
ansible-playbook --connection=local playbooks/configure-rally.yml --extra-vars="rally_environment=release-new local_setup=true" | ||
ansible-playbook --connection=local playbooks/configure-rally.yml --extra-vars="rally_environment=nightly-new local_setup=true" | ||
unset OBJC_DISABLE_INITIALIZE_FORK_SAFETY | ||
deactivate | ||
cd - > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
|
||
- name: Configures Rally locally | ||
# ============================== | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
roles: | ||
- { role: rally-configure, tags: rally-configure } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.