Skip to content

Commit

Permalink
Merge pull request #32 from unfor19/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
unfor19 authored Feb 27, 2021
2 parents bb3ae23 + 42d9612 commit c0f89fc
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 38 deletions.
Empty file removed __init__.py
Empty file.
6 changes: 5 additions & 1 deletion kubernetes/deploy_stack.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e
set -o pipefail

# Copy relevant files to `.frigga/`
source kubernetes/minikube_rsync.sh

kubectl apply -f kubernetes/debug.yml
Expand All @@ -11,8 +13,10 @@ while [[ -z "$(kubectl get pods | grep debug.*Running)" ]]; do
done
echo ">> [LOG] Debug pod is ready!"
POD_DEBUG=$(kubectl get pods | grep debug.*Running | cut -f 1 -d " ")
# kubectl exec -it $POD_DEBUG bash "mkdir -p /root/frigga"

# Copy from `.frigga/` to debug pod
kubectl cp .frigga/ default/$POD_DEBUG:/root/frigga/

kubectl apply \
-f kubernetes/exporters.yml \
-f kubernetes/monitoring.yml
Expand Down
2 changes: 0 additions & 2 deletions kubernetes/local.minikube.start.sh

This file was deleted.

5 changes: 0 additions & 5 deletions kubernetes/local.test.sh

This file was deleted.

3 changes: 0 additions & 3 deletions kubernetes/minikube_rsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ else
MINIKUBE_HOME=/home/runner/work/_temp
fi

AGENT_PID=$(eval `ssh-agent -s`)
echo ">> [LOG] ssh-agent PID = $AGENT_PID"

rm -rf .frigga
mkdir .frigga
echo $PWD
Expand Down
13 changes: 2 additions & 11 deletions kubernetes/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ set -e
set -o pipefail
kubectl get pods
POD_PROMETHEUS=$(kubectl get pods --selector=app=prometheus | grep 1/1.*Running | cut -f 1 -d " " 2>/dev/null || true)
[[ -z ${POD_PROMETHEUS} ]] && echo "The container ${POD_PROMETHEUS} is not running, execute first docker-compose/deploy_stack.sh"

reload_result=$(kubectl logs ${POD_PROMETHEUS})
reload_success=$(echo "${reload_result}" | tail -n 3 | grep ".*Completed loading of configuration file.*")
if [[ -z ${reload_succes} ]]; then
echo ""
echo ">> [LOG] Successfully reloaded prometheus.yml"
echo ""
else
echo ">> [ERROR] Failed to reload prometheus.yml"
echo "${reload_result}"
if [[ -z ${POD_PROMETHEUS} ]]; then
echo "The container ${POD_PROMETHEUS} is not running, execute first docker-compose/deploy_stack.sh"
exit 1
fi
8 changes: 0 additions & 8 deletions src/frigga/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@
from time import sleep


# frigga_url = env['FRIGGA_URL'] if 'FRIGGA_URL' in env else "http://localhost:8083" # noqa: 501
# prom_url = env['PROM_URL'] if 'PROM_URL' in env else "http://localhost:9090"
# prom_yaml_path = env['PROM_YAML_PATH'] if 'PROM_YAML_PATH' in env else "docker-compose/prometheus.yml" # noqa: 501
# metrics_json_path = env['METRICS_JSON_PATH'] if 'METRICS_JSON_PATH' in env else ".metrics.json" # noqa: 501
# create_backup_file = env['CREATE_BACKUP_FILE'] if 'CREATE_BACKUP_FILE' in env else True # noqa: 501
# skip_rules_file = env['SKIP_RULES_FILE'] if 'SKIP_RULES_FILE' in env else False # noqa: 501
# grafana_url = env['GRAFANA_URL'] if 'GRAFANA_URL' in env else "http://localhost:3000" # noqa: 501
# grafana_api_key = env['GRAFANA_API_KEY'] if 'GRAFANA_API_KEY' in env else None # noqa: 501
sleep_seconds = float(env['SLEEP_SECONDS']) if 'SLEEP_SECONDS' in env else 15 # noqa: 501


Expand Down
8 changes: 0 additions & 8 deletions src/frigga/wsclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

from .config import print_msg

# frigga_url = env['FRIGGA_URL'] if 'FRIGGA_URL' in env else "ws://localhost:8084" # noqa: 501
# prom_url = env['PROM_URL'] if 'PROM_URL' in env else "http://localhost:9090"
# prom_yaml_path = env['PROM_YAML_PATH'] if 'PROM_YAML_PATH' in env else "docker-compose/prometheus.yml" # noqa: 501
# metrics_json_path = env['METRICS_JSON_PATH'] if 'METRICS_JSON_PATH' in env else ".metrics.json" # noqa: 501
# create_backup_file = env['CREATE_BACKUP_FILE'] if 'CREATE_BACKUP_FILE' in env else True # noqa: 501
# skip_rules_file = env['SKIP_RULES_FILE'] if 'SKIP_RULES_FILE' in env else False # noqa: 501
# grafana_url = env['GRAFANA_URL'] if 'GRAFANA_URL' in env else "http://localhost:3000" # noqa: 501
# grafana_api_key = env['GRAFANA_API_KEY'] if 'GRAFANA_API_KEY' in env else None # noqa: 501
sleep_seconds = float(env['SLEEP_SECONDS']) if 'SLEEP_SECONDS' in env else 30 # noqa: 501


Expand Down

0 comments on commit c0f89fc

Please sign in to comment.