e2e.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. name: "End to End"
  2. on:
  3. push:
  4. branches: [ master ]
  5. pull_request:
  6. branches: [ master ]
  7. concurrency:
  8. group: ${{ github.head_ref }}/e2e
  9. cancel-in-progress: true
  10. permissions:
  11. contents: read
  12. defaults:
  13. run:
  14. working-directory: docker
  15. jobs:
  16. e2e:
  17. name: FUSE Mount
  18. runs-on: ubuntu-22.04
  19. timeout-minutes: 30
  20. steps:
  21. - name: Set up Go 1.x
  22. uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v2
  23. with:
  24. go-version: ^1.13
  25. id: go
  26. - name: Check out code into the Go module directory
  27. uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v2
  28. - name: Set up Docker Buildx
  29. uses: docker/setup-buildx-action@v3
  30. - name: Cache Docker layers
  31. uses: actions/cache@v4
  32. with:
  33. path: /tmp/.buildx-cache
  34. key: ${{ runner.os }}-buildx-e2e-${{ github.sha }}
  35. restore-keys: |
  36. ${{ runner.os }}-buildx-e2e-
  37. - name: Install dependencies
  38. run: |
  39. # Use faster mirrors and install with timeout
  40. echo "deb http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse" | sudo tee /etc/apt/sources.list
  41. echo "deb http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
  42. sudo apt-get update --fix-missing
  43. sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends fuse
  44. # Verify FUSE installation
  45. echo "FUSE version: $(fusermount --version 2>&1 || echo 'fusermount not found')"
  46. echo "FUSE device: $(ls -la /dev/fuse 2>&1 || echo '/dev/fuse not found')"
  47. - name: Start SeaweedFS
  48. timeout-minutes: 10
  49. run: |
  50. # Enable Docker buildkit for better caching
  51. export DOCKER_BUILDKIT=1
  52. export COMPOSE_DOCKER_CLI_BUILD=1
  53. # Build with retry logic
  54. for i in {1..3}; do
  55. echo "Build attempt $i/3"
  56. if make build_e2e; then
  57. echo "Build successful on attempt $i"
  58. break
  59. elif [ $i -eq 3 ]; then
  60. echo "Build failed after 3 attempts"
  61. exit 1
  62. else
  63. echo "Build attempt $i failed, retrying in 30 seconds..."
  64. sleep 30
  65. fi
  66. done
  67. # Start services with wait
  68. docker compose -f ./compose/e2e-mount.yml up --wait
  69. - name: Run FIO 4k
  70. timeout-minutes: 15
  71. run: |
  72. echo "Starting FIO at: $(date)"
  73. # Concurrent r/w
  74. echo 'Run randrw with size=16M bs=4k'
  75. docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=4k --direct=1 --numjobs=8 --ioengine=libaio --group_reporting --runtime=30 --time_based=1
  76. echo "Verify FIO at: $(date)"
  77. # Verified write
  78. echo 'Run randwrite with size=16M bs=4k'
  79. docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=4k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
  80. - name: Run FIO 128k
  81. timeout-minutes: 15
  82. run: |
  83. echo "Starting FIO at: $(date)"
  84. # Concurrent r/w
  85. echo 'Run randrw with size=16M bs=128k'
  86. docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=128k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
  87. echo "Verify FIO at: $(date)"
  88. # Verified write
  89. echo 'Run randwrite with size=16M bs=128k'
  90. docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=128k --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
  91. - name: Run FIO 1MB
  92. timeout-minutes: 15
  93. run: |
  94. echo "Starting FIO at: $(date)"
  95. # Concurrent r/w
  96. echo 'Run randrw with size=16M bs=1m'
  97. docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randrw --bs=1m --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1
  98. echo "Verify FIO at: $(date)"
  99. # Verified write
  100. echo 'Run randwrite with size=16M bs=1m'
  101. docker compose -f ./compose/e2e-mount.yml exec mount timeout -k5 60 fio --name=fiotest --filename=/mnt/seaweedfs/fiotest --size=16M --rw=randwrite --bs=1m --direct=1 --numjobs=8 --ioengine=libaio --iodepth=32 --group_reporting --runtime=30 --time_based=1 --do_verify=0 --verify=crc32c --verify_backlog=1
  102. - name: Save logs
  103. if: always()
  104. run: |
  105. docker compose -f ./compose/e2e-mount.yml logs > output.log
  106. echo 'Showing last 500 log lines of mount service:'
  107. docker compose -f ./compose/e2e-mount.yml logs --tail 500 mount
  108. - name: Check for data races
  109. if: always()
  110. continue-on-error: true # TODO: remove this comment to enable build failure on data races (after all are fixed)
  111. run: grep -A50 'DATA RACE' output.log && exit 1 || exit 0
  112. - name: Archive logs
  113. if: always()
  114. uses: actions/upload-artifact@v4
  115. with:
  116. name: output-logs
  117. path: docker/output.log
  118. - name: Cleanup
  119. if: always()
  120. run: docker compose -f ./compose/e2e-mount.yml down --volumes --remove-orphans --rmi all