diff --git a/devtools/benchmarks-tools/run_all_benchmarks_on_latest_master.sh b/devtools/benchmarks-tools/run_all_benchmarks_on_latest_master.sh index dc193217e3327fad52c0deac40cad0d87527060c..29af54cad3e427a89d4a7e1b8f423347f9bbdea3 100755 --- a/devtools/benchmarks-tools/run_all_benchmarks_on_latest_master.sh +++ b/devtools/benchmarks-tools/run_all_benchmarks_on_latest_master.sh @@ -93,17 +93,33 @@ cd .. mv tezos/_snoop/*_results "$SNOOP_RESULT_DIR"/ chmod +rx "$SNOOP_RESULT_DIR"/*_results +# Setup gcloud CLI +export GOOGLE_APPLICATION_CREDENTIALS="/home/mclaren/.gcp/nl-gas-monitoring-bae9373e1224.json" +GCP_PROJECT_ID="nl-gas-monitoring" +GCP_GCS_SNOOP_RESULTS_BUCKET="nl-snoop-playground" +GCP_GCS_SNOOP_RESULTS_PATH="${GCP_GCS_SNOOP_RESULTS_BUCKET}/mclaren" +if [ ! -f ${GOOGLE_APPLICATION_CREDENTIALS} ]; then + dated_log "Cannot find GCP Service Account JSON file." + exit 1 +fi +gcloud auth activate-service-account --key-file="$GOOGLE_APPLICATION_CREDENTIALS" --quiet +gcloud config set project ${GCP_PROJECT_ID} --quiet + # Save results in the cloud. dated_log "Uploading results" aws s3 cp "$SNOOP_RESULT_DIR"/ s3://snoop-playground/mclaren/complete_results/"$SNOOP_RESULT_DIR"/ --recursive +gsutil cp -r "$SNOOP_RESULT_DIR" gs://${GCP_GCS_SNOOP_RESULTS_PATH}/complete_results/"$SNOOP_RESULT_DIR" + dated_log "Uploading CSVs" aws s3 cp "$SNOOP_RESULT_DIR"/inference_results/ s3://snoop-playground/mclaren/inference_csvs/"$SNOOP_RESULT_DIR"/ --recursive --exclude "*" --include "*.csv" +find "$SNOOP_RESULT_DIR"/inference_results/ -name "*.csv" | gsutil -m cp -I gs://${GCP_GCS_SNOOP_RESULTS_PATH}/inference_csvs/"$SNOOP_RESULT_DIR"/ dated_log "Results and CSVs uploaded" # Update the directory of the last successful run, and its status. mv current_run_dir last_run_dir echo $$ > "$SNOOP_RESULT_DIR"/SUCCESS aws s3 cp "$SNOOP_RESULT_DIR"/SUCCESS s3://snoop-playground/mclaren/complete_results/"$SNOOP_RESULT_DIR"/ +gsutil cp "$SNOOP_RESULT_DIR"/SUCCESS gs://${GCP_GCS_SNOOP_RESULTS_PATH}/complete_results/"$SNOOP_RESULT_DIR"/ dated_log "End of benchmarks processes" exit 0