gnunet-svn
[Top][All Lists]
Advanced

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

[taler-grid5k] 86/189: -fixes -build libmicrohttpd from source


From: gnunet
Subject: [taler-grid5k] 86/189: -fixes -build libmicrohttpd from source
Date: Thu, 28 Apr 2022 10:47:36 +0200

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

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

commit 2c181f2b7800ce95dc05924348735ef23dfc15d9
Author: Boss Marco <bossm8@bfh.ch>
AuthorDate: Thu Mar 17 11:51:11 2022 +0100

    -fixes
    -build libmicrohttpd from source
---
 configs/etc/monitor/node-exporters.yaml.tpl |  2 +-
 configs/etc/nginx/sites-enabled/proxy       |  2 +-
 docker/Dockerfile                           |  3 +-
 docker/entrypoint.sh                        |  4 +++
 experiment/scripts/exchange.sh              |  4 +--
 experiment/scripts/monitor.sh               | 46 ++++++++++++++++-------------
 experiment/scripts/proxy.sh                 |  4 +--
 image/taler-debian11.yaml                   | 26 +++++++++++++---
 8 files changed, 59 insertions(+), 32 deletions(-)

diff --git a/configs/etc/monitor/node-exporters.yaml.tpl 
b/configs/etc/monitor/node-exporters.yaml.tpl
index 69ce5fb..fe8466b 100644
--- a/configs/etc/monitor/node-exporters.yaml.tpl
+++ b/configs/etc/monitor/node-exporters.yaml.tpl
@@ -51,4 +51,4 @@
     - labels:
         component: 'shard'
       targets:
-      # <SHARD_NODESS_HERE>
+      # <SHARD_NODES_HERE>
diff --git a/configs/etc/nginx/sites-enabled/proxy 
b/configs/etc/nginx/sites-enabled/proxy
index ae3ebde..7cc5f22 100644
--- a/configs/etc/nginx/sites-enabled/proxy
+++ b/configs/etc/nginx/sites-enabled/proxy
@@ -22,7 +22,7 @@ map $request_method $log_line {
 
 # Setup a cache with 1GB storage for our exchange
 # https://www.nginx.com/blog/nginx-caching-guide/
-proxy_cache_path /var/cache/proxy levels=1:2 keys_zone=exchange:1m inactive=1m 
max_size=10g;
+proxy_cache_path /var/cache/proxy levels=1:2 keys_zone=exchange:1m inactive=1m 
max_size=1g;
 
 server {
   listen 80;
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 738e307..a7d433d 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -31,8 +31,8 @@ RUN apt update && \
         libcurl4-gnutls-dev \
         libsodium-dev \
         libidn2-dev \
+        libgnutls28-dev \
         libunistring-dev \
-        libmicrohttpd-dev \
         libextractor-dev \
         libsqlite3-dev \
         libqrencode-dev \
@@ -68,6 +68,7 @@ RUN apt update && \
     gem install --no-document kameleon-builder
 
 RUN mkdir taler && cd taler && \
+    git clone https://git.gnunet.org/libmicrohttpd.git && \
     git clone https://git.gnunet.org/gnunet.git && \
     git clone https://git.taler.net/exchange.git && \
     git clone https://git.taler.net/merchant.git && \
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index b1f3eef..506af28 100644
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -102,6 +102,10 @@ then
              merchant_commit_sha:${MERCHANT_COMMIT_SHA} \
              wallet_commit_sha:${WALLET_COMMIT_SHA} \
             grid5k_commit_sha:${GRID5K_COMMIT_SHA} \
+            libmicrohttpd_cflags:${MICROHTTPD_CFLAGS:-"-O2"} \
+            gnunet_cflags:${GNUNET_CFLAGS:-"-O2"} \
+            exchange_cflags:${EXCHANGE_CFLAGS:-"-O2"} \
+            merchant_cflags:${MERCHANT_CFLAGS:-"-O2"} \
              g5k_user:${GRID5K_USER} \
        | tee build.log
   mv /tmp/taler-debian11 ${TALER_HOME}
diff --git a/experiment/scripts/exchange.sh b/experiment/scripts/exchange.sh
index cc70710..e7c7912 100755
--- a/experiment/scripts/exchange.sh
+++ b/experiment/scripts/exchange.sh
@@ -100,7 +100,7 @@ function init_secondary_exchange() {
 function start_exchanges() {
 
   let "START=$1+10000"
-  let "END=$START+$2"
+  let "END=$START+$2-1"
 
   for PORT in $(seq $START $END); do
     systemctl restart taler-exchange-httpd@"${PORT}".socket \
@@ -119,7 +119,7 @@ function stop_exchanges() {
 case $1 in
   init-primary)
     init_primary_exchange
-    start_exchanges "0" "$((${NUM_EXCHANGE_PROCESSES}-1))"
+    start_exchanges "1" "$((${NUM_EXCHANGE_PROCESSES}-1))"
     ;;
   init-secondary)
     init_secondary_exchange
diff --git a/experiment/scripts/monitor.sh b/experiment/scripts/monitor.sh
index a6a1467..5d79980 100755
--- a/experiment/scripts/monitor.sh
+++ b/experiment/scripts/monitor.sh
@@ -78,25 +78,6 @@ function configure_prometheus_and_exporters() {
           /etc/default/prometheus-nginx-exporter
 }
 
-# Add new exchanges to be monitored
-# $1: N - already running exchange processes
-# $2: N - processes to add
-function add_exchanges_to_prometheus() {
-
-  let "START=$1+10000"
-  let "END=$START+$2"
-
-  for PORT in $(seq $START $END); do
-    for HOST in $(get_exchange_hosts); do 
-      if ! grep -q "${EXCHANGE_DOMAIN//\*${HOST}}" 
/etc/monitor/prometheus.yaml;
-      then
-        sed -i "/<EXCHANGES_HERE>/a  \ \ \ \ \ \ - 
'${EXCHANGE_DOMAIN//\*${HOST}}:${PORT}'" \
-                /etc/monitor/prometheus.yaml
-      fi
-    done
-  done
-}
-
 # Add wallet nodes to be monitored
 # Requires no argument since wallet nodes are retrieved from the DNS
 function add_wallet_nodes_to_prometheus() {
@@ -133,6 +114,27 @@ function add_exchange_nodes_to_prometheus() {
   done
 }
 
+# Add new exchanges to be monitored
+# $1: N - already running exchange processes
+# $2: N - processes to add
+function add_exchanges_to_prometheus() {
+
+  let "START=$1+10000"
+  let "END=$START+$2-1"
+
+  HOSTS=$(get_exchange_hosts)
+
+  for PORT in $(seq $START $END); do
+    for HOST in $HOSTS; do 
+      if ! grep -q "${EXCHANGE_DOMAIN//\*/${HOST}}:${PORT}" 
/etc/monitor/prometheus.yaml;
+      then
+        sed -i "/<EXCHANGES_HERE>/a  \ \ \ \ \ \ - 
'${EXCHANGE_DOMAIN//\*/${HOST}}:${PORT}'" \
+                /etc/monitor/prometheus.yaml
+      fi
+    done
+  done
+}
+
 # Remove N exchanges which have been stopped
 # from the config so they will not be scraped anymore
 # $1: N - number of exchanges currently running
@@ -141,11 +143,13 @@ function remove_exchanges_from_prometheus() {
 
   # We know we started from port 10000
   # get the highest port numbers and start removing from there
-  let "START=$1+10000"
+  let "START=$1+10000-1"
   let "END=$START-$2"
 
+  HOSTS=$(get_exchange_hosts)
+
   for PORT in $(seq $START $END); do
-    for HOST in $(get_exchange_hosts); do
+    for HOST in $HOSTS; do
       sed -i "/${EXCHANGE_DOMAIN//\*/${HOST}}:${PORT}/d" \
               /etc/monitor/prometheus.yaml
     done
diff --git a/experiment/scripts/proxy.sh b/experiment/scripts/proxy.sh
index 783582e..1642981 100755
--- a/experiment/scripts/proxy.sh
+++ b/experiment/scripts/proxy.sh
@@ -22,7 +22,7 @@ source ~/scripts/helpers.sh
 function add_exchanges() {
 
   let "START=$1+10000"
-  let "END=$START+$2"
+  let "END=$START+$2-1"
 
   EXCHANGES=$(get_exchange_hosts)
 
@@ -102,7 +102,7 @@ function remove_exchanges() {
 
   # We know we started from port 10000
   # get the highest port numbers and start removing from there
-  let "START=$1+10000"
+  let "START=$1+10000-1"
   let "END=$START-$2"
 
   EXCHANGES=$(get_exchange_hosts)
diff --git a/image/taler-debian11.yaml b/image/taler-debian11.yaml
index b9bc71c..3eaa831 100644
--- a/image/taler-debian11.yaml
+++ b/image/taler-debian11.yaml
@@ -39,7 +39,7 @@ global:
   # g5k_kernel_params: ""
   ## Environment visibility
   # g5k_visibility: "shared"
-  taler_build_packages: "recutils autoconf uncrustify autopoint libtool 
python3-pip libgcrypt20-dev libjansson-dev libcurl4-gnutls-dev libsodium-dev 
libidn2-dev libunistring-dev libmicrohttpd-dev libsqlite3-dev libqrencode-dev 
valgrind libpq-dev texinfo gdb make npm zip python3-distutils pkg-config"
+  taler_build_packages: "recutils autoconf uncrustify autopoint libtool 
python3-pip libgcrypt20-dev libjansson-dev libcurl4-gnutls-dev libsodium-dev 
libidn2-dev libunistring-dev libgnutls28-dev libsqlite3-dev libqrencode-dev 
valgrind libpq-dev texinfo gdb make npm zip python3-distutils pkg-config"
   taler_packages: "nginx postgresql-13 postgresql-contrib curl jq bc sudo git 
zile dnsutils prometheus-postgres-exporter prometheus-nginx-exporter net-tools 
netcat parallel nodejs tshark dnsmasq bind9 systemd-coredump bash-completion 
pgbouncer pgstat"
   taler_packages_no_recommends: "prometheus prometheus-node-exporter 
prometheus-pgbouncer-exporter"
   taler_disable_services: "nginx postgresql prometheus 
prometheus-postgres-exporter prometheus-nginx-exporter prometheus-node-exporter 
named gettext-base dnsmasq prometheus-pgbouncer-exporter pgbouncer"
@@ -50,6 +50,10 @@ global:
   merchant_commit_sha: master
   wallet_commit_sha: master
   grid5k_commit_sha: master
+  libmicrohttpd_cflags: "-O2"
+  gnunet_cflags: "-O2"
+  exchange_cflags: "-O2"
+  merchant_cflags: "-O2"
   ## Other parameters can be changed, see kameleon info debian10-taler.yaml
 
 bootstrap:
@@ -78,6 +82,20 @@ setup:
 
          mkdir -p $${taler_path}
 
+    - microhttpd: 
+      - exec_in: |
+         cd $${taler_path} 
+
+         git clone https://git.gnunet.org/libmicrohttpd.git
+         cd libmicrohttpd
+
+         # We need sudo, otherwise we'll get a strange error
+         sudo ./bootstrap
+         CFLAGS="$${libmicrohttpd_cflags}" ./configure 
--enable-logging=verbose --prefix=/usr # --enable-sanitizer 
+         make || true
+         make install
+         ldconfig
+
     - gnunet: 
       - exec_in: |
          cd $${taler_path} 
@@ -89,7 +107,7 @@ setup:
 
          # We need sudo, otherwise we'll get a strange error
          sudo ./bootstrap
-         CFLAGS="-O2" ./configure --enable-logging=verbose --prefix=/usr 
--enable-poisoning=false # --enable-sanitizer 
+         CFLAGS="$${gnunet_cflags}" ./configure --enable-logging=verbose 
--prefix=/usr --enable-poisoning=false # --enable-sanitizer 
          make || true
          make install
          ldconfig
@@ -107,7 +125,7 @@ setup:
 
          # We need sudo, otherwise we'll get a strange error
          sudo ./bootstrap
-         CFLAGS="-O2 -D GRID5K_MARCO_OPT" ./configure --enable-logging=verbose 
--prefix=/usr # --enable-sanitizer
+         CFLAGS="$${exchange_cflags}" ./configure --enable-logging=verbose 
--prefix=/usr # --enable-sanitizer
          make || true
          make install
          ldconfig
@@ -123,7 +141,7 @@ setup:
 
          # We need sudo, otherwise we'll get a strange error
          sudo ./bootstrap
-         ./configure --enable-logging=verbose --prefix=/usr # 
--enable-sanitizer
+         CFLAGS="$${merchant_cflags}" ./configure --enable-logging=verbose 
--prefix=/usr # --enable-sanitizer
          make || true
          make install
          ldconfig

-- 
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]