gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-grid5k] 119/141: update espec - add taler-perf utility


From: gnunet
Subject: [taler-grid5k] 119/141: update espec - add taler-perf utility
Date: Thu, 18 Nov 2021 14:51:00 +0100

This is an automated email from the git hooks/post-receive script.

marco-boss pushed a commit to branch master
in repository grid5k.

commit d0e1f34529a7d108e8a8aed752215895546891f0
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Wed Nov 10 15:21:29 2021 +0100

    update espec - add taler-perf utility
---
 experiment/experiment-specification.yml |  8 +++-
 experiment/scripts/wallet.sh            | 30 +++++++++---
 experiment/taler-perf.sh                | 84 +++++++++++++++++++++++++++++++++
 notes.txt                               |  2 +
 4 files changed, 117 insertions(+), 7 deletions(-)

diff --git a/experiment/experiment-specification.yml 
b/experiment/experiment-specification.yml
index 5526ca9..aa18601 100755
--- a/experiment/experiment-specification.yml
+++ b/experiment/experiment-specification.yml
@@ -1,12 +1,18 @@
 version: 1.0-basic
 rspec: 
-  - bundled: taler-perf.rspec
+  - bundled: infra.rspec
 upload: 
   - bundled: .env
   - bundled: scripts
     permission: "774"
+  - bundled: taler-perf.sh
+    permission: "700"
+  - meta: experiment-info.json
 execute:
+  # Setup DNS and Environment config
   - bundled: setup.sh
+  # Clear the DNS-Zone
   - bundled: cleardns.sh
     nodes: [Exchange]
+  # Execute node specific code
   - bundled: run.sh
diff --git a/experiment/scripts/wallet.sh b/experiment/scripts/wallet.sh
index 354c7fa..ca84b7e 100755
--- a/experiment/scripts/wallet.sh
+++ b/experiment/scripts/wallet.sh
@@ -17,16 +17,34 @@ then
     systemctl restart taler-wallet@logging.service
   fi
 else
-  NUM_PROCESSES=$1
+  NUM_PROCESSES=$2
 fi
 
 # count the running wallets
 RUNNING=$(ps -aux | grep "[wallet]-cli" | wc -l)
 
-for i in $(seq ${NUM_PROCESSES})
-do
-  let "i+=${RUNNING}"
-  systemctl restart taler-wallet@${i}.service
-done
+case "$1" in
+  stop)
+    let "START=${RUNNING}-${NUM_PROCESSES}+1"
+    for i in $(seq ${START} ${RUNNING})
+    do
+      systemctl stop taler-wallet@${i}.service
+    done
+    ;;
+  start|init)
+    CPU_USAGE=$[100-$(vmstat 1 2 | tail -1 | awk '{print $15}')]
+    echo "CPU Usage: ${CPU_USAGE}%"
+    if [ "${CPU_USAGE}" -gt "75" ];
+    then 
+      echo "Not starting any more wallets"
+      exit 1
+    fi
+    for i in $(seq ${NUM_PROCESSES})
+    do
+      let "i+=${RUNNING}"
+      systemctl restart taler-wallet@${i}.service
+    done
+    ;;
+esac
 
 exit 0
diff --git a/experiment/taler-perf.sh b/experiment/taler-perf.sh
new file mode 100644
index 0000000..41e70c2
--- /dev/null
+++ b/experiment/taler-perf.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+set -e
+
+source /etc/environment
+source ~/scripts/helpers.sh
+
+function start_wallets() {
+  for WALLET in $(get_wallet_domains); do
+    ssh -o StrictHostKeyChecking=no wallet.${WALLET}.perf.taler \
+           "/bin/bash /root/scripts/wallet.sh start 
${1:-${NUM_WALLET_PROCESSES}}" &
+  done
+  wait
+}
+
+function stop_wallets() {
+ for WALLET in $(get_wallet_domains); do
+   ssh -o StrictHostKeyChecking=no wallet.${WALLET}.perf.taler \
+          "/bin/bash /root/scripts/wallet.sh stop 
${1:-${NUM_WALLET_PROCESSES}}" &
+  done
+  wait
+}
+
+function start_exchanges() {
+  ssh -o StrictHostKeyChecking=no ${EXCHANGE_DOMAIN} \
+         "/bin/bash /root/scripts/exchange.sh ${1:-${NUM_EXCHANGE_PROCESSES}}" 
+  ssh -o StrictHostKeyChecking=no ${PROXY_DOMAIN} \
+         "/bin/bash /root/scripts/proxy.sh ${1:-${NUM_EXCHANGE_PROCESSES}}"
+}
+
+function start_processes() {
+  case "$1" in
+    wallet)
+      start_wallets $2
+      ;;
+    exchange)
+      start_exchanges $2
+      ;;
+    *)
+      echo "Unknown argument '$1' for function ${FUNCNAME[0]}"
+      echo "Usage: start [wallets|exchanges] NUM"
+      ;;
+  esac
+}
+
+function stop_processes() {
+  case "$1" in 
+    wallet)
+      stop_wallets $2
+      ;;
+    *)
+      echo "Unknown argument '$1' for function ${FUNCNAME[0]}"
+      echo "Usage: stop [wallets] NUM"
+      ;;
+   esac
+}
+
+function update_processes() {
+  case "$1" in 
+    prometheus)
+      ssh -o StrictHostKeyChecking=no ${MONITOR_DOMAIN} "/bin/bash -c 
/root/scripts/monitor.sh"
+      ;;
+    *)
+      echo "Unknown argument '$1' for function ${FUNCNAME[0]}"
+      echo "Usage: update [prometheus]"
+      ;;
+  esac
+}
+
+case "$1" in
+  start)
+    shift
+    start_processes $@
+    ;;
+  stop)
+    shift
+    stop_processes $@
+    ;;
+  update)
+    shift
+    update_processes $@
+    ;;
+esac
+
+exit 0
diff --git a/notes.txt b/notes.txt
index def8d16..b334225 100644
--- a/notes.txt
+++ b/notes.txt
@@ -16,3 +16,5 @@
     The proxy server could not handle the request<p>Reason: <strong>Error 
reading from remote server</strong></p></p>
 * SSH login from rpesc viewer not possible
 * SSH login often fails - must provide password for cert and user (user 
password is not the one I speciefied, neither the default for the root user of 
the image) - or connection closed ... - BUG in allocation code according to 
email
+* espec - possibility to rerun and override previously uploaded files
+* ansible not working with debian 11 - install script fails - but even when 
installed manually it hangs in preparing ansible dir

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]