summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2023-07-26 17:33:23 +0200
committerMS <ms@taler.net>2023-07-26 17:33:23 +0200
commit4b47817978479f5585f0774127658da577213725 (patch)
tree6b1c6ab58a67aff799987fd303503176bf5a7056
parent8771795796200155036eb6f96b7ef2d08af3618d (diff)
downloaddeployment-4b47817978479f5585f0774127658da577213725.tar.gz
deployment-4b47817978479f5585f0774127658da577213725.tar.bz2
deployment-4b47817978479f5585f0774127658da577213725.zip
NLnet task 5.
Sending taler-unified-setup to the background fixed.
-rw-r--r--nlnet/task5/performance/Dockerfile57
-rwxr-xr-x[-rw-r--r--]nlnet/task5/performance/start.sh33
2 files changed, 75 insertions, 15 deletions
diff --git a/nlnet/task5/performance/Dockerfile b/nlnet/task5/performance/Dockerfile
index 46eebdb..d0e1996 100644
--- a/nlnet/task5/performance/Dockerfile
+++ b/nlnet/task5/performance/Dockerfile
@@ -1,7 +1,33 @@
FROM debian:stable
RUN apt-get update
-RUN apt-get install -y openjdk-17-jre git python3-pip curl jq sqlite3 postgresql python3-requests python3-click sudo
+RUN apt-get install -y \
+ git \
+ openjdk-17-jre \
+ python3-pip \
+ curl \
+ jq \
+ postgresql \
+ python3-requests \
+ python3-click \
+ sudo \
+ time \
+ autoconf \
+ autopoint \
+ libtool \
+ texinfo \
+ libgcrypt-dev \
+ libidn11-dev \
+ zlib1g-dev \
+ libunistring-dev \
+ libjansson-dev \
+ recutils \
+ libsqlite3-dev \
+ libpq-dev \
+ libcurl4-openssl-dev \
+ libsodium-dev \
+ libqrencode-dev \
+ zip
# Installation
RUN git clone git://git.taler.net/libeufin
@@ -10,5 +36,34 @@ RUN git fetch && git checkout 4bc5f38f571a45d427f73813ec3846bf59413afa
RUN ./bootstrap
RUN ./configure --prefix=/usr/local
RUN make install
+WORKDIR /
+RUN git clone git://git.gnunet.org/libmicrohttpd
+WORKDIR /libmicrohttpd
+RUN ./bootstrap
+RUN ./configure --disable-doc
+RUN make install
+WORKDIR /
+RUN git clone git://git.gnunet.org/gnunet
+WORKDIR /gnunet
+RUN apt-get install -y python3-sphinx python3-sphinx-rtd-theme # Move up?
+RUN ./bootstrap
+RUN ./configure
+RUN pip3 install --break-system-packages htmlark
+RUN make install
+WORKDIR /
+RUN git clone git://git.taler.net/exchange
+WORKDIR /exchange
+RUN ./bootstrap
+RUN ./configure
+RUN make install
+WORKDIR /
+RUN git clone git://git.taler.net/merchant
+WORKDIR /merchant
+RUN ./bootstrap
+RUN ./configure
+RUN make install
+WORKDIR /
+
COPY start.sh /
+RUN apt-get install -y wget
ENTRYPOINT ["/start.sh"]
diff --git a/nlnet/task5/performance/start.sh b/nlnet/task5/performance/start.sh
index 317c52a..e2ae44a 100644..100755
--- a/nlnet/task5/performance/start.sh
+++ b/nlnet/task5/performance/start.sh
@@ -10,28 +10,34 @@
set -eux
+# trap -- 'echo nullified signal' SIGINT SIGTERM SIGTSTP
+
+service postgresql start
+sudo -u postgres createuser -s root
+createdb libeufincheck
+
# Converts AA:BB:CC.DDD to milliseconds.
convert_pg_time_to_ms () {
awk -F[.:] '{SECS=(60*60*$1)+(60*$2)+$3; MILLI=$4; TOTAL_MS=(SECS*1000)+MILLI; print TOTAL_MS}'
}
createdb talercheck
+export LD_LIBRARY_PATH=/usr/local/lib
prepare_and_run () {
- (taler-unified-setup.sh \
- -emwtns \
+ taler-unified-setup.sh \
+ -Wemtns \
-c /exchange/src/benchmark/benchmark-cs.conf \
- -u exchange-account-2 &> /check_ready.txt) &
-
+ -u exchange-account-2 &> /check_ready.txt &
# Wait that the prep. went through.
echo -n Waiting the unified setup to complete..
READY="NO"
for i in `seq 100` true; do
- if grep "<<READY>>" /check_ready.txt; then
+ if grep -q "<<READY>>" /check_ready.txt; then
READY="YES"
break
fi
- echo -n "."; sleep 0.5
+ echo -n "."; sleep 1
done
if test $READY = "YES"; then
@@ -41,7 +47,6 @@ prepare_and_run () {
echo FAIL
exit 1
fi
-
NEXUS_PID=$(cat /libeufin-nexus.pid)
SANDBOX_PID=$(cat /libeufin-sandbox.pid)
@@ -54,27 +59,27 @@ prepare_and_run () {
echo Could not find Sandbox PID, failing.
exit 1
fi
-
echo Running the benchmark..
taler-exchange-benchmark \
-c /exchange/src/benchmark/benchmark-cs.conf.edited \
- -u exchange-account-2 \ # Which exchange account to pick from the config.
+ -u exchange-account-2 \
-L WARNING \
- -n1 \ # How many coins per reserve.
- -r100 # How many reserves per client.
+ -n1 \
+ -r100
}
-/usr/bin/time -o /benchmark-wall-clock-time.txt --format=%e prepare_and_run
+export -f prepare_and_run
+/usr/bin/time -o /benchmark-wall-clock-time.txt --format=%e bash -c "prepare_and_run"
# Convert the wall clock time to milliseconds, to make
# it compatible with the format as GREPped through Postgres logs.
BENCHMARK_TOT_MS=$(awk -F. '{t=($1 * 1000 + $2 * 10)} END {print t}' /benchmark-wall-clock-time.txt)
NEXUS_LONGEST_DB_SESSION=$(grep disconnection < /var/log/postgresql/postgresql-14-main.log \
- | grep $NEXUS_PID | convert_pg_time_to_ms | sort | head -1)
+ | grep $NEXUS_PID | convert_pg_time_to_ms | sort | tail -1)
SANDBOX_LONGEST_DB_SESSION=$(grep disconnection < /var/log/postgresql/postgresql-14-main.log \
- | grep $SANDBOX_PID | convert_pg_time_to_ms | sort | head -1)
+ | grep $SANDBOX_PID | convert_pg_time_to_ms | sort | tail -1)
if test $NEXUS_LONGEST_DB_SESSION -gt $BENCHMARK_TOT_MS; then
echo Nexus had a DB session longer than the benchmark itself, failing.