| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Applies a Skia patch and compares images of SKPs with render_pictures. | 3 # Applies a Skia patch and compares images of SKPs with render_pictures. |
| 4 # | 4 # |
| 5 # The script should be run from the skia-telemetry-slave GCE instance's | 5 # The script should be run from the skia-telemetry-slave GCE instance's |
| 6 # /home/default/skia-repo/buildbot/compute_engine_scripts/telemetry/telemetry_sl
ave_scripts | 6 # /home/default/skia-repo/buildbot/compute_engine_scripts/telemetry/telemetry_sl
ave_scripts |
| 7 # directory. | 7 # directory. |
| 8 # | 8 # |
| 9 # Copyright 2013 Google Inc. All Rights Reserved. | 9 # Copyright 2013 Google Inc. All Rights Reserved. |
| 10 # Author: rmistry@google.com (Ravi Mistry) | 10 # Author: rmistry@google.com (Ravi Mistry) |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 echo "== Removing the patch, building, and running render_pictures ==" | 192 echo "== Removing the patch, building, and running render_pictures ==" |
| 193 reset_skia_checkout | 193 reset_skia_checkout |
| 194 make clean | 194 make clean |
| 195 build_tools $MESA_NOPATCH_RUN | 195 build_tools $MESA_NOPATCH_RUN |
| 196 OUTPUT_DIR_NOPATCH_DIR_NAME=nopatch-pictures-$RUN_ID | 196 OUTPUT_DIR_NOPATCH_DIR_NAME=nopatch-pictures-$RUN_ID |
| 197 OUTPUT_DIR_NOPATCH=${IMG_ROOT}${OUTPUT_DIR_NOPATCH_DIR_NAME} | 197 OUTPUT_DIR_NOPATCH=${IMG_ROOT}${OUTPUT_DIR_NOPATCH_DIR_NAME} |
| 198 mkdir -p $OUTPUT_DIR_NOPATCH | 198 mkdir -p $OUTPUT_DIR_NOPATCH |
| 199 run_render_pictures $OUTPUT_DIR_NOPATCH $MESA_NOPATCH_RUN | 199 run_render_pictures $OUTPUT_DIR_NOPATCH $MESA_NOPATCH_RUN |
| 200 | 200 |
| 201 echo "== Run skpdiff to get the CSV with perceptual similarity metrics ==" |
| 202 SKPDIFF_OUTPUT_FILE=/tmp/skpdiff-$RUN_ID.csv |
| 203 ./out/Release/skpdiff \ |
| 204 -f $OUTPUT_DIR_NOPATCH $OUTPUT_DIR_WITHPATCH \ |
| 205 --csv $SKPDIFF_OUTPUT_FILE \ |
| 206 -d perceptual |
| 207 |
| 201 echo "== Comparing pictures and saving differences in JSON output file ==" | 208 echo "== Comparing pictures and saving differences in JSON output file ==" |
| 202 cd /home/default/skia-repo/buildbot/compute_engine_scripts/telemetry/telemetry_s
lave_scripts | 209 cd /home/default/skia-repo/buildbot/compute_engine_scripts/telemetry/telemetry_s
lave_scripts |
| 203 JSON_SUMMARY_DIR=/tmp/summary-$RUN_ID | 210 JSON_SUMMARY_DIR=/tmp/summary-$RUN_ID |
| 204 mkdir -p $JSON_SUMMARY_DIR | 211 mkdir -p $JSON_SUMMARY_DIR |
| 205 python write_json_summary.py \ | 212 python write_json_summary.py \ |
| 206 --img_root=$IMG_ROOT \ | 213 --img_root=$IMG_ROOT \ |
| 207 --nopatch_json=$OUTPUT_DIR_NOPATCH/summary.json \ | 214 --nopatch_json=$OUTPUT_DIR_NOPATCH/summary.json \ |
| 208 --nopatch_img_dir_name=$OUTPUT_DIR_NOPATCH_DIR_NAME \ | 215 --nopatch_img_dir_name=$OUTPUT_DIR_NOPATCH_DIR_NAME \ |
| 209 --withpatch_json=$OUTPUT_DIR_WITHPATCH/summary.json \ | 216 --withpatch_json=$OUTPUT_DIR_WITHPATCH/summary.json \ |
| 210 --withpatch_img_dir_name=$OUTPUT_DIR_WITHPATCH_DIR_NAME \ | 217 --withpatch_img_dir_name=$OUTPUT_DIR_WITHPATCH_DIR_NAME \ |
| 211 --output_file_path=$JSON_SUMMARY_DIR/slave$SLAVE_NUM.json \ | 218 --output_file_path=$JSON_SUMMARY_DIR/slave$SLAVE_NUM.json \ |
| 212 --gs_output_dir=$OUTPUT_FILE_GS_LOCATION \ | 219 --gs_output_dir=$OUTPUT_FILE_GS_LOCATION \ |
| 213 --gs_skp_dir=$GS_SKP_DIR \ | 220 --gs_skp_dir=$GS_SKP_DIR \ |
| 214 --slave_num=$SLAVE_NUM \ | 221 --slave_num=$SLAVE_NUM \ |
| 215 --gm_json_path=/home/default/skia-repo/trunk/gm/gm_json.py \ | 222 --gm_json_path=/home/default/skia-repo/trunk/gm/gm_json.py \ |
| 216 --imagediffdb_path=/home/default/skia-repo/trunk/gm/rebaseline_server/imagedif
fdb.py | 223 --imagediffdb_path=/home/default/skia-repo/trunk/gm/rebaseline_server/imagedif
fdb.py \ |
| 224 --skpdiff_output_csv=$SKPDIFF_OUTPUT_FILE |
| 217 | 225 |
| 218 echo "== Copy everything to Google Storage ==" | 226 echo "== Copy everything to Google Storage ==" |
| 219 # Get list of failed file names and upload only those to Google Storage. | 227 # Get list of failed file names and upload only those to Google Storage. |
| 220 ARRAY=`cat $JSON_SUMMARY_DIR/slave${SLAVE_NUM}.json | grep 'fileName' | cut -d '
:' -f 2 | cut -d "\"" -f2` | 228 ARRAY=`cat $JSON_SUMMARY_DIR/slave${SLAVE_NUM}.json | grep 'fileName' | cut -d '
:' -f 2 | cut -d "\"" -f2` |
| 221 for i in ${ARRAY[@]}; do | 229 for i in ${ARRAY[@]}; do |
| 222 gsutil cp $OUTPUT_DIR_NOPATCH/$i $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/nopa
tch-images/ | 230 gsutil cp $OUTPUT_DIR_NOPATCH/$i $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/nopa
tch-images/ |
| 223 gsutil cp $OUTPUT_DIR_WITHPATCH/$i $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/wi
thpatch-images/ | 231 gsutil cp $OUTPUT_DIR_WITHPATCH/$i $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/wi
thpatch-images/ |
| 224 done | 232 done |
| 225 # Copy the diffs and whitediffs to Google Storage. | 233 # Copy the diffs and whitediffs to Google Storage. |
| 226 gsutil cp $IMG_ROOT/diffs/* $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/diffs/ | 234 gsutil cp $IMG_ROOT/diffs/* $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/diffs/ |
| 227 gsutil cp $IMG_ROOT/whitediffs/* $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/whited
iffs/ | 235 gsutil cp $IMG_ROOT/whitediffs/* $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/whited
iffs/ |
| 228 | 236 |
| 229 # Set google.com permissions on all uploaded images. | 237 # Set google.com permissions on all uploaded images. |
| 230 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/nopatc
h-images/* | 238 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/nopatc
h-images/* |
| 231 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/withpa
tch-images/* | 239 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/withpa
tch-images/* |
| 232 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/diffs/
* | 240 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/diffs/
* |
| 233 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/whited
iffs/* | 241 gsutil acl ch -g google.com:READ $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/whited
iffs/* |
| 234 gsutil cp $JSON_SUMMARY_DIR/* $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/ | 242 gsutil cp $JSON_SUMMARY_DIR/* $OUTPUT_FILE_GS_LOCATION/slave$SLAVE_NUM/ |
| 235 | 243 |
| 236 cleanup_slave_before_exit | 244 cleanup_slave_before_exit |
| OLD | NEW |