github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/metrics/storage/fio-k8s/scripts/dax-compare-test/report/gen-html-fio-report.sh (about)

     1  #!/bin/bash
     2  #Copyright (c) 2021 Intel Corporation
     3  #
     4  #SPDX-License-Identifier: Apache-2.0
     5  #
     6  
     7  set -o errexit
     8  set -o nounset
     9  set -o pipefail
    10  set -o errtrace
    11  
    12  script_dir=$(dirname "$(readlink -f "$0")")
    13  
    14  results_dir=${1:-}
    15  
    16  usage(){
    17  	echo "$0 <results_dir>"
    18  }
    19  
    20  if [ "${results_dir}" == "" ];then
    21  	echo "missing results directory"
    22  	usage
    23  	exit 1
    24  fi
    25  
    26  if [ ! -d "${results_dir}" ];then
    27  	echo "${results_dir} is not a directory"
    28  	usage
    29  	exit 1
    30  fi
    31  
    32  results_dir=$(realpath "${results_dir}")
    33  
    34  generate_report(){
    35  	sudo chown "${USER}:${USER}" -R ${results_dir}
    36  	sudo docker run --rm -e JUPYTER_ENABLE_LAB=yes \
    37  		-v "${script_dir}:/home/jovyan" \
    38  		-v "${results_dir}:/home/jovyan/results" \
    39  		--user $(id -u):$(id -g) \
    40  		jupyter/scipy-notebook:399cbb986c6b \
    41  		bash  -e -c '
    42  			cd results;
    43  			jupyter nbconvert --execute /home/jovyan/fio.ipynb --to html;
    44  			cp /home/jovyan/fio.html /home/jovyan/results;
    45  			'
    46  }
    47  
    48  generate_report