From af0fde345fa1fb37162efa12aa984f9e292e713b Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Tue, 28 Jan 2025 16:45:03 +0100 Subject: [PATCH 1/3] Gas/Slack: update API call More details in https://api.slack.com/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay --- devtools/benchmarks-tools/watch_regressions.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/devtools/benchmarks-tools/watch_regressions.sh b/devtools/benchmarks-tools/watch_regressions.sh index cf73424a184e..bb75efd59d1e 100755 --- a/devtools/benchmarks-tools/watch_regressions.sh +++ b/devtools/benchmarks-tools/watch_regressions.sh @@ -76,7 +76,18 @@ slack() { slack_send_file() { if [ "$DISABLE_SLACK_MESSAGING" = "" ]; then - curl -F file=@"$1" -F "initial_comment=$2" -F channels="$CHAN" -F token="$TOK" https://tezos.slack.com/api/files.upload + FILESIZE="$(stat --printf="%s" "$1")" + RESPONSE="$(curl -F filename="$1" -F length="$FILESIZE" -F token="$TOK" https://tezos.slack.com/api/files.getUploadURLExternal)" + OK="$(echo "$RESPONSE" | jq -r .ok)" + if [ "$OK" = "true" ]; then + URL="$(echo "$RESPONSE" | jq -r .upload_url)" + ID="$(echo "$RESPONSE" | jq -r .file_id)" + curl -X POST -F filename=@"$1" "$URL" + curl -X POST -F files="[{\"id\":\"$ID\", \"title\":\"$1\"}]" -F "initial_comment=$2" -F channels="$CHAN" -F token="$TOK" https://tezos.slack.com/api/files.completeUploadExternal + else + ERROR="$(echo "$RESPONSE" | jq -r .error)" + echo "Error: could not send \"$1\" on Slack with message \"$2\". Error: \"$ERROR\"" + fi else echo "File \"$1\" would be sent on Slack with message \"$2\" but Slack messaging has been disabled." fi -- GitLab From 8aa128dcca21606cc700eb4413852de536d9e972 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Thu, 30 Jan 2025 14:24:40 +0100 Subject: [PATCH 2/3] Gas/Slack: update slack channel --- devtools/benchmarks-tools/cronjob.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devtools/benchmarks-tools/cronjob.sh b/devtools/benchmarks-tools/cronjob.sh index ae36ca81e396..e23992b8b097 100755 --- a/devtools/benchmarks-tools/cronjob.sh +++ b/devtools/benchmarks-tools/cronjob.sh @@ -40,10 +40,10 @@ TODAY=$(date +"%Y%m%d_%H%M") # messages using the gas-benchmarks-reports Slack application. # The file can only be read by mclaren, its owner. This is to prevent anybody to # use the application to send messages. -# C04HZHR11DW is the identifier for the #gas-benchmarks-reports channel (it can +# C088AUBEB6Y is the identifier for the #core-layer1-gas-benchmarks-reports channel (it can # be found in its URL). slack() { - curl -X POST -H 'Authorization: Bearer '"$(cat /data/tezos-benchmarks/slack_token)" -H 'Content-type: application/json; charset=utf-8' --data "{\"channel\":\"C04HZHR11DW\",\"text\":\"$1\"}" https://tezos-dev.slack.com/api/chat.postMessage + curl -X POST -H 'Authorization: Bearer '"$(cat /data/tezos-benchmarks/slack_token)" -H 'Content-type: application/json; charset=utf-8' --data "{\"channel\":\"C088AUBEB6Y\",\"text\":\"$1\"}" https://tezos.slack.com/api/chat.postMessage } anomaly() { -- GitLab From 04173629febf529628cf2ba8c9ca981b39116e82 Mon Sep 17 00:00:00 2001 From: Lucas Randazzo Date: Fri, 31 Jan 2025 17:29:01 +0100 Subject: [PATCH 3/3] GasBench: fix build Temporary fix --- devtools/benchmarks-tools/cronjob.sh | 2 +- .../benchmarks-tools/run_all_benchmarks_on_latest_master.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/devtools/benchmarks-tools/cronjob.sh b/devtools/benchmarks-tools/cronjob.sh index e23992b8b097..7e9b1dcf8d22 100755 --- a/devtools/benchmarks-tools/cronjob.sh +++ b/devtools/benchmarks-tools/cronjob.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash ############################################################################# # # 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 3d15d9da0fa1..82d954234c8d 100755 --- a/devtools/benchmarks-tools/run_all_benchmarks_on_latest_master.sh +++ b/devtools/benchmarks-tools/run_all_benchmarks_on_latest_master.sh @@ -89,6 +89,9 @@ cd tezos dated_log "Compiling dependencies" # shellcheck disable=SC1091 . "/home/mclaren/.cargo/env" +# Reset switch +rm -rf ../.opam +opam init --bare --root /data/tezos-benchmarks/.opam --confirm-level=no # OPAMSOLVERTIMEOUT=0 means that the opam solver won't timeout make OPAMSOLVERTIMEOUT=0 build-dev-deps eval "$(opam env)" -- GitLab