Skip to content

Commit

Permalink
Merge pull request #911 from astrolabsoftware/909-add-simple-monitori…
Browse files Browse the repository at this point in the history
…ng-stack

Add option to install prometheus stack
  • Loading branch information
fjammes authored Oct 28, 2024
2 parents 5b44af7 + 579dcf0 commit 1dbfef9
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .ciux
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies:
- image: gitlab-registry.in2p3.fr/astrolabsoftware/fink/spark-py:k8s-3.4.1
labels:
build: "true"
- package: github.com/k8s-school/[email protected].3-rc9
- package: github.com/k8s-school/[email protected].4-rc1
labels:
itest: "optional"
- package: github.com/astrolabsoftware/finkctl/[email protected]
Expand Down
16 changes: 16 additions & 0 deletions doc/monitor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Monitor fink-broker platform

```bash
# Run the fink-ci script to install fink-broker from scratch
fink-ci.sh -m -s -b <branch-name>

# Port forward to grafana
kubectl port-forward $(kubectl get pods --selector=app.kubernetes.io/name=grafana -n monitoring --output=jsonpath="{.items..metadata.name}") -n monitoring 3001:3000

# Run ssh tunnel on workstation for remote access
ssh fink_lpc -L 3001:localhost:3001 -N
# Open URL below in a browser
# login: admin
# password: prom-operator
curl http://localhost:3001
```
126 changes: 0 additions & 126 deletions doc/prod.md

This file was deleted.

9 changes: 5 additions & 4 deletions e2e/fink-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ Available options:
-s Use the science algorithms during the tests
-b <branch> Branch name to clone (default: master)
Clone Fink-broker source code in a tempory directory and run e2e test
designed to be run as a cron job.
Clone Fink-broker source code in a tempory directory and run e2e test.
Designed to be run as a cron job.
EOD
}

# Get the options
while getopts hcsb: c ; do
while getopts chmsb: c ; do
case $c in
h) usage ; exit 0 ;;
b) branchname=$OPTARG ;;
c) cleanup_opt="-c" ;;
m) monitoring_opt="-m" ;;
s) science_opt="-s" ;;
\?) usage ; exit 2 ;;
esac
Expand All @@ -49,4 +50,4 @@ shift "$((OPTIND-1))"
git clone --single-branch $repo_url $repo --branch $branchname

# Run fink ci in science mode
$repo/e2e/run.sh $cleanup_opt $science_opt
$repo/e2e/run.sh $cleanup_opt $science_opt $monitoring_opt
8 changes: 7 additions & 1 deletion e2e/prereq-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ DIR=$(cd "$(dirname "$0")"; pwd -P)

kind_version_opt=""
cluster_name=$(ciux get clustername $DIR/..)
monitoring=false

# Get kind version from option -k
while getopts k: flag
while getopts mk: flag
do
case "${flag}" in
k) kind_version_opt=--kind-version=${OPTARG};;
m) monitoring=true;;
esac
done

Expand All @@ -28,4 +30,8 @@ ink "Install OLM"
ktbx install olm
ink "Install ArgoCD operator"
ktbx install argocd
if [ "$monitoring" = true ]; then
ink "Install prometheus monitoring stack"
ktbx install prometheus
fi

19 changes: 16 additions & 3 deletions e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ set -euxo pipefail
DIR=$(cd "$(dirname "$0")"; pwd -P)

usage () {
echo "Usage: $0 [-s]"
echo "Usage: $0 [-c] [-h] [-m] [-s]"
echo " -s: Use the science algorithms during the tests"
echo " -c: Cleanup the cluster after the tests"
echo " -m: Install monitoring stack"
echo " -h: Display this help"
echo ""
echo " Run fink-broker e2e tests, using source code from the parent directory."
exit 1
}

Expand All @@ -24,19 +28,23 @@ src_dir=$DIR/..
cleanup=false
build=false
e2e=false
monitoring=false
push=false

token="${TOKEN:-}"

# Get options for suffix
while getopts hcs opt; do
while getopts hcms opt; do
case ${opt} in
s )
SUFFIX=""
;;
c )
cleanup=true
;;
m )
monitoring=true
;;
h )
usage
exit 0
Expand Down Expand Up @@ -105,7 +113,12 @@ echo "Delete the cluster $cluster if it already exists"
ktbx delete --name "$cluster" || true

echo "Create a Kubernetes cluster (Kind), Install OLM and ArgoCD operators."
$DIR/prereq-install.sh
monitoring_opt=""
if [ $monitoring = true ]
then
monitoring_opt="-m"
fi
$DIR/prereq-install.sh $monitoring_opt

. $CIUXCONFIG
if [ $CIUX_BUILD = true ]; then
Expand Down

0 comments on commit 1dbfef9

Please sign in to comment.