Skip to content

Add sync_writes option to flush every commit to object storage before returning #882

Add sync_writes option to flush every commit to object storage before returning

Add sync_writes option to flush every commit to object storage before returning #882

Workflow file for this run

name: stress-ng
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
stress-ng-nfs:
name: Run stress-ng test on NFS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Start MinIO
run: |
docker run -d \
--name minio \
-p 9000:9000 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data
# Wait for MinIO to be ready
for i in {1..30}; do
if curl -f http://localhost:9000/minio/health/live; then
echo "MinIO is ready"
break
fi
sleep 1
done
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y nfs-common stress-ng
- name: Setup MinIO bucket
run: |
# Install mc (MinIO client)
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc alias set myminio http://localhost:9000 minioadmin minioadmin
./mc mb myminio/zerofs-stress-test || true
- name: Build ZeroFS
working-directory: zerofs
run: cargo build --profile ci
- name: Start ZeroFS
working-directory: zerofs
run: |
# Create cache directory
mkdir -p /tmp/zerofs-cache
# Create ZeroFS configuration
cat > zerofs-ci.toml << EOF
[cache]
dir = "/tmp/zerofs-cache"
disk_size_gb = 1.0
memory_size_gb = 2.0
[storage]
url = "s3://zerofs-stress-test/test"
encryption_password = "test-password-123"
[servers.nfs]
addresses = ["127.0.0.1:2049"]
[aws]
access_key_id = "minioadmin"
secret_access_key = "minioadmin"
endpoint = "http://localhost:9000"
allow_http = "true"
[telemetry]
enabled = false
EOF
# Start ZeroFS in the background
./target/ci/zerofs run -c zerofs-ci.toml &
# Wait for ZeroFS to start
echo "Waiting for ZeroFS to start..."
for i in {1..30}; do
if nc -z 127.0.0.1 2049; then
echo "ZeroFS is ready"
break
fi
sleep 1
done
# Verify ZeroFS is running
if ! nc -z 127.0.0.1 2049; then
echo "ZeroFS failed to start"
exit 1
fi
- name: Mount NFS
run: |
# Create mount point
sudo mkdir -p /mnt/zerofs-nfs
# Mount ZeroFS via NFS
sudo mount -t nfs -o vers=3,async,nolock,tcp,port=2049,mountport=2049,hard 127.0.0.1:/ /mnt/zerofs-nfs
# Verify mount
mount | grep zerofs
- name: Run stress-ng test
run: |
cd /mnt/zerofs-nfs
sudo stress-ng --access 1 --chdir 1 --chmod 1 --chown 1 \
--dentry 1 --dir 1 --dirdeep 1 --dirmany 1 --dup 1 --eventfd 1 \
--fd-fork 1 --filename 1 --fstat 1 \
--getdent 1 --link 1 \
--metamix 1 --open 1 --rename 1 --symlink 1 \
--touch 1 --utime 1 --timeout 60s
- name: Cleanup
if: always()
run: |
# Unmount
sudo umount /mnt/zerofs-nfs || true
# Kill ZeroFS
pkill -f "zerofs run -c zerofs-ci.toml" || true
stress-ng-9p:
name: Run stress-ng fstat test on 9P
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Start MinIO
run: |
docker run -d \
--name minio \
-p 9000:9000 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data
# Wait for MinIO to be ready
for i in {1..30}; do
if curl -f http://localhost:9000/minio/health/live; then
echo "MinIO is ready"
break
fi
sleep 1
done
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y stress-ng
# Check if 9p kernel module is available
sudo modprobe 9p
sudo modprobe 9pnet
sudo modprobe 9pnet_virtio
# List loaded 9p modules
lsmod | grep 9p || echo "No 9p modules loaded yet"
- name: Setup MinIO bucket
run: |
# Install mc (MinIO client)
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
./mc alias set myminio http://localhost:9000 minioadmin minioadmin
./mc mb myminio/zerofs-stress-test || true
- name: Build ZeroFS
working-directory: zerofs
run: cargo build --profile ci
- name: Start ZeroFS with 9P support
working-directory: zerofs
run: |
# Create cache directory
mkdir -p /tmp/zerofs-cache
# Create ZeroFS configuration
cat > zerofs-ci.toml << EOF
[cache]
dir = "/tmp/zerofs-cache"
disk_size_gb = 1.0
memory_size_gb = 2.0
[storage]
url = "s3://zerofs-stress-test/test"
encryption_password = "test-password-123"
[servers.ninep]
addresses = ["127.0.0.1:5564"]
[aws]
access_key_id = "minioadmin"
secret_access_key = "minioadmin"
endpoint = "http://localhost:9000"
allow_http = "true"
[telemetry]
enabled = false
EOF
# Start ZeroFS in the background with 9P enabled
./target/ci/zerofs run -c zerofs-ci.toml &
# Wait for ZeroFS to start (9P runs on port 5564)
echo "Waiting for ZeroFS 9P server to start..."
for i in {1..30}; do
if nc -z 127.0.0.1 5564 2>/dev/null; then
echo "ZeroFS 9P server is ready"
break
fi
sleep 1
done
# Verify ZeroFS is running
if ! nc -z 127.0.0.1 5564 2>/dev/null; then
echo "ZeroFS 9P server failed to start"
exit 1
fi
- name: Mount 9P filesystem
run: |
# Create mount point
sudo mkdir -p /mnt/zerofs-9p
# Mount ZeroFS via 9P using v9fs
sudo mount -t 9p -o trans=tcp,port=5564,version=9p2000.L,access=user 127.0.0.1 /mnt/zerofs-9p
# Verify mount
mount | grep zerofs-9p
- name: Run stress-ng fstat test
run: |
cd /mnt/zerofs-9p
sudo stress-ng --access 1 --chdir 1 --chmod 1 --chown 1 \
--dentry 1 --dir 1 --dirdeep 1 --dirmany 1 --dup 1 --eventfd 1 \
--fd-fork 1 --filename 1 --fstat 1 \
--getdent 1 --link 1 \
--metamix 1 --open 1 --rename 1 --symlink 1 \
--touch 1 --utime 1 --timeout 60s
- name: Cleanup
if: always()
run: |
# Unmount
sudo umount /mnt/zerofs-9p || true
# Kill ZeroFS
pkill -f "zerofs run -c zerofs-ci.toml" || true