From a96855108cec211ad44e5ac7f62643772db6def0 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Mon, 6 Mar 2023 14:26:14 -0500 Subject: [PATCH] Simple example of running pbench agent in a container We want to make it as easy for the user to do this as possible. The new `README.md` describes the steps, which are just running `./setup.sh` and executing `example-driver.sh`. --- contrib/containerized-pbench/.gitignore | 3 + contrib/containerized-pbench/README.md | 134 ++---------------- contrib/containerized-pbench/benchmark.sh | 23 --- .../dockerfiles/README.md | 14 -- .../dockerfiles/agent/Dockerfile | 27 ---- .../dockerfiles/agent/mount.sh | 6 - .../dockerfiles/agent/pbench.service | 10 -- .../dockerfiles/controller/Dockerfile | 36 ----- .../dockerfiles/controller/pbench.service | 11 -- .../dockerfiles/controller/run.sh | 46 ------ .../containerized-pbench/example-driver.sh | 45 ++++++ .../containerized-pbench/example-workload.sh | 19 +++ contrib/containerized-pbench/gen-token.sh | 9 ++ contrib/containerized-pbench/inventory | 16 --- .../containerized-pbench/keys/authorized_keys | 0 contrib/containerized-pbench/keys/config | 11 -- contrib/containerized-pbench/keys/id_rsa | 0 contrib/containerized-pbench/keys/id_rsa_perf | 0 contrib/containerized-pbench/mover.sh | 11 ++ .../pbench-agent-daemonset.yml | 51 ------- .../openshift-templates/pbench-namespace.yml | 6 - contrib/containerized-pbench/setup.sh | 27 ++++ contrib/containerized-pbench/vars | 12 -- 23 files changed, 124 insertions(+), 393 deletions(-) create mode 100644 contrib/containerized-pbench/.gitignore delete mode 100755 contrib/containerized-pbench/benchmark.sh delete mode 100644 contrib/containerized-pbench/dockerfiles/README.md delete mode 100644 contrib/containerized-pbench/dockerfiles/agent/Dockerfile delete mode 100755 contrib/containerized-pbench/dockerfiles/agent/mount.sh delete mode 100644 contrib/containerized-pbench/dockerfiles/agent/pbench.service delete mode 100644 contrib/containerized-pbench/dockerfiles/controller/Dockerfile delete mode 100644 contrib/containerized-pbench/dockerfiles/controller/pbench.service delete mode 100755 contrib/containerized-pbench/dockerfiles/controller/run.sh create mode 100755 contrib/containerized-pbench/example-driver.sh create mode 100755 contrib/containerized-pbench/example-workload.sh create mode 100755 contrib/containerized-pbench/gen-token.sh delete mode 100644 contrib/containerized-pbench/inventory delete mode 100644 contrib/containerized-pbench/keys/authorized_keys delete mode 100644 contrib/containerized-pbench/keys/config delete mode 100644 contrib/containerized-pbench/keys/id_rsa delete mode 100644 contrib/containerized-pbench/keys/id_rsa_perf create mode 100755 contrib/containerized-pbench/mover.sh delete mode 100644 contrib/containerized-pbench/openshift-templates/pbench-agent-daemonset.yml delete mode 100644 contrib/containerized-pbench/openshift-templates/pbench-namespace.yml create mode 100755 contrib/containerized-pbench/setup.sh delete mode 100644 contrib/containerized-pbench/vars diff --git a/contrib/containerized-pbench/.gitignore b/contrib/containerized-pbench/.gitignore new file mode 100644 index 0000000000..8fbb185f35 --- /dev/null +++ b/contrib/containerized-pbench/.gitignore @@ -0,0 +1,3 @@ +fiotest +*.tmp +var_lib_pbench-agent diff --git a/contrib/containerized-pbench/README.md b/contrib/containerized-pbench/README.md index 96f2087d45..3dfae2f383 100644 --- a/contrib/containerized-pbench/README.md +++ b/contrib/containerized-pbench/README.md @@ -1,124 +1,10 @@ -## Containerized pbench -This directory contains OpenShift templates, dockerfiles needed to build and run containerized pbench. - -### Prepare the nodes you want to monitor -The nodes need to have pbench-agent images on it. In case the nodes do not have the images, please pull them from dockerhub: - -#### pbench-agent -``` -$ docker pull ravielluri/image:agent -$ docker tag ravielluri/image:agent pbench-agent:latest -``` - -### Label the nodes with a type=pbench label -``` -$ oc label node type=pbench -``` - -### Create a pbench namespace -``` -$ oc create -f pbench/contrib/containerized-pbench/openshift-templates/pbench-namespace.yml -``` - -### Create a service account and add it to the privileged Security Context Constraints -``` -$ oc create serviceaccount useroot -$ oc adm policy add-scc-to-user privileged -z useroot -``` - -### Create pbench-agent pods and patch the daemonset -``` -$ oc create -f pbench/contrib/containerized-pbench/openshift-templates/pbench-agent-daemonset.yml -$ oc patch daemonset pbench-agent --patch \ '{"spec":{"template":{"spec":{"serviceAccountName": "useroot"}}}}' -``` - -## Prepare the jump host to run pbench-controller - -### Get the controller image from dockerhub -``` -$ docker pull ravielluri/image:controller -$ docker tag ravielluri/image:controller pbench-controller:latest -``` - -### keys -copy the ssh keys to /root/scale-testing/keys. The keys directory should contain a perf key named as id_rsa_perf, id_rsa - the private key needed to copy the results to the pbench server, authorized_keys file -ansible needs to have a passwordless authentication to localhost inside the container, ssh config which looks like: -``` -Host * - User root - Port 2022 - StrictHostKeyChecking no - PasswordAuthentication no - UserKnownHostsFile ~/.ssh/known_hosts - IdentityFile ~/.ssh/id_rsa_perf - -Host *pbench-server - User root - Port 22 - StrictHostKeyChecking no - PasswordAuthentication no - UserKnownHostsFile ~/.ssh/known_hosts - IdentityFile /opt/pbench-agent/id_rsa -``` - -### Inventory -Make sure you have the inventory used to install openshift and it should look like: -``` -[pbench-controller] - -[masters] - -[nodes] - -[etcd] - -[lb] - -[prometheus-metrics] - port=8443 cert=/etc/origin/master/admin.crt key=/etc/origin/master/admin.key - port=10250 cert=/etc/origin/master/admin.crt key=/etc/origin/master/admin.key - -[pbench-controller:vars] -register_all_nodes=False -``` - -Set register_all_nodes to true if the tools needs to be registered on all the nodes, if not set to true, it registers pbench tools on just two of the nodes. - -NOTE: -- Make sure all the variables are defined under [group:vars], all the stuff under [groups] are assumed to be the node ip’s. - -- In HA environment, we will have an lb which is not an openshift node. This means that there won’t be a pbench-agent pod running on the lb, pbench-ansible will fail registering tools as it won’t find a pbench-agent pod. So, we need to make a copy of the original inventory and get rid of the lb node from the inventory which is being mounted into the container. - -- We need to make sure we stick to either ip’s or hostnames in both inventory and openshift for certificates to be valid. - -## Run benchmarks -Edit the vars file and set benchmark_type variable to the benchmark that you want to run, pbench_server - host where the results are moved when move_results is set to True. - -### Avalaible benchmark_type options: -- nodeVertical -- http -- masterVertical - -## Run -``` -$ docker_id=$(docker run -t -d --name=controller --net=host --privileged \ - -v /var/lib/pbench-agent:/var/lib/pbench-agent \ - -v :/var/lib/pbench-agent \ - -v :/root/inventory \ - -v :/root/vars \ - -v :/root/.ssh \ - -v :/root/benchmark.sh pbench-controller -``` - -### Results -If move_results is set, the results are moved to the pbench server. In case you want to look at the results before moving, set move_results to False and the results will be available in the mounted directory. - -### Monitoring the benchmark -In case you want to monitor what's going on inside the container, please take a look at the logs: - -``` -$ docker logs -f pbench-controller -``` -You should be able to see the pbench-ansible registering the tools and the benchmark stdout. - -### Need for privileged container -Docker needs to be run under privileged mode to get access to the host system's devices. Host's /var/lib/pbench-agent directory, /proc are mounted on to the container. +# Running a Pbench Agent-driven Workload in a Container +1. Create a workload script (`example-workload.sh` can be used to start) + This script performs the invocation of a Pbench Agent workload driver, e.g. + `pbench-user-benchmark`, or `pbench-fio`, or `pbench-uperf`. +2. Setup the local execution environment to be aware of the target Pbench Server + `./setup.sh :` +3. Execute the workload + Typically this script performs the necessary setup required for the + containerized environment (`example-driver.sh` can be used to start, note + that it also moves the results to the Pbench Server). diff --git a/contrib/containerized-pbench/benchmark.sh b/contrib/containerized-pbench/benchmark.sh deleted file mode 100755 index 6d9da0f622..0000000000 --- a/contrib/containerized-pbench/benchmark.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# set sysinfo parameter to none when running the benchmark in case you dont want to collect system information -# pbench-user-benchmark --sysinfo=none -C nodeVert -- ./nodeVertical.sh nodeVert - -# wrap cluster loader commands with pbench -cd /root/svt/openshift_scalability - -# nodeVertical -if [[ "${benchmark_type}" == "nodeVertical" || "${benchmark_type}" == "nodevertical" ]]; then - pbench-user-benchmark -C nodeVert -- ./nodeVertical.sh nodeVert - #./cluster-loader.py -avf config/nodeVertical.yaml -# http -elif [[ "${benchmark_type}" == "http" ]]; then - # pbench-user-benchmark -C http -- ./http_test.sh - ./cluster-loader.py -vaf config/stress-mb.yaml -#master-Vertical -elif [[ "${benchmark_type}" == "masterVertical" ]] || [[ "${benchmark_type}" == "mastervertical" ]]; then - # pbench-user-benchmark -C masterVert -- ./masterVertical.sh - ./masterVertical.sh -elif [[ "${benchmark_type}" == "test" ]]; then - pbench-user-benchmark -- sleep 30 -fi diff --git a/contrib/containerized-pbench/dockerfiles/README.md b/contrib/containerized-pbench/dockerfiles/README.md deleted file mode 100644 index c49350fe71..0000000000 --- a/contrib/containerized-pbench/dockerfiles/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Pbench Dockerfiles -Dockerfiles for building pbench agent and controller images. - -## Build - -### pbench-agent -``` -$ docker build -t agent -``` - -### pbench-controller -``` -$ docker build -t controller -``` diff --git a/contrib/containerized-pbench/dockerfiles/agent/Dockerfile b/contrib/containerized-pbench/dockerfiles/agent/Dockerfile deleted file mode 100644 index 7f23da81d0..0000000000 --- a/contrib/containerized-pbench/dockerfiles/agent/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -#Dockerfile for pbench-agent -FROM centos/tools -MAINTAINER Naga Ravi Chaitanya Elluri - -# Setup pbench, sshd install dependencies -RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - curl -s https://copr.fedorainfracloud.org/coprs/ndokos/pbench-interim/repo/epel-7/ndokos-pbench-interim-epel-7.repo > /etc/yum.repos.d/copr-pbench.repo && \ - yum --enablerepo=ndokos-pbench-interim install -y configtools openssh-clients pbench-agent iproute sysvinit-tools \ - openssh-server git openssh-server openssh-clients initscripts ansible python-pip && \ - source /etc/profile.d/pbench-agent.sh && \ - curl -L https://github.com/openshift/origin/releases/download/v1.2.1/openshift-origin-client-tools-v1.2.1-5e723f6-linux-64bit.tar.gz | tar -zx && \ - mv openshift*/oc /usr/local/bin && \ - rm -rf openshift-origin-client-tools-* && \ - mkdir -p /root/.ssh && \ - pip install requests && \ - yum clean all && \ - sed -i "s/#Port 22/Port 2022/" /etc/ssh/sshd_config && \ - systemctl enable sshd - -EXPOSE 2022 - -# Mount /proc -COPY mount.sh /root/mount.sh -COPY pbench.service /etc/systemd/system/pbench.service -RUN systemctl enable pbench.service - -ENTRYPOINT ["/usr/sbin/init"] diff --git a/contrib/containerized-pbench/dockerfiles/agent/mount.sh b/contrib/containerized-pbench/dockerfiles/agent/mount.sh deleted file mode 100755 index fba22d2ee4..0000000000 --- a/contrib/containerized-pbench/dockerfiles/agent/mount.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -. /etc/profile.d/pbench-agent.sh -mkdir -p /var/lib/pbench-agent/tools-default -mount -o bind /proc_host /proc -while true; do sleep 1; done diff --git a/contrib/containerized-pbench/dockerfiles/agent/pbench.service b/contrib/containerized-pbench/dockerfiles/agent/pbench.service deleted file mode 100644 index 64983a3e1f..0000000000 --- a/contrib/containerized-pbench/dockerfiles/agent/pbench.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=pbench daemon -After=sshd.service - -[Service] -ExecStart=/root/mount.sh -StandardOutput=null - -[Install] -WantedBy=multi-user.target diff --git a/contrib/containerized-pbench/dockerfiles/controller/Dockerfile b/contrib/containerized-pbench/dockerfiles/controller/Dockerfile deleted file mode 100644 index 86439ef64d..0000000000 --- a/contrib/containerized-pbench/dockerfiles/controller/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -#Dockerfile for pbench-controller -FROM centos/tools -MAINTAINER Naga Ravi Chaitanya Elluri - -# Setup pbench, sshd, pbench-ansible, svt and install dependencies -RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - curl -s https://copr.fedorainfracloud.org/coprs/ndokos/pbench-interim/repo/epel-7/ndokos-pbench-interim-epel-7.repo > /etc/yum.repos.d/copr-pbench.repo && \ - yum --enablerepo=ndokos-pbench-interim install -y configtools openssh-clients pbench-agent \ - iproute sysvinit-tools openssh-server git ansible bind-utils blktrace ethtool findutils \ - gnuplot golang httpd-tools hwloc iotop iptables-services kernel ltrace mailx maven netsniff-ng \ - net-tools ntp ntpdate numactl pciutils perf python-docker-py python-flask python-pip python-rbd \ - python2-boto3 powertop psmisc rpm-build screen sos strace tar tcpdump tmux vim-enhanced xauth wget \ - yum-utils rpmdevtools ceph-common glusterfs-fuse iscsi-initiator-utils openssh-server openssh-clients initscripts && \ - yum clean all && \ - source /etc/profile.d/pbench-agent.sh && \ - mkdir -p /root/.go && echo "GOPATH=/root/.go" >> ~/.bashrc && \ - echo "export GOPATH" >> ~/.bashrc && \ - echo "PATH=\$PATH:\$GOPATH/bin" >> ~/.bashrc && \ - source ~/.bashrc && \ - mkdir -p /root/.ssh && \ - curl -L https://github.com/openshift/origin/releases/download/v1.2.1/openshift-origin-client-tools-v1.2.1-5e723f6-linux-64bit.tar.gz | tar -zx && \ - mv openshift*/oc /usr/local/bin && \ - rm -rf openshift-origin-client-tools-* && \ - git clone https://github.com/distributed-system-analysis/pbench.git && \ - git clone https://github.com/openshift/svt.git && \ - mv /opt/pbench-agent/config/pbench-agent.cfg.example /opt/pbench-agent/config/pbench-agent.cfg && \ - sed -i "s/#Port 22/Port 2022/" /etc/ssh/sshd_config && \ - systemctl enable sshd - -# Expose ports -EXPOSE 2022 9090 - -# Run pbench as service -COPY pbench.service /etc/systemd/system/pbench.service -RUN systemctl enable pbench.service -ENTRYPOINT ["/usr/sbin/init"] diff --git a/contrib/containerized-pbench/dockerfiles/controller/pbench.service b/contrib/containerized-pbench/dockerfiles/controller/pbench.service deleted file mode 100644 index 22033ec9db..0000000000 --- a/contrib/containerized-pbench/dockerfiles/controller/pbench.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=pbench daemon -After=sshd.service - -[Service] -EnvironmentFile=/root/vars -ExecStart=/root/script.sh -StandardOutput=journal+console - -[Install] -WantedBy=multi-user.target diff --git a/contrib/containerized-pbench/dockerfiles/controller/run.sh b/contrib/containerized-pbench/dockerfiles/controller/run.sh deleted file mode 100755 index 0fdddad618..0000000000 --- a/contrib/containerized-pbench/dockerfiles/controller/run.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -. /etc/profile.d/pbench-agent.sh -mkdir -p /var/lib/pbench-agent/tools-default -cp /root/.ssh/id_rsa /opt/pbench-agent/id_rsa - -# Set pbench-server in the config -sed -i "/^pbench_web_server/c pbench_web_server = ${pbench_server}" /opt/pbench-agent/config/pbench-agent.cfg - -# Clear tools -pbench-clear-tools - -# Register tools -ansible-playbook -i /root/inventory /root/pbench/contrib/ansible/openshift/pbench_register.yml - -if [[ "$?" == 0 ]]; then - echo -e "-----------------------------------------------------------\n\n\n" - echo -e " PBENCH TOOLS REGISTERED SUCCESSFULLY \n\n\n" - echo "-----------------------------------------------------------" -else - echo -e "-----------------------------------------------------------\n\n\n" - echo -e " PBENCH REGISTRATION FAILED \n\n\n" - echo "-----------------------------------------------------------" -fi - -if [[ "${clear_results}" == "true" ]] || [[ "${clear_results}" == "True" ]]; then - pbench-clear-results -fi - -# Run the benchmark -${benchmark} -benchmark_status=$? - -if [[ "${move_results}" == "true" ]] || [[ "${move_results}" == "True" ]]; then - pbench-move-results -fi - -if [[ "$benchmark_status" == 0 ]]; then - echo -e "-----------------------------------------------------------\n\n\n" - echo -e " OCP SCALE TEST COMPLETED \n\n\n" - echo "-----------------------------------------------------------" -else - echo -e "-----------------------------------------------------------\n\n\n" - echo -e " OCP SCALE TEST FAILED \n\n\n" - echo "-----------------------------------------------------------" -fi diff --git a/contrib/containerized-pbench/example-driver.sh b/contrib/containerized-pbench/example-driver.sh new file mode 100755 index 0000000000..59e4bb5360 --- /dev/null +++ b/contrib/containerized-pbench/example-driver.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +if [[ ! -f ./var_lib_pbench-agent/.token || ! -f ./pbench-agent.cfg.tmp ]]; then + echo "Please run ./setup.sh to properly setup the required environment." >&2 + exit 1 +fi + +# Create a `fiotest` directory to use as the target directory of the `fio` +# workload execution. +mkdir -p fiotest + +# Run the workload in the container. +# +# The `example-workload.sh` script is mounted into the container as +# `/workload.sh`, along with the target `fiotest` directory it requires, and the +# location of `/var/lib/pbench-agent`. This example relies on the CentOS 8 +# Pbench Agent "all" container image (which has everything and the kitchen sink +# installed). +# +# Notice that host networking is used for the container. +# +# NOTE that the container is not run with any privileges or adjusted namespaces +# so the tool data collected may not be what you expect. +podman run \ + --rm \ + --network host \ + --name example-workload \ + -v ${HOME}/.ssh:/root/.ssh:z \ + -v ./example-workload.sh:/workload.sh:z \ + -v ./var_lib_pbench-agent:/var/lib/pbench-agent:z \ + -v ./fiotest:/fiotest:z \ + quay.io/pbench/pbench-agent-all-centos-8:latest /workload.sh + +# Move the results to the target Pbench Server +# +# Note that we run the mover separately to demonstrate that the collected data +# is independent of the containerized environment in which it was collected. +podman run \ + -it \ + --rm \ + --network host \ + -v ./mover.sh:/mover.sh:z \ + -v ./pbench-agent.cfg.tmp:/opt/pbench-agent/config/pbench-agent.cfg:z \ + -v ./var_lib_pbench-agent:/var/lib/pbench-agent:z \ + quay.io/pbench/pbench-agent-all-centos-8:latest /mover.sh diff --git a/contrib/containerized-pbench/example-workload.sh b/contrib/containerized-pbench/example-workload.sh new file mode 100755 index 0000000000..6f8fb1e971 --- /dev/null +++ b/contrib/containerized-pbench/example-workload.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# An example of how to run a simple workload with `pbench-user-benchmark` + +# In a containerized environment, the Pbench Agent profile must be run to +# establish the proper execution environment. +source /opt/pbench-agent/profile + +# The set of tools the user desires to run must be registered before the +# workload is executed. +echo "Registering the 'heavy' tool set provided by the Pbench Agent" +pbench-register-tool-set heavy + +# The `user-benchmark` workload wrapper simply takes a configuration name, in +# this case the very generic `example-workload`, followed by the command to use +# to run the workload. Note that the command is separated by `--` to avoid +# any workload command line arguments that follow from being interpreted as +# options to `pbench-user-benchmark` command itself. +echo "Executing pbench-user-benchmark ..." +pbench-user-benchmark --config example-workload -- fio --directory=/fiotest --name fio_test_file --direct=1 --rw=randread --bs=16k --size=100M --numjobs=16 --time_based --runtime=20s --group_reporting --norandommap diff --git a/contrib/containerized-pbench/gen-token.sh b/contrib/containerized-pbench/gen-token.sh new file mode 100755 index 0000000000..67bdd0b020 --- /dev/null +++ b/contrib/containerized-pbench/gen-token.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# In a containerized environment, the Pbench Agent profile must be run to +# establish the proper execution environment. +source /opt/pbench-agent/profile + +# Generate a token to move results to the target Pbench Server storing it in the +# mounted /var/lib/pbench-agent directory. +pbench-generate-token --output=/var/lib/pbench-agent/.token diff --git a/contrib/containerized-pbench/inventory b/contrib/containerized-pbench/inventory deleted file mode 100644 index 778c3bd0bf..0000000000 --- a/contrib/containerized-pbench/inventory +++ /dev/null @@ -1,16 +0,0 @@ -[pbench-controller] - -[masters] - -[nodes] - -[etcd] - -[lb] - -[prometheus-metrics] - port=8443 cert=/etc/origin/master/admin.crt key=/etc/origin/master/admin.key - port=10250 cert=/etc/origin/master/admin.crt key=/etc/origin/master/admin.key - -[pbench-controller:vars] -register_all_nodes=False diff --git a/contrib/containerized-pbench/keys/authorized_keys b/contrib/containerized-pbench/keys/authorized_keys deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/containerized-pbench/keys/config b/contrib/containerized-pbench/keys/config deleted file mode 100644 index b941df8361..0000000000 --- a/contrib/containerized-pbench/keys/config +++ /dev/null @@ -1,11 +0,0 @@ -Host * - User root - Port 2022 - StrictHostKeyChecking no - PasswordAuthentication no - IdentityFile ~/.ssh/id_rsa_perf - -Host *perf.lab.eng.bos.redhat.com - User root - Port 22 - StrictHostKeyChecking no diff --git a/contrib/containerized-pbench/keys/id_rsa b/contrib/containerized-pbench/keys/id_rsa deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/containerized-pbench/keys/id_rsa_perf b/contrib/containerized-pbench/keys/id_rsa_perf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/contrib/containerized-pbench/mover.sh b/contrib/containerized-pbench/mover.sh new file mode 100755 index 0000000000..bf75292f61 --- /dev/null +++ b/contrib/containerized-pbench/mover.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# In a containerized environment, the Pbench Agent profile must be run to +# establish the proper execution environment. +source /opt/pbench-agent/profile + +# Move the results to the configured Pbench Server. +# +# NOTE: the required token must be provided in the file +# /var/lib/pbench-agent/.token ahead of time. +pbench-results-move --token=$(:) to move the results to as the first argument." >&2 + exit 2 +fi +cat > ./pbench-agent.cfg.tmp <<- EOF + [DEFAULT] + pbench_install_dir = /opt/pbench-agent + pbench_web_server = ${1} + [config] + path = %(pbench_install_dir)s/config + files = pbench-agent-default.cfg + EOF + +# Create a directory to use as the `/var/lib/pbench-agent` directory mounted +# in the container. +mkdir -p var_lib_pbench-agent + +podman run \ + -it \ + --rm \ + --network host \ + -v ./gen-token.sh:/gen-token.sh:z \ + -v ./pbench-agent.cfg.tmp:/opt/pbench-agent/config/pbench-agent.cfg:z \ + -v ./var_lib_pbench-agent:/var/lib/pbench-agent:z \ + quay.io/pbench/pbench-agent-all-centos-8:latest /gen-token.sh diff --git a/contrib/containerized-pbench/vars b/contrib/containerized-pbench/vars deleted file mode 100644 index 785001cb80..0000000000 --- a/contrib/containerized-pbench/vars +++ /dev/null @@ -1,12 +0,0 @@ -clear_results=False - -KUBECONFIG=/root/.kube/config - -#available options = http, nodeVertical, masterVertical, test -benchmark_type=http - -benchmark=/root/benchmark.sh - -pbench_server=pbench.example.com - -move_results=False