Skip to content

Commit

Permalink
refactor fio benchmark workflow (#1660)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored Mar 28, 2022
1 parent 1547bf1 commit a093860
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/fio_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on:
- cron: '0 0 * * *'
workflow_dispatch:

env:
META_URL: redis://mymaster,172.27.0.1,172.27.0.2,172.27.0.3:26379/3
MINIO_URL: http://172.27.0.2:9005/juicefs-fio-benchmark
MOUNT_POINT: /tmp/juicefs-fio-benchmark

jobs:
fio-benchmark:
runs-on: [self-hosted, daily-build]
Expand All @@ -19,30 +14,49 @@ jobs:
with:
fetch-depth: 1

- name: Set Variable
id: vars
run: |
echo ::set-output name=META_URL::redis://mymaster,172.27.0.1,172.27.0.2,172.27.0.3:26379/5
echo ::set-output name=MINIO_URL::http://172.27.0.2:9005/juicefs-fio-benchmark
echo ::set-output name=MOUNT_POINT::/tmp/juicefs-fio-benchmark
- name: Build linux target
run: make juicefs
run: |
export GOPATH=/usr/local/go
export HOME=/root
make juicefs
- name: Juicefs Format
- name: Clean Before
run: |
UUID=$(./juicefs status $META_URL | grep UUID | cut -d '"' -f 4)
if [ -d ${{ steps.vars.outputs.MOUNT_POINT }} ]; then
./juicefs umount ${{ steps.vars.outputs.MOUNT_POINT }} || true
fi
UUID=$(./juicefs status ${{ steps.vars.outputs.META_URL }} | grep UUID | cut -d '"' -f 4)
if [ -n "$UUID" ];then
sudo ./juicefs destroy $META_URL $UUID
sudo ./juicefs destroy --force ${{ steps.vars.outputs.META_URL }} $UUID
fi
sudo ./juicefs format --storage minio --bucket $MINIO_URL --access-key minioadmin --secret-key ${{ secrets.MINIO_SECRET_KEY }} $META_URL fio-benchmark
- name: Juicefs Format
run: |
sudo ./juicefs format --storage minio --bucket ${{ steps.vars.outputs.MINIO_URL }} --access-key minioadmin --secret-key ${{ secrets.MINIO_SECRET_KEY }} ${{ steps.vars.outputs.META_URL }} fio-benchmark
- name: Juicefs Mount
run: |
sudo ./juicefs mount -d $META_URL $MOUNT_POINT --no-usage-report &
sudo ./juicefs mount -d ${{ steps.vars.outputs.META_URL }} ${{ steps.vars.outputs.MOUNT_POINT }} --no-usage-report &
- name: Fio Benchmark
run: |
fio --name=sequential-read --directory=$MOUNT_POINT --rw=read --refill_buffers --bs=4M --size=1G
fio --name=sequential-read --directory=${{ steps.vars.outputs.MOUNT_POINT }} --rw=read --refill_buffers --bs=4M --size=1G
- name: Clean
- name: Clean After
run: |
UUID=$(juicefs status $META_URL | grep UUID | cut -d '"' -f 4)
if [ -d ${{ steps.vars.outputs.MOUNT_POINT }} ]; then
./juicefs umount ${{ steps.vars.outputs.MOUNT_POINT }} || true
fi
UUID=$(./juicefs status ${{ steps.vars.outputs.META_URL }} | grep UUID | cut -d '"' -f 4)
if [ -n "$UUID" ];then
sudo juicefs destroy $META_URL $UUID
sudo ./juicefs destroy --force ${{ steps.vars.outputs.META_URL }} $UUID
fi
- name: Send Slack Notification
Expand All @@ -51,6 +65,6 @@ jobs:
uses: slackapi/[email protected]
with:
channel-id: "${{ secrets.SLACK_CHANNEL_ID_FOR_PR_CHECK_NOTIFY }}"
slack-message: "@${{ github.event.pull_request.user.login}} PR Check: ${{ job.status }}\n${{ github.event.pull_request.title }}\nhttps://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
slack-message: "@${{ github.actor}} CI Check ${{ job.status }} on ${{ github.event_name }}\n${{ github.event.pull_request.title || github.event.head_commit.message }} \nhttps://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit a093860

Please sign in to comment.