Skip to content

Fixed docker permissions on results folder. #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jul 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b091596
Add comprehensive Docker CI/CD pipeline
fcostaoliveira Jul 12, 2025
dd2acd4
Update Docker workflows for update-redisearch default branch
fcostaoliveira Jul 12, 2025
335c89c
Corrected docker repo, base branch, and test-image of redis.
fcostaoliveira Jul 12, 2025
3a645f2
fixed missing redis container
fcostaoliveira Jul 12, 2025
8589885
feat: enhance benchmark functionality with dataset discovery, validat…
fcostaoliveira Jul 13, 2025
9527372
Moved validate and update datasets to scripts folder
fcostaoliveira Jul 13, 2025
25b5740
Moved validate and update datasets to scripts folder
fcostaoliveira Jul 13, 2025
5d12a92
fix: use Poetry with --no-root flag for GitHub Action dependencies
fcostaoliveira Jul 13, 2025
3ed2524
Added boto3 dependency
fcostaoliveira Jul 13, 2025
3b02664
Added basic test for RediSearch
fcostaoliveira Jul 13, 2025
8815056
Updated deps to work for python 3.12. fixed deprecation warnings
fcostaoliveira Jul 13, 2025
7c63b07
Updated poetry lock
fcostaoliveira Jul 13, 2025
6a73fff
Adding redis-tools to the verify step (redis-cli)
fcostaoliveira Jul 13, 2025
342f925
Adding python3 3.13 to the test matrix
fcostaoliveira Jul 13, 2025
81fa384
Using random-100 for faster testing
fcostaoliveira Jul 13, 2025
26c01d0
Updated poetry lock
fcostaoliveira Jul 13, 2025
cdce55d
Using random-100 for faster testing
fcostaoliveira Jul 13, 2025
a404448
Added Redis Vector Sets checks on CI
fcostaoliveira Jul 13, 2025
58bf9fc
Fixed docker permissions on results folder.
fcostaoliveira Jul 13, 2025
c600b92
Merge remote-tracking branch 'origin/update.redisearch' into docker.u…
fcostaoliveira Jul 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ RUN apt-get update && apt-get install -y \
wget \
&& rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN groupadd -g 1001 -r appgroup && \
useradd -u 1001 -r -g appgroup appuser

# Set working directory
WORKDIR /app
Expand All @@ -79,11 +76,21 @@ COPY --from=builder /code /app

# Create directories with proper permissions
RUN mkdir -p /app/results /app/datasets && \
chown -R appuser:appgroup /app && \

chmod -R 777 /app/results /app/datasets && \
chmod -R 755 /app

# Switch to non-root user
USER appuser
# Create entrypoint script to handle user permissions
RUN echo '#!/bin/bash\n\
# Handle user permissions for volume mounts\n\
if [ "$1" = "run.py" ]; then\n\
# Ensure results directory is writable\n\
mkdir -p /app/results\n\
chmod 777 /app/results\n\
fi\n\
exec python "$@"' > /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh


# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
Expand All @@ -93,7 +100,9 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
EXPOSE 6379 6380

# Set entrypoint
ENTRYPOINT ["python"]

ENTRYPOINT ["/app/entrypoint.sh"]


# Default command (show help)
CMD ["run.py", "--help"]
Expand Down
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,16 @@ docker pull filipe958/vector-db-benchmark:latest
# Run with help
docker run --rm filipe958/vector-db-benchmark:latest run.py --help

# Basic Redis benchmark with local Redis
docker run --rm --network=host filipe958/vector-db-benchmark:latest \
run.py --host localhost --engines redis --dataset random-100 --experiment redis-default-simple

# With results output (mount current directory)
# Basic Redis benchmark with local Redis (recommended)
docker run --rm -v $(pwd)/results:/app/results --network=host \
filipe958/vector-db-benchmark:latest \
run.py --host localhost --engines redis --dataset random-100 --experiment redis-default-simple
run.py --host localhost --engines redis-default-simple --dataset random-100

# Without results output
docker run --rm --network=host filipe958/vector-db-benchmark:latest \
run.py --host localhost --engines redis-default-simple --dataset random-100

```

### Using with Redis
Expand All @@ -103,11 +105,14 @@ For testing with Redis, start a Redis container first:
docker run -d --name redis-test -p 6379:6379 redis:8.2-rc1-bookworm

# Run benchmark against Redis
docker run --rm --network=host filipe958/vector-db-benchmark:latest \
run.py --host localhost --engines redis --dataset random-100 --experiment redis-default-simple

docker run --rm -v $(pwd)/results:/app/results --network=host \
filipe958/vector-db-benchmark:latest \
run.py --host localhost --engines redis-default-simple --dataset random-100

# Or use the convenience script
./docker-run.sh -H localhost -e redis -d random-100 -x redis-default-simple
./docker-run.sh -H localhost -e redis-default-simple -d random-100


# Clean up Redis container when done
docker stop redis-test && docker rm redis-test
Expand Down Expand Up @@ -149,20 +154,18 @@ poetry install
Run the benchmark:

```bash
Usage: run.py [OPTIONS]

Example: python3 -m run --engines *-m-16-* --datasets glove-*

Options:
--engines TEXT [default: *]
--datasets TEXT [default: *]
--host TEXT [default: localhost]
--skip-upload / --no-skip-upload
[default: no-skip-upload]
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to
copy it or customize the installation.
--help Show this message and exit.
# Basic usage examples
python run.py --engines redis-default-simple --dataset random-100
python run.py --engines redis-default-simple --dataset glove-25-angular
python run.py --engines "*-m-16-*" --dataset "glove-*"

# Docker usage (recommended)
docker run --rm -v $(pwd)/results:/app/results --network=host \
filipe958/vector-db-benchmark:latest \
run.py --host localhost --engines redis-default-simple --dataset random-100

# Get help
python run.py --help
```

Command allows you to specify wildcards for engines and datasets.
Expand Down