[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-grid5k] 03/16: add plotting script and better documentation
From: |
gnunet |
Subject: |
[taler-grid5k] 03/16: add plotting script and better documentation |
Date: |
Tue, 23 Nov 2021 19:22:20 +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 28ebc2bdf50219ae9ffa3080943d5623a857ba5e
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Mon Nov 22 17:08:15 2021 +0100
add plotting script and better documentation
---
README | 23 -----
README.md | 35 ++++++++
additional/.gitignore | 2 +
additional/README.md | 9 ++
additional/config.yaml | 19 ++++
additional/configs/bind/named.conf.local | 13 +++
additional/configs/bind/named.conf.options | 19 ++++
additional/configs/bind/perf.taler | 12 +++
additional/configs/grafana/tbd | 0
additional/env | 4 -
additional/plot.sh | 39 ++++++++
additional/plots.sh | 137 -----------------------------
docker/Dockerfile | 1 +
docker/README.md | 21 +++--
docker/entrypoint.sh | 49 ++++++++---
experiment/README | 21 -----
experiment/README.md | 50 +++++++++++
experiment/env | 64 +++++++++-----
experiment/experiment-specification.yml | 12 +--
experiment/{ => scripts}/cleardns.sh | 8 +-
experiment/scripts/exchange.sh | 5 +-
experiment/scripts/monitor.sh | 2 +-
experiment/{ => scripts}/run.sh | 2 +-
experiment/{ => scripts}/setup.sh | 10 +--
experiment/{ => scripts}/taler-perf.sh | 0
image/README.md | 53 +++++++++++
notes.txt | 5 +-
27 files changed, 369 insertions(+), 246 deletions(-)
diff --git a/README b/README
deleted file mode 100644
index 17f45f5..0000000
--- a/README
+++ /dev/null
@@ -1,23 +0,0 @@
-Use
-
-$ kameleon build taler-debian11
-
-to build the image.
-
-Note: Maybe the user needs to be adjusted in g5k_tar_path
-i.e. http://public.lyon.grid5000.fr/~<G5K_USER>/taler-debian11.tar.zst
-
-Afterwards:
-
-$ cd build/taler-debian11
-$ scp taler-debian11.dsc taler-debian11.tar.zst \
- <G5K_USER>@access.grid5000.fr:lyon/public/
-
-Then we can use
-
- http://public.lyon.grid5000.fr/~<G5K_USER>/taler-debian11.dsc
-
-for the disk image in jfed.
-
-jFed example configurations are in the jfed/ directory.
-
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..bf0d198
--- /dev/null
+++ b/README.md
@@ -0,0 +1,35 @@
+# Taler experiments for Grid5000
+
+## Directory Strucutre
+
+In most directories you will find another README
+which describes how the parts in there can be used.
+
+### Experiments
+
+Contains all configurations and scripts needed
+for the experiment to run in the grid. They are setup to
+work with (jFed)[https://jfed.ilabt.imec.be/].
+
+### Image
+
+Contains the Grid5000 Environment configuration.
+This needs to be built and copied to the grid before
+any experiments can take place.
+
+### Docker
+
+Some automated way to create the image and directly copy it
+to the grid.
+No need to install the required build tools on your machine.
+
+### Additional
+
+Scripts and configurations which can be used to e.g. persist
+data of experiments.
+
+### Configs
+
+Contains the configurations for the applications in the environment.
+They will be copied and adjusted once an experiment is started.
+
diff --git a/additional/.gitignore b/additional/.gitignore
new file mode 100644
index 0000000..2af3b6f
--- /dev/null
+++ b/additional/.gitignore
@@ -0,0 +1,2 @@
+plotter
+*.tar.gz
diff --git a/additional/README.md b/additional/README.md
new file mode 100644
index 0000000..9688bc0
--- /dev/null
+++ b/additional/README.md
@@ -0,0 +1,9 @@
+# Additional Resources for Experiments
+
+## plot.sh
+
+Create png plots from the grafana experiment dashbaords using [Grafan
Dashboard Plotter](https://github.com/bossm8/grafana-dashboard-plotter).
+
+## configs
+
+Contains configurations and examples for additional resources needed which are
not located inside the grid.
diff --git a/additional/config.yaml b/additional/config.yaml
new file mode 100644
index 0000000..59ef113
--- /dev/null
+++ b/additional/config.yaml
@@ -0,0 +1,19 @@
+grafana:
+ admin_api_key: ${ADMIN_API_KEY}
+ base_url: ${BASE_URL}
+ default_time_range: 14400 # 4 hours
+ tls_verify: false
+
+dashboards:
+ - uid: 83vvgKKnk # Transacions
+ - uid: 2FTtdeOnk # Database
+ variables: ['db', 'instance']
+ - uid: MsjffzSZz # Proxy
+ - uid: WcfSXqDnk # Request Statistics
+ variables: ['endpoint']
+ - uid: rYdddlPWk # Nodes
+ variables: ['node']
+
+prometheus:
+ node_exporter_job_name: nodes
+
diff --git a/additional/configs/bind/named.conf.local
b/additional/configs/bind/named.conf.local
new file mode 100644
index 0000000..929caca
--- /dev/null
+++ b/additional/configs/bind/named.conf.local
@@ -0,0 +1,13 @@
+key "ddns-key.perf.taler" {
+ algorithm hmac-sha256;
+ secret "<SOME_SECRET_KEY>
+};
+
+zone "perf.taler" {
+ type master;
+ file "/var/lib/bind/perf.taler";
+ update-policy {
+ grant ddns-key.perf.taler subdomain perf.taler. ANY;
+ };
+};
+
diff --git a/additional/configs/bind/named.conf.options
b/additional/configs/bind/named.conf.options
new file mode 100644
index 0000000..22f11c1
--- /dev/null
+++ b/additional/configs/bind/named.conf.options
@@ -0,0 +1,19 @@
+acl grid5000 {
+ 194.254.60.35;
+ 194.254.60.13;
+ 127.0.0.0/8;
+};
+
+options {
+ directory "/var/cache/bind";
+
+ allow-query { grid5000; };
+ allow-update { grid5000; };
+
+ dnssec-validation auto;
+
+ rrset-order { order random; };
+
+ listen-on-v6 { any; };
+};
+
diff --git a/additional/configs/bind/perf.taler
b/additional/configs/bind/perf.taler
new file mode 100644
index 0000000..ab36c57
--- /dev/null
+++ b/additional/configs/bind/perf.taler
@@ -0,0 +1,12 @@
+$ORIGIN .
+$TTL 60 ; 1 minute
+perf.taler IN SOA ns1.perf.taler. admin.perf.taler. (
+ 202112574 ; serial
+ 604800 ; refresh (1 week)
+ 86400 ; retry (1 day)
+ 2419200 ; expire (4 weeks)
+ 604800 ; minimum (1 week)
+ )
+ NS ns1.perf.taler.
+$ORIGIN perf.taler.
+ns1 A 127.0.0.1
diff --git a/additional/configs/grafana/tbd b/additional/configs/grafana/tbd
new file mode 100644
index 0000000..e69de29
diff --git a/additional/env b/additional/env
deleted file mode 100644
index 5648591..0000000
--- a/additional/env
+++ /dev/null
@@ -1,4 +0,0 @@
-API_KEY=
-BASE_URL=
-DASHBOARDS=
-OUTPUT_DIR=
diff --git a/additional/plot.sh b/additional/plot.sh
new file mode 100755
index 0000000..cfac7cf
--- /dev/null
+++ b/additional/plot.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Create plots from the grafana dashboard
+set -eu
+
+PLOTTER_DIR=plotter
+
+source ../experiment/.env
+
+if [ ! -d ${PLOTTER_DIR} ]; then
+ git clone https://github.com/bossm8/grafana-dashboard-plotter.git
${PLOTTER_DIR}
+fi
+
+cd ${PLOTTER_DIR} && git pull
+
+if [ ! -d venv ]; then
+ python3 -m venv venv
+fi
+source venv/bin/activate
+pip install -r requirements.txt
+
+if [ ! -f config.yaml ]; then
+ sed -e "s|\${ADMIN_API_KEY}|${GRAFANA_API_KEY}|g" \
+ -e "s|\${BASE_URL}|${GRAFANA_HOST}|g" \
+ ../config.yaml > config.yaml
+fi
+
+set +u
+
+TO=${TO:-$(date +%s)}
+
+if [ -z "${FROM}" ]; then
+ python3 plots.py --to=${TO}
+else
+ python3 plots.py --from=${FROM} --to=${TO}
+fi
+
+tar -czvf ../plots-${TO}.tar.gz plots
+
+rm -rf plots
diff --git a/additional/plots.sh b/additional/plots.sh
deleted file mode 100755
index 3655853..0000000
--- a/additional/plots.sh
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/bin/bash
-set -e
-source .env
-
-## export FROM=$(date +%s) | default now-1h
-## TO=$(date +%s) ./plot.sh | default now
-
-DRYRUN=$1
-AUTH_HEADER="Authorization: Bearer ${API_KEY}"
-
-function request_png() {
- CURL_ARGS="--data-urlencode orgId=1
- --data-urlencode panelId=${PANEL_ID}
- --data-urlencode theme=light
- --data-urlencode from=${FROM:-now-1h}
- --data-urlencode to=${TO:-now}"
-
- VAR1=$(echo ${VAR1} | sed -e 's/[^A-Za-z0-9._-]//g')
- VAR2=$(echo ${VAR2} | sed -e 's/[^A-Za-z0-9._-]//g')
-
-
FILE="${OUTPUT_DIR:-plots}/${DASH_SLUG}/${VAR1:-${VAR2:-}}/${VAR2:-}/${PANEL_NAME}.png"
-
- echo "Output: $FILE"
- if [ -z "${DRYRUN}" ]; then
- curl -G \
- -k -g \
- -H "${AUTH_HEADER}" \
- -H "Accept: application/json" \
- ${CURL_ARGS} \
- ${ADD_CURL_ARGS} \
- --create-dirs \
- --output "$FILE" \
- "${BASE_URL}/render/d-solo/${DASHBOARD}/${DASH_SLUG}"
- fi
-}
-
-function handle_dashboard() {
- DASH_JSON=$(\
- curl -X GET -k \
- -H "${AUTH_HEADER}" \
- -H "Accept: application/json" \
- "${BASE_URL}/api/dashboards/uid/${DASHBOARD}"
- )
-
- readarray -t PANELS < <(\
- echo ${DASH_JSON} | jq -c '.dashboard.panels[] | select(.type != "row")'
- )
- echo -e "\n\nPanels:\n"
- echo ${PANELS[@]} | jq -r '.title'
-
- DASH_SLUG=$(\
- echo ${DASH_JSON} | jq -r '.meta.slug'
- )
- echo -e "\n\nDashboard Slug:\n"
- echo ${DASH_SLUG}
-
- DASH_VARIABLES=$(\
- echo ${DASH_JSON} | jq -rc --arg regex $VAR_REGEX \
- '.dashboard.templating.list[] |
- select( .name | test($regex)) |
- {
- name: .name,
- values: [
- .options[] | select(.value | test("__all") | not) | .value
- ]
- }' | jq -s '.'
- )
- echo -e "\n\nDashboard Variables:\n"
- echo ${DASH_VARIABLES} | jq -rcM '.[] | .name, .values'
- echo -e "\n"
-
- VAR1_NAME=$(jq -r '.[0].name' <<< "${DASH_VARIABLES}")
- VAR2_NAME=$(jq -r '.[1].name' <<< "${DASH_VARIABLES}")
-
- for PANEL in "${PANELS[@]}"; do
-
- PANEL_NAME=$(jq -r '.title' <<< "${PANEL}" | tr 'A-Z' 'a-z' | tr -cs
'a-z0-9\n' '-')
- PANEL_ID=$(jq '.id' <<< "${PANEL}")
- PANEL_EXPR=$(jq -r 'select( .targets != null ) | .targets[].expr' <<<
"${PANEL}")
-
- if echo ${PANEL_EXPR} | grep -q "${VAR1_NAME}"; then
- DO_ARG1="true"
- else
- DO_ARG1="false"
- fi
- if echo ${PANEL_EXPR} | grep -q "${VAR2_NAME}"; then
- DO_ARG2="true"
- else
- DO_ARG2="false"
- fi
-
- if [[ "$DO_ARG1" == "false" && "$DO_ARG2" == "false" ]]; then
- request_png
- elif [[ "$DO_ARG1" == "false" ]]; then
- for VAR2 in $(jq -r '.[1].values[]' <<< "${DASH_VARIABLES}"); do
- ADD_CURL_ARGS="--data-urlencode var-${VAR2_NAME}=${VAR2}"
- request_png
- done
- elif [[ "$DO_ARG2" == "false" ]]; then
- for VAR1 in $(jq -r '.[0].values[]' <<< "${DASH_VARIABLES}"); do
- ADD_CURL_ARGS="--data-urlencode var-${VAR1_NAME}=${VAR1}"
- request_png
- done
- else
- for VAR1 in $(jq -r '.[0].values[]' <<< "${DASH_VARIABLES}"); do
- _ADD_CURL_ARGS="--data-urlencode var-${VAR1_NAME}=${VAR1}"
- for VAR2 in $(jq -r '.[1].values[]' <<< "${DASH_VARIABLES}"); do
- ADD_CURL_ARGS="${_ADD_CURL_ARGS} --data-urlencode
var-${VAR2_NAME}=${VAR2}"
- request_png
- done
- done
- fi
-
- done
-
- VAR1=""
- VAR2=""
-}
-
-IFS=';' read -ra _DASHBOARDS <<< "${DASHBOARDS}"
-for D in "${_DASHBOARDS[@]}"; do
- IFS=':' read -r DASHBOARD VARIABLES <<< "${D}"
- DASHBOARD=$(echo $DASHBOARD | cut -d " " -f 1)
-
- echo "Handling Dashboard: $DASHBOARD"
- read -ra VARIABLES <<< "${VARIABLES}"
-
- if [ "${#VARIABLES[@]}" -gt 2 ]; then
- echo "Currently only two dashboard variables are supported"
- exit 1
- fi
- VAR_REGEX="(${VARIABLES[0]:-^$}|${VARIABLES[1]:-^$})"
-
- handle_dashboard &
-done
-
-wait
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 360c400..8805d3e 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -25,6 +25,7 @@ RUN apt update && \
libidn2-dev \
libunistring-dev \
libmicrohttpd-dev \
+ libextractor-dev \
libsqlite3-dev \
libqrencode-dev \
pkg-config \
diff --git a/docker/README.md b/docker/README.md
index bcccae7..0e7b579 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -30,6 +30,9 @@ docker run -it --rm \
taler:build <ARGUMENTS>
```
+**NOTE** about the port 5900, this one can be used for vncviewer to see whats
happening inside the image which
+will be created. Run `vncviewver :0`.
+
### docker-compose
Assuming an env file `.env` with the following contents:
@@ -51,23 +54,27 @@ Or place the password (also arguments) in .env too but make
sure its protected.
#### Environment Variables
-**GRID5K_USER`**: the user which `GRID5K_CERT` belongs to
+**GRID5K_USER**: the user which `GRID5K_CERT` belongs to
**GRID5K_CERT**: the certificate which is used to login to the Grid5000 nodes
(docker-compose only)
**GRID5K_CERT_PASSWD**: the password to decrypt `GRID5K_CERT`
-**GRID5K_DEST**: comma separated list of where to copy the image to in the
grid (lille,lyon)
+**GRID5K_DEST**: comma separated list of where to copy the image to in the
grid (default: lille,lyon)
**ARGUMENTS**: args to pass to entrypoint, one of
-c|--clean (run make clean)
-r|--rebuild (rebuild the image - automatically set if -c is used)
-n|--no-copy (do not copy the generated image to Grid5000 - make sure output
volume is mounted)
+ -v|--verbose (enable verbose logging)
As per default, running the docker command again will not clean or rebuild
the image
##### Additional
-**GNUNET_COMMIT_SHA**: Which commit to use of gnunet (master)
-**EXCHANGE_COMMIT_SHA**: Which commit to use of taler-exchange (master)
-**MERCHANT_COMMIT_SHA**: Which commit to use of taler-merchant (master)
-**WALLET_COMMIT_SHA**: Which commit to use of wallet-core (master)
-**GRID5K_COMMIT_SHA**: Which commit to use of this repo (master)
+**GNUNET_COMMIT_SHA**: Which commit to use of gnunet
+**EXCHANGE_COMMIT_SHA**: Which commit to use of taler-exchange
+**MERCHANT_COMMIT_SHA**: Which commit to use of taler-merchant
+**WALLET_COMMIT_SHA**: Which commit to use of wallet-core
+**GRID5K_COMMIT_SHA**: Which commit to use of this repo
+
+These are listed explicitely in the docker-compose.yml and not via
environments.
+All of them default to master if they are not present in the compose or via
environment.
#### VNC
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index a99ef00..2862722 100644
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -19,6 +19,11 @@ while [[ $# -gt 0 ]]; do
echo "INFO will not copy image to Grid5000"
shift
;;
+ -v|--verbose)
+ VERBOSE=true
+ echo "INFO verbose output enabled"
+ shift
+ ;;
*)
shift
;;
@@ -29,10 +34,33 @@ TALER_HOME=/taler
function prepare() {
cd "${TALER_HOME}/$1"
- git checkout master > /dev/null && git pull > /dev/null 2>&1
+ git checkout master > /dev/null && (git pull > /dev/null 2>&1 || true)
git checkout "$2" > /dev/null && (git pull > /dev/null 2>&1 || true)
}
+function _make() {
+ echo "INFO running bootstrap and configure"
+ if ! ./bootstrap > bootstrap.log 2>&1; then
+ echo "ERROR bootstrap failed"
+ cat bootstrap.log
+ exit 1
+ fi
+ if [ -f contrib/gana.sh ]; then
+ ./contrib/gana.sh > gana.log 2>&1
+ fi
+ if ! (./configure --enable-logging=verbose --prefix=/usr > configure.log
2>&1 || \
+ ./configure > configure.log 2>&1); then
+ echo "ERROR configure failed"
+ cat configure.log
+ exit 1
+ fi
+ if [ "$VERBOSE" = true ]; then
+ cat bootstrap.log || true
+ cat gana.log || true
+ cat configure.log || true
+ fi
+}
+
function build() {
prepare "$1" "$2"
if [ "$CLEAN" = true ]; then
@@ -40,18 +68,7 @@ function build() {
make clean > /dev/null 2>&1 || true
fi
if ! make > /dev/null 2>&1; then
- echo "INFO running bootstrap and configure"
- if ! ./bootstrap > bootstrap.log 2>&1; then
- echo "ERROR bootstrap failed"
- cat bootstrap.log
- exit 1
- fi
- if ! (./configure --enable-logging=verbose --prefix=/usr > configure.log
2>&1 || \
- ./configure > configure.log 2>&1); then
- echo "ERROR configure failed"
- cat configure.log
- exit 1
- fi
+ _make
fi
if [ ! -z "$3" ]; then
echo "INFO running custom command '$3'"
@@ -63,6 +80,9 @@ function build() {
cat dist.log
exit 1
fi
+ if [ "$VERBOSE" = true ]; then
+ cat dist.log || true
+ fi
}
function install() {
@@ -77,6 +97,9 @@ function install() {
fi
ldconfig
fi
+ if [ "$VERBOSE" = true ]; then
+ cat install.log || true
+ fi
}
if [ "$COPY" != false ];
diff --git a/experiment/README b/experiment/README
deleted file mode 100644
index 0f42e98..0000000
--- a/experiment/README
+++ /dev/null
@@ -1,21 +0,0 @@
-All files needed to run the experiment can be found inside the jfed/ directory:
- * experiment-specitication.yml: espec to run the experiment
- * taler-perf.rspec: boots nodes based on the omnibus image into grid5000
- * env: template file to add enviroment variables needed for the experiment
-
-Steps:
- * cp env .env
- * edit .env and define the specified variables
- * DNS_HMAC_SHA256 can be generated with tsig-keygen from bind9 package (use
the secret only)
- * Start jFed Experimenter GUI
- * Load infra.rspec and click Run
- * Specify the experiment name and time
- * Wait until infra.rspec is allocated successfully
- * Configure .env and set the hosts (maybe this can be fixed once we can use
one rspec only)
- * Click (Re)Run ESpec for the infra job (use the type Directory and select
this directory (experiment))
- * Load wallets.rspec into jFed and click Run
- * Click (Re)Run ESpec for the wallets job (type directory)
- * Run `talet-perf update prometheus` on any deployed node
-
-To add more wallet processes run `taler-perf start wallets <NUM>` on any node
-
diff --git a/experiment/README.md b/experiment/README.md
new file mode 100644
index 0000000..1260dea
--- /dev/null
+++ b/experiment/README.md
@@ -0,0 +1,50 @@
+# Experiment Setup
+
+## Files
+
+* experiment-specitication.yml: [ESpec](https://jfed.ilabt.imec.be/espec/) for
jFed
+* infra.rspec: Contains all nodes for the Taler infrastructure
+* wallets.rspec: Contains a set of nodes for wallets
+* env: template file to add enviroment variables needed for the experiment
+* scripts: Bash scripts which will be run in the experiment
+
+## Run an Experiment
+
+To successfully run an experiment the following steps must be made:
+
+**NOTE** Two external nodes are required to run this experiment:
+ * Bind9 DNS server with the Zone specified in `.env` - example config
can be found in `additional`
+ * Grafana instance with Taler Performance Dashboards - dashboards can
be found in `additional`
+ Install instructions can be found on
[grafana.com](https://grafana.com/docs/grafana/latest/installation/)
+ Once installed, two datasources must be added - Prometheus and
Loki, they will be updated from the experiment
+
+* Copy the environment default configuration `env` to `.env`
+* Read through `.env` and define the missing variables
+* Start jFed Experimenter GUI
+* Load infra.rspec and click Run
+* Specify the experiment name and time
+* Wait until infra.rspec is allocated successfully
+* Configure `.env` and set the hosts - the allocated nodes can be found in the
tab `RSpec Viewer`
+ (this can be fixed once we can use one rspec only)
+* Wait until the nodes are ready
+* Click (Re)Run ESpec for the infra job (use the type Directory and select
this directory (experiment))
+* Load wallets.rspec into jFed and click Run
+* Click (Re)Run ESpec for the wallets job (type directory)
+* Run `talet-perf update prometheus` on any deployed node to make prometheus
aware of the freshly added wallets
+
+**NOTE** If for some reason the espec needs to be rerun, all uploaded files
need to be deleted currently.
+ This can be achieved on all nodes by pressing `Multi Command` and
specifying the command:
+ `rm -rf scripts .env`
+
+## Actions in running Experiment
+
+To add more exchange processes run `taler-perf stop ecxchange <NUM>` on any
node
+To add more wallet processes run `taler-perf start wallet <NUM>` on any node
+
+They can also be stopped in the same way: `taler-perf stop <KIND> <NUM>`
+To stop the wallet processes which are logging, specify `taler-perf stop
wallet logging`, they will not
+be stopped otherwise.
+
+## Notes
+
+Hopefully the bind dns gets useless once the experiment can be run in one
espec.
diff --git a/experiment/env b/experiment/env
index e0512d8..81cfdeb 100644
--- a/experiment/env
+++ b/experiment/env
@@ -1,54 +1,76 @@
- BANK_HOSTS=nova-*.*
-DATABASE_HOSTS=gros-*.*
-EXCHANGE_HOSTS=grcinq-*.*
-MERCHANT_HOSTS=grvingt-*.*
- MONITOR_HOSTS=econome-*.*
- PROXY_HOSTS=grappe-*.*
- WALLET_HOSTS=uvb-*.*
+# Place hosts which are allocated by jFed here
+# They can be found in the tab 'RSpec Viewer'
+# Once the allocation bug is fixed these configurations
+# will be removed.
+# Wallet hosts can be specified as a wildcard only since
+# all other hosts are matched before.
+ BANK_HOSTS=dahu-x.*
+DATABASE_HOSTS=dahu-y.*
+EXCHANGE_HOSTS=dahu-z.*
+MERCHANT_HOSTS=grvingt-x.*
+ MONITOR_HOSTS=econome-y.*
+ PROXY_HOSTS=dahu-u.*
+ WALLET_HOSTS=*
DNS_HOST=taler.net
DNS_ZONE=perf.taler
+# The key to update the dns zone dynamically, base64 encoded.
+# Can be generated with tsig-keygen from bind9 package (make sure the dns
server knows about it)
+DYNDNS_KEY=
+# These values specify the domain names for
+# the nodes, they most certain do not need to be adjusted.
+# DO NOT change wallet domain, since this is currently needed
+# for cleardns.sh
BANK_DOMAIN=bank.perf.taler
DATABASE_DOMAIN=db.perf.taler
EXCHANGE_DOMAIN=exch.perf.taler
MERCHANT_DOMAIN=merch.perf.taler
MONITOR_DOMAIN=monitor.perf.taler
PROXY_DOMAIN=proxy.perf.taler
+ WALLET_DOMAIN=wallet.*.perf.taler
-# Wallet domain is also needed for cleardns.sh
-WALLET_DOMAIN=wallet.x.perf.taler
-
+# Arguments to pass to taler-exchange-* binaries at startup.
EXCHANGE_ARGS="-L INFO"
+# Datasource names registered in the grafana instance
PROMETHEUS_DATASOURCE_NAME=Prometheus
LOKI_DATASOURCE_NAME=Loki
+# Grid5000 Proxy ports where the datasources are reachable for grafana.
+# These values most certain do not need to be adjusted, unless their
+# config in ../configs/etc/* is changed.
+# Doc: https://www.grid5000.fr/w/HTTP/HTTPs_access
PROMETHEUS_G5K_PROXY_PORT=http8080
LOKI_G5K_PROXY_PORT=http
+# Exchange database configuration
DB_NAME=taler-exchange
DB_USER=taler
DB_PASSWORD=
-NUM_WALLET_HOSTS=3
-
-# Initial number of wallets to start in parallel per host
-# This is a bulk size
-# running ./root/scripts/wallet.sh again will start another bulk
-# default = 10
-# Start another bunch with ./wallet.sh <NUN>
+# Initial number of wallets to start in parallel per host.
+# This is a bulk size with default = 10
+# Start another bunch with `taler-perf start wallet <N>`
NUM_WALLET_PROCESSES=10
-# Initial number of exchange processes to run
+# Initial number of exchange processes to run.
# default = 10
-# Start another bunch with ./exchange.sh <NUM> AND ./proxy.sh <NUM>
+# Start another bunch with `taler-perf start exchange <N>`
NUM_EXCHANGE_PROCESSES=1
+
+# Number of wirewatch processes to run
+# This setting is static, default = 1
NUM_WIREWATTCH_PROCESSES=1
# If prometheus node exporter should be enabled
+# Most certainly this is true, since otherwise no overview
+# of services and running wallets can be generated in grafana.
ENABLE_EXPORTERS=true
-DYNDNS_KEY=
-GRAFANA_HOST=
+# Host where grafana is reachable assuming including scheme and port.
+GRAFANA_HOST="https://147.87.255.221:3000"
+# API key for grafana
+# Needs admin level since datasources need to be updated.
+# This can be generated by a grafana admin in 'Configuration->API keys->Add
API key'
GRAFANA_API_KEY=
diff --git a/experiment/experiment-specification.yml
b/experiment/experiment-specification.yml
index 11f8e3f..7f68075 100644
--- a/experiment/experiment-specification.yml
+++ b/experiment/experiment-specification.yml
@@ -3,17 +3,17 @@ rspec:
- bundled: infra.rspec
upload:
- bundled: .env
+ permission: "664"
- bundled: scripts
- permission: "774"
- - bundled: taler-perf.sh
- permission: "700"
+ path: ~/scripts
+ permission: "775"
# Contains information about allocated nodes
- meta: experiment-info.json
execute:
# Setup DNS and Environment config
- - bundled: setup.sh
+ - path: ~/scripts/setup.sh
# Clear the DNS-Zone
- - bundled: cleardns.sh
+ - path: ~/scripts/cleardns.sh
nodes: [Exchange]
# Execute node specific code
- - bundled: run.sh
+ - path: ~/scripts/run.sh
diff --git a/experiment/cleardns.sh b/experiment/scripts/cleardns.sh
similarity index 81%
rename from experiment/cleardns.sh
rename to experiment/scripts/cleardns.sh
index 3d52bec..b30cde2 100644
--- a/experiment/cleardns.sh
+++ b/experiment/scripts/cleardns.sh
@@ -2,7 +2,7 @@
# Clears the DNS server for the new experiment
set -eux
-source .env
+source ~/.env
source ~/scripts/helpers.sh
function del_ddn() {
@@ -19,15 +19,15 @@ dig -t AXFR ${DNS_ZONE} ${DNS_HOST}
# Delete all old dns entries of the previous experitment
while IFS='=' read -r NAME VALUE; do
if [[ "${NAME}" == *"_DOMAIN" ]] && [[ "${VALUE}" == *".${DNS_ZONE}" ]];
then
- if [[ "${VALUE}" == "wallet"* ]]; then
+ if [[ "${VALUE}" =~ "${WALLET_DOMAIN}" ]]; then
for WALLET in $(get_wallet_domains); do
- del_ddn "wallet.${WALLET}.${DNS_ZONE}"
+ del_ddn "${WALLET_DOMAIN//\*/${WALLET}}"
done
else
del_ddn "${VALUE}"
fi
fi
-done < .env
+done < ~/.env
dig -t AXFR ${DNS_ZONE} ${DNS_HOST}
diff --git a/experiment/scripts/exchange.sh b/experiment/scripts/exchange.sh
index 6a7656a..c27399c 100755
--- a/experiment/scripts/exchange.sh
+++ b/experiment/scripts/exchange.sh
@@ -39,7 +39,8 @@ then
taler-exchange-offline upload < acct-res.json
taler-exchange-offline upload < fee-res.json
- let "NUM_WIREWATCH_PROCESSES-=1"
+ # || true is needed since when 1-1 is run let returns an error
+ let "NUM_WIREWATCH_PROCESSES-=1" || true
for i in $(seq ${NUM_WIREWATCH_PROCESSES});
do
systemctl restart taler-exchange-wirewatch@${i}.service
@@ -53,7 +54,7 @@ RUNNING=$(ps -aux | grep "[taler]-exchange-httpd" | wc -l)
for i in $(seq ${NUM_PROCESSES});
do
- let "i+=${RUNNING}-1"
+ let "i+=${RUNNING}-1" || true
let "i+=10000"
systemctl restart taler-exchange-httpd@"${i}".socket
taler-exchange-httpd@"${i}".service
done
diff --git a/experiment/scripts/monitor.sh b/experiment/scripts/monitor.sh
index 0b15817..16c7199 100755
--- a/experiment/scripts/monitor.sh
+++ b/experiment/scripts/monitor.sh
@@ -6,7 +6,7 @@ source ~/scripts/helpers.sh
if [[ "$1" == "init" ]];
then
AUTH_HEADER="Authorization: Bearer ${GRAFANA_API_KEY}"
- GRAFANA_API="https://$(host ${GRAFANA_HOST} | sed -n 1p | awk '{print
$4}'):3000/api"
+ GRAFANA_API="${GRAFANA_HOST}/api"
if ! curl -k -f -H "${AUTH_HEADER}" \
"${GRAFANA_API}/datasources" \
diff --git a/experiment/run.sh b/experiment/scripts/run.sh
similarity index 99%
rename from experiment/run.sh
rename to experiment/scripts/run.sh
index 85414fe..8ecc77c 100644
--- a/experiment/run.sh
+++ b/experiment/scripts/run.sh
@@ -3,7 +3,7 @@
set -euax
# They start the scripts with /bin/bash -c
-source .env
+source ~/.env
# Set a dynamic domain name in our own dns
# argument: the domain to be added
diff --git a/experiment/setup.sh b/experiment/scripts/setup.sh
similarity index 86%
rename from experiment/setup.sh
rename to experiment/scripts/setup.sh
index 4655a9e..48f5457 100644
--- a/experiment/setup.sh
+++ b/experiment/scripts/setup.sh
@@ -2,10 +2,10 @@
# Setup nodes for the experiment
set -euax
-source .env
+source ~/.env
# Add the environment config for following shells
-cat .env | tee -a /etc/environment
-echo "G5K_USER=$(cat experiment-info.json | jq -r '.user.name')" >>
/etc/environment
+cat ~/.env | tee -a /etc/environment
+echo "G5K_USER=$(cat ~/experiment-info.json | jq -r '.user.name')" >>
/etc/environment
G5K_HOME=/root/taler/grid5k
@@ -51,8 +51,8 @@ fi
systemctl daemon-reload
systemctl restart dnsmasq
-if [ -f ~/taler-perf.sh ]; then
- mv ~/taler-perf.sh /usr/local/bin/taler-perf
+if [ -f ~/scripts/taler-perf.sh ]; then
+ mv ~/scripts/taler-perf.sh /usr/local/bin/taler-perf
fi
exec ~/scripts/createusers.sh
diff --git a/experiment/taler-perf.sh b/experiment/scripts/taler-perf.sh
similarity index 100%
rename from experiment/taler-perf.sh
rename to experiment/scripts/taler-perf.sh
diff --git a/image/README.md b/image/README.md
new file mode 100644
index 0000000..6cc5523
--- /dev/null
+++ b/image/README.md
@@ -0,0 +1,53 @@
+# Grid5000 Environment creation
+
+Official documentation can be found on these links:
+
+* [Grid5000
Environment](https://www.grid5000.fr/w/Environments_creation_using_Kameleon_and_Puppet)
+* [Grid5000 Kadeploy](https://www.grid5000.fr/w/Advanced_Kadeploy)
+* [Kameleon Documentation](http://kameleon.imag.fr/grid5000_tutorial.html)
+
+## Manual Build
+
+### Prerequisites
+
+To build the image, the following repositories need to be added as dist
archives in
+`grid5000/steps/data`
+
+* [gnunet](https://git.gnunet.org/gnunet.git): gnunet.tar.gz
+* [taler-exchange](https://git.taler.net/exchange.git): exchange.tar.gz
+* [taler-merchant](https://git.taler.net/merchant.git): merchant.tar.gz
+* [taler-wallet-core](https://git.taler.net/wallet-core.git): wallet.tar.gz
+
+Replace `<G5K_USER> `and `<G5K_HOST>` in `taler-debian11.yaml` in the
following line:
+`g5k_tar_path:
"http://public.<G5K_HOST>.grid5000.fr/~<G5K_USER>/taler-debian11.tar.zst"`
+
+**G5K_USER**: Your Grid5000 username.
+**G5K_HOST**: The host where the image will be copied to in the last step.
+
+Alternatively they can be replaced after the build in
`build/taler-debian11/taler-debian11.dsc`
+
+### Build
+`kameleon build taler-debian11`
+
+**NOTE** Make sure that all dependencies listed in Grid5000 Environments are
installed
+
+### Deploy
+
+Copy the image to a Grid5000 node:
+
+```bash
+cd build/taler-debian11
+scp taler-debian11.* <G5K_USER>@access.grid5000.fr:<G5K_NODE>/public/
+```
+
+**NOTE** G5K_USER and G5K_HOST should match the ones in taler-debian11.yaml
+
+## Usage
+
+Place `http://public.lyon.grid5000.fr/~<G5K_USER>/taler-debian11.dsc` in the
nodes disk image field
+in jFed.
+
+## Automated Build
+
+The image build can be done automatically by using the docker image in
`../docker`.
+Please refer to the README in there for instructions.
diff --git a/notes.txt b/notes.txt
index d4200b4..d98530f 100644
--- a/notes.txt
+++ b/notes.txt
@@ -18,5 +18,8 @@
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
+* espec documentation incomplete and contains unknown key, exaple:
execute.local dir.sudo
+* espec dir creation does not work - hangs at Dir "null" Creations at ...
+* espec - possibility to rerun and override previously uploaded files
(directory type)
+* espec - states 'permissions' as keyword where it is really 'permission' only
* 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.
- [taler-grid5k] branch master updated (2554db5 -> d6cc557), gnunet, 2021/11/23
- [taler-grid5k] 01/16: add direcory type to readme, gnunet, 2021/11/23
- [taler-grid5k] 04/16: update readmes and plotter config, gnunet, 2021/11/23
- [taler-grid5k] 02/16: add script to create plots, gnunet, 2021/11/23
- [taler-grid5k] 09/16: dynamic dns zone, gnunet, 2021/11/23
- [taler-grid5k] 03/16: add plotting script and better documentation,
gnunet <=
- [taler-grid5k] 06/16: test with dns in grid, gnunet, 2021/11/23
- [taler-grid5k] 08/16: update bind config, gnunet, 2021/11/23
- [taler-grid5k] 07/16: update bind config, gnunet, 2021/11/23
- [taler-grid5k] 16/16: DNS included in experiment, gnunet, 2021/11/23
- [taler-grid5k] 05/16: fix env description, gnunet, 2021/11/23
- [taler-grid5k] 14/16: add merchant to prometheus, gnunet, 2021/11/23
- [taler-grid5k] 13/16: use global forwarders, gnunet, 2021/11/23
- [taler-grid5k] 12/16: move logs automatically to nfs, gnunet, 2021/11/23
- [taler-grid5k] 15/16: add check for DNS_HOST, gnunet, 2021/11/23
- [taler-grid5k] 11/16: switch to in experiment dns for simplicity, gnunet, 2021/11/23