Skip to content

Commit

Permalink
Update contrib scripts for Perfconf demo (#3363)
Browse files Browse the repository at this point in the history
- Use --security-opt=label=disable to avoid problems with relabeling the ~/.ssh
  directory, since it disrupts the use of it from _outside_ the container.
- Switch the default container tag from `latest`  (which is the latest _release_)
  to `main`, because we haven't done a release build of the Agent since we
  updated the containerization.
- Move the generate-token invocation "first" in the demo script, to help fail
  early.
- Change the run-time from 20s to 5s.
- Add an explanatory comment to a bit of subtlety.

PBENCH-1115
  • Loading branch information
webbnh authored Mar 28, 2023
1 parent 2d1e6af commit 8518937
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 3 additions & 4 deletions contrib/containerized-pbench/pbench
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# these options and any others which the user has specified and passes in the
# command to be executed.

image_name=${PB_AGENT_IMAGE_NAME:-quay.io/pbench/pbench-agent-all-centos-8:latest}
image_name=${PB_AGENT_IMAGE_NAME:-quay.io/pbench/pbench-agent-all-centos-8:main}
config_file=${_PBENCH_AGENT_CONFIG:-${HOME}/.config/pbench/pbench-agent.cfg}
pbench_run_dir=${PB_AGENT_RUN_DIR:-/var/tmp/${USER}/pbench-agent/run}
pbench_server=${PB_AGENT_SERVER_LOC}
Expand All @@ -36,15 +36,14 @@ if [[ $# == 0 || $1 == "help" || $1 == "-h" || $1 == "--help" ]]; then
fi

if [[ -d "${HOME}/.ssh" && -r "${HOME}/.ssh" ]]; then
other_options="-v ${HOME}/.ssh:/root/.ssh:z ${other_options}"
other_options="--security-opt=label=disable -v ${HOME}/.ssh:/root/.ssh ${other_options}"
fi

if [[ -f "${config_file}" && -r "${config_file}" ]]; then
other_options="-v ${config_file}:/opt/pbench-agent/config/pbench-agent.cfg:z ${other_options}"
elif [[ -n "${pbench_server}" ]]; then
echo "Warning: the Pbench Agent config file is missing; attempting to generate one in ${config_file}" >&2
# TODO: this should be handled by a separate Pbench Agent command which
# provides a "configuration wizard".
# TODO: this should be handled by a separate Pbench Agent "configuration wizard".
mkdir -p $(dirname ${config_file})
cat > ${config_file} <<- EOF
[DEFAULT]
Expand Down
8 changes: 5 additions & 3 deletions contrib/containerized-pbench/pbench_demo
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ mkdir -p ${FIOTEST}
#+
# Run the demo!
#-
pbench pbench-generate-token --output=/var/lib/pbench-agent/.token
pbench pbench-register-tool-set light
pbench pbench-list-tools
pbench 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 \
--bs=16k --size=100M --numjobs=8 --time_based --runtime=5s \
--group_reporting --norandommap
pbench pbench-generate-token --output=/var/lib/pbench-agent/.token
pbench pbench-results-move --token=$(< /var/tmp/pbench/pbench-agent/run/.token)
# Note that the token file location below is evaluated -outside- the container,
# unlike in the pbench-generate-token command above.
pbench pbench-results-move --token=$(< /var/tmp/${USER}/pbench-agent/run/.token)

0 comments on commit 8518937

Please sign in to comment.