Skip to content

Commit

Permalink
CI: only save benchmark for schedule run (#4822)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored May 8, 2024
1 parent 3848946 commit 8a954e2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/scripts/command/load_dump_bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ test_load_dump_with_small_dir(){
end=`date +%s`
runtime=$((end-start))
version=$(./juicefs -V|cut -b 17- | sed 's/:/-/g')
.github/scripts/save_benchmark.sh --category load_dump --name load_small_dir --result $runtime --meta $META --storage file
.github/scripts/save_benchmark.sh --name load_small_dir --result $runtime --meta $META --storage file
echo "load cost $runtime seconds"
start=`date +%s`
./juicefs dump $META_URL dump.json --fast
end=`date +%s`
runtime=$((end-start))
echo "dump cost $runtime seconds"
.github/scripts/save_benchmark.sh --category load_dump --name dump_small_dir --result $runtime --meta $META --storage file
.github/scripts/save_benchmark.sh --name dump_small_dir --result $runtime --meta $META --storage file
./juicefs mount $META_URL /jfs -d --no-usage-report
inode=$(df -i /jfs | grep JuiceFS |awk -F" " '{print $3}')
if [ "$inode" -ne "2233313" ]; then
Expand Down Expand Up @@ -60,7 +60,7 @@ do_load_dump_with_big_dir(){
runtime=$((end-start))
echo "load cost $runtime seconds"
version=$(./juicefs -V|cut -b 17- | sed 's/:/-/g')
.github/scripts/save_benchmark.sh --category load_dump --name load_big_dir --result $runtime --meta $META --storage file
.github/scripts/save_benchmark.sh --name load_big_dir --result $runtime --meta $META --storage file
start=`date +%s`
if [ "$with_subdir" = true ] ; then
./juicefs dump $META_URL dump.json --subdir test --fast
Expand All @@ -70,7 +70,7 @@ do_load_dump_with_big_dir(){
end=`date +%s`
runtime=$((end-start))
echo "dump cost $runtime seconds"
.github/scripts/save_benchmark.sh --category load_dump --name dump_big_dir --result $runtime --meta $META --storage file
.github/scripts/save_benchmark.sh --name dump_big_dir --result $runtime --meta $META --storage file
./juicefs mount $META_URL /jfs -d --no-usage-report
df -i /jfs
inode=$(df -i /jfs | grep JuiceFS |awk -F" " '{print $3}')
Expand All @@ -89,7 +89,7 @@ test_list_with_big_dir(){
runtime=$((end-start))
echo "list cost $runtime seconds"
version=$(./juicefs -V|cut -b 17- | sed 's/:/-/g')
.github/scripts/save_benchmark.sh --category list --name list_big_dir --result $runtime --meta $META --storage file
.github/scripts/save_benchmark.sh --name list_big_dir --result $runtime --meta $META --storage file
if [ "$file_count" -ne "1000001" ]; then
echo "<FATAL>: file_count error: $file_count"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/fio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ echo bandwidth is $bandwidth
meta=$(echo $meta_url | awk -F: '{print $1}')
echo meta is $meta
[[ -z "$meta" ]] && echo "meta is empty" && exit 1
.github/scripts/save_benchmark.sh --category fio --name $name --result $bandwidth --meta $meta --storage minio
.github/scripts/save_benchmark.sh --name $name --result $bandwidth --meta $meta --storage minio
11 changes: 5 additions & 6 deletions .github/scripts/save_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ save_benchmark(){
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--category)
category="$2"
shift
;;
--name)
name="$2"
shift
Expand Down Expand Up @@ -43,7 +39,7 @@ save_benchmark(){
created_date=$(date +"%Y-%m-%d")
cat <<EOF > result.json
{
"category": "$category",
"workflow": "$GITHUB_WORKFLOW",
"name": "$name",
"result": "$result",
"meta": "$meta",
Expand All @@ -59,7 +55,10 @@ save_benchmark(){
}
EOF
cat result.json
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY ./juicefs sync --force-update result.json s3://juicefs-ci-aws.s3.us-east-1.amazonaws.com/ci-report/$category/$name/$created_date/$meta-$storage.json
if [[ "$GITHUB_EVENT_NAME" == "schedule" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
echo "save benchmark"
AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY ./juicefs sync --force-update result.json s3://juicefs-ci-aws.s3.us-east-1.amazonaws.com/ci-report/$GITHUB_WORKFLOW/$name/$created_date/$meta-$storage.json
fi
}

save_benchmark $@
2 changes: 0 additions & 2 deletions .github/workflows/fio_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ on:
jobs:
fio_benchmark:
timeout-minutes: 30
if: github.repository == 'juicedata/juicefs'
runs-on: [ubuntu-20.04]

strategy:
fail-fast: false
matrix:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:

load:
timeout-minutes: 30
if: github.repository == 'juicedata/juicefs'
needs: [build-matrix]
strategy:
fail-fast: false
Expand Down

0 comments on commit 8a954e2

Please sign in to comment.