Skip to content

Commit

Permalink
Merge pull request #17458 from cevich/fix_benchmarks_env
Browse files Browse the repository at this point in the history
Cirrus: Omit functions in env. file
  • Loading branch information
openshift-merge-robot authored Feb 16, 2023
2 parents 6f40253 + 45fb353 commit 5d78547
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -328,25 +328,30 @@ remove_packaged_podman_files() {
# Execute make localbenchmarks in $CIRRUS_WORKING_DIR/data
# for preserving as a task artifact.
localbenchmarks() {
local datadir
local datadir envnames envname
req_env_vars DISTRO_NV PODBIN_NAME PRIV_NAME TEST_ENVIRON TEST_FLAVOR
req_env_vars VM_IMAGE_NAME EC2_INST_TYPE

datadir=$CIRRUS_WORKING_DIR/data
mkdir -p $datadir

envnames=$(passthrough_envars | sort);
(
echo "# Env. var basis for benchmarks benchmarks."
printenv | grep -Ev "$SECRET_ENV_RE" | sort
for envname in $envnames; do
printf "$envname=%q\n" "${!envname}"
done

echo "# Machine details for data-comparison sake, not actual env. vars."
# Checked above in req_env_vars
# shellcheck disable=SC2154
echo "\
BENCH_ENV_VER=1
CPUTOTAL=$(grep -ce '^processor' /proc/cpuinfo)
INST_TYPE=$EC2_INST_TYPE # one day may include other cloud's VM types.
MEMTOTAL=$(awk -F: '$1 == "MemTotal" { print $2 }' </proc/meminfo | sed -e "s/^ *//")
UNAME_RM=$(uname -r -m)
INST_TYPE=$EC2_INST_TYPE
MEMTOTALKB=$(awk -F: '$1 == "MemTotal" { print $2 }' </proc/meminfo | sed -e "s/^ *//" | cut -d ' ' -f 1)
UNAME_R=$(uname -r)
UNAME_M=$(uname -m)
"
) > $datadir/benchmarks.env
make localbenchmarks | tee $datadir/benchmarks.raw
Expand Down

0 comments on commit 5d78547

Please sign in to comment.