@@ -17,8 +17,8 @@ rm Dockerfile
1717echo " Successfully built images"
1818
1919# Create folders to hold the files
20- mkdir $TAG1
21- mkdir $TAG2
20+ mkdir " $TAG1 "
21+ mkdir " $TAG2 "
2222
2323# Start running the containers and copy the benchmark result for python versions from container to host
2424docker run -it --name benchmark_1 -h CONTAINER1 -v " ${PWD} " /" $TAG1 " :/export benchmark_1 /bin/bash -c " cp /result/py*.json /export/"
@@ -30,7 +30,11 @@ echo "Start benchmarking the python interpreter performance between the two rele
3030pyperformance compare " $TAG1 " /py2.7.json " $TAG2 " /py2.7.json --output_style table > py2.7_res
3131pyperformance compare " $TAG1 " /py3.4.json " $TAG2 " /py3.4.json --output_style table > py3.4_res
3232pyperformance compare " $TAG1 " /py3.5.json " $TAG2 " /py3.5.json --output_style table > py3.5_res
33- pyperformance compare " $TAG1 " /py3.6.json " $TAG2 " /py3.6.json --output_style table > py3.6_res
33+
34+ # Check if the python3.6 benchmark result exists
35+ if [[ ( -e ' "$TAG1"/py3.6.json' ) && ( -e ' "$TAG2"/py3.6.json' ) ]]; then
36+ pyperformance compare " $TAG1 " /py3.6.json " $TAG2 " /py3.6.json --output_style table > py3.6_res;
37+ fi
3438
3539echo " Start extracting data and generating CSV file, then upload to Cloud Storage and insert to Big Query table"
3640
@@ -43,22 +47,25 @@ for path_to_file in $TAG2/*.json; do
4347 python generate_csv.py --filename $path_to_file --tag $TAG2
4448done
4549
46- # Get the list of existed release data on Cloud Storage and skip if the current TAG1 or TAG2 existed in the list
47- gsutil ls gs://python_runtime_benchmark > existed_releases
50+ # Set the project that hold the cloud storage bucket and big query tables
51+ gcloud config set project cloud-python-runtime-qa
52+
53+ # Get the list of existing release data on Cloud Storage and skip if the current TAG1 or TAG2 existing in the list
54+ gsutil ls gs://python-runtime-benchmark > existing_releases
4855
4956for container_tag in $TAG1 $TAG2 ; do
50- if grep --fixed-strings --quiet " $container_tag " existed_releases ; then
51- echo " Performace data of $container_tag existed, so skip processing it."
57+ if grep --fixed-strings --quiet " $container_tag " existing_releases ; then
58+ echo " Performance data of $container_tag existed, so skip processing it."
5259 else
5360 # Upload the CSV files to Cloud Storage
54- gsutil cp -r $container_tag gs://python_runtime_benchmark
61+ gsutil cp -r $container_tag gs://python-runtime-benchmark
5562 # Load the CSV files from Cloud Storage to Big Query table
5663 # Load the performance data of each function
5764 for path_to_file in $container_tag /py2.7.csv $container_tag /py3.4.csv $container_tag /py3.5.csv; do
58- bq load benchmark_test .benchmark_functions gs://python_runtime_benchmark /" $path_to_file " container_tag:string,runtime_version:string,function_name:string,time_used:float,mem_usage:float
65+ bq load benchmark .benchmark_functions gs://python-runtime-benchmark /" $path_to_file " container_tag:string,runtime_version:string,function_name:string,time_used:float,mem_usage:float
5966 done
6067 # Load the average performance data of each runtime version in a release
61- bq load benchmark_test .benchmark_statistics gs://python_runtime_benchmark /" $container_tag " /averages.csv container_tag:string,runtime_version:string,ave_time_used:float,ave_mem_usage:float
68+ bq load benchmark .benchmark_statistics gs://python-runtime-benchmark /" $container_tag " /averages.csv container_tag:string,runtime_version:string,ave_time_used:float,ave_mem_usage:float
6269 fi
6370done
6471
0 commit comments