From 0079f514e1c44d47d9c663d92b3e7bc857c9966f Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Sat, 28 Oct 2023 16:48:19 -0400 Subject: [PATCH] Add example rtb/tsung Dockerfiles, scripts, and configs --- contrib/rtb/Dockerfile | 24 ++++++ contrib/rtb/rtb.sh | 6 ++ contrib/rtb/rtb.yml | 52 ++++++++++++ contrib/tsung/Dockerfile | 11 +++ contrib/tsung/tsung.sh | 9 +++ contrib/tsung/tsung.starttls.works.xml | 107 +++++++++++++++++++++++++ contrib/tsung/tsung.xml | 102 +++++++++++++++++++++++ 7 files changed, 311 insertions(+) create mode 100644 contrib/rtb/Dockerfile create mode 100644 contrib/rtb/rtb.sh create mode 100644 contrib/rtb/rtb.yml create mode 100644 contrib/tsung/Dockerfile create mode 100644 contrib/tsung/tsung.sh create mode 100644 contrib/tsung/tsung.starttls.works.xml create mode 100644 contrib/tsung/tsung.xml diff --git a/contrib/rtb/Dockerfile b/contrib/rtb/Dockerfile new file mode 100644 index 0000000..feb7eed --- /dev/null +++ b/contrib/rtb/Dockerfile @@ -0,0 +1,24 @@ + +# build some things +FROM docker.io/library/debian:latest AS build + +RUN apt-get update && apt-get -y install gcc g++ make libexpat1-dev libyaml-dev \ + libssl-dev zlib1g-dev gnuplot-nox erlang-nox erlang-dev git && \ + mkdir -p /build/ && \ + git clone https://github.com/processone/rtb /build/ && rm -rf /build/rtb/.git && \ + chown -R nobody: /build/ && ls -lah /build/ && \ + cd /build/ && su -m -s /bin/bash nobody -c make && \ + find -type d -name .git -print0 | xargs -0 rm -rf && cp rtb.yml.xmpp.example rtb.yml + +FROM docker.io/library/debian:latest + +RUN apt-get update && apt-get -y install gnuplot-nox erlang-nox libyaml-0-2 && rm -rf /var/lib/apt/lists + +COPY --from=build /build/cert.pem /build/rtb.sh /build/rtb.yml /app/ +COPY --from=build /build/deps /app/deps +COPY --from=build /build/ebin /app/ebin +COPY --from=build /build/priv /app/priv +#COPY --from=build /build /app/all + +WORKDIR /app +ENTRYPOINT /app/rtb.sh diff --git a/contrib/rtb/rtb.sh b/contrib/rtb/rtb.sh new file mode 100644 index 0000000..666923d --- /dev/null +++ b/contrib/rtb/rtb.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set -eux + +podman build . -t rtb + +podman run --network host --rm -it -p 8080:8080 --volume $(pwd)/rtb.yml:/app/rtb.yml:ro rtb diff --git a/contrib/rtb/rtb.yml b/contrib/rtb/rtb.yml new file mode 100644 index 0000000..cc92cbb --- /dev/null +++ b/contrib/rtb/rtb.yml @@ -0,0 +1,52 @@ +### +### RTB configuration file +### +### The parameters used in this configuration file are explained at +### +### https://github.com/processone/rtb/blob/master/README.md +### +### The configuration file is written in YAML +### +### ******************************************************* +### ******* !!! WARNING !!! ******* +### ******* YAML IS INDENTATION SENSITIVE ******* +### ******* MAKE SURE YOU INDENT SECTIONS CORRECTLY ******* +### ******************************************************* +### + +### Mandatory options: common for all scenarios +scenario: xmpp +interval: 1 +capacity: 1 +certfile: cert.pem +debug: true + +### Mandatory options for XMPP scenario +jid: user%@example.org +password: pass% + +### Server addresses +### Optional, but highly recommended to set +### servers: +### - tcp://127.0.0.1:5222 +### - tcp://192.168.1.1:5222 + +servers: + - tcp://192.168.1.1:5222 + +### An HTTP port for the statistics web interface +### www_port: 8080 + +connect_timeout: 30 +reconnect_interval: 1 +sm: false +disconnect_interval: false + +starttls: false +proxy65_interval: false +http_upload_interval: false + +### Local Variables: +### mode: yaml +### End: +### vim: set filetype=yaml tabstop=8 diff --git a/contrib/tsung/Dockerfile b/contrib/tsung/Dockerfile new file mode 100644 index 0000000..af6ba29 --- /dev/null +++ b/contrib/tsung/Dockerfile @@ -0,0 +1,11 @@ + +# build some things +FROM docker.io/library/debian:latest + +RUN apt-get update && apt-get -y install tsung && rm -rf /var/lib/apt/lists + +RUN ln -sf /usr/lib/x86_64-linux-gnu/tsung/bin/* /usr/bin/ + +WORKDIR /root +ENTRYPOINT /usr/bin/tsung +CMD start diff --git a/contrib/tsung/tsung.sh b/contrib/tsung/tsung.sh new file mode 100644 index 0000000..cc46df1 --- /dev/null +++ b/contrib/tsung/tsung.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -eux + +podman build . -t tsung + +# podman run --rm --entrypoint tar tsung -C /usr/share/doc/tsung/examples -cf - . > tsungexamples.tar + +rm -rf tsung-logs; mkdir -p tsung-logs; podman run --network host --rm -it -p 8091:8091 --volume $(pwd)/tsung-logs:/root/.tsung/log --volume $(pwd)/tsung.xml:/root/.tsung/tsung.xml:ro --entrypoint tsung tsung start + diff --git a/contrib/tsung/tsung.starttls.works.xml b/contrib/tsung/tsung.starttls.works.xml new file mode 100644 index 0000000..a0e1b97 --- /dev/null +++ b/contrib/tsung/tsung.starttls.works.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/tsung/tsung.xml b/contrib/tsung/tsung.xml new file mode 100644 index 0000000..9d40baf --- /dev/null +++ b/contrib/tsung/tsung.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +