Skip to content

Commit

Permalink
ceph-dashboard-* jobs: Install Prometheus and Alertmanager
Browse files Browse the repository at this point in the history
In order to test the alert configuration within the dashboard
(e2e tests) we need to have Prometheus and Alertmanager running
on the system. Added a new script which takes care of the installation
and running Prometheus and Alertmanager in the background.
Added the script only to the dashboard e2e Jenkins job (for the time being),
the processes will be killed at the end of the job.

Signed-off-by: Laura Paduano <[email protected]>
  • Loading branch information
callithea committed Feb 5, 2020
1 parent 62b157b commit 8b98a28
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@
- shell:
!include-raw:
- ../../../scripts/dashboard/install-e2e-test-deps.sh
- ../../../scripts/dashboard/install-prometheus-and-alertmanager.sh
- shell: "cd src/pybind/mgr/dashboard; timeout 7200 ./run-frontend-e2e-tests.sh"
- shell: pkill prometheus && pkill alertmanager
27 changes: 27 additions & 0 deletions scripts/dashboard/install-prometheus-and-alertmanager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -ex

# Install and run Prometheus
# Use $WORKSPACE dir since it will be wiped after the job has completed
cd $WORKSPACE
sudo mkdir prometheus
cd prometheus
sudo curl -LO https://github.com/prometheus/prometheus/releases/download/v2.15.2/prometheus-2.15.2.linux-amd64.tar.gz
sudo tar xf prometheus-2.15.2.linux-amd64.tar.gz
cd prometheus/prometheus-2.15.2.linux-amd64

sudo ./prometheus &

cd $WORKDIR

# Install and run Alertmanager
sudo mkdir alertmanager
cd alertmanager
sudo curl -LO https://github.com/prometheus/alertmanager/releases/download/v0.20.0/alertmanager-0.20.0.linux-amd64.tar.gz
sudo tar xf alertmanager-0.20.0.linux-amd64.tar.gz
cd alertmanager/alertmanager-0.20.0.linux-amd64

sudo ./alertmanager &

# "pkill prometheus" and "pkill alertmanager" must be executed in the Jenkins job that uses this script

0 comments on commit 8b98a28

Please sign in to comment.