Skip to content

Commit cbe4c83

Browse files
Fixed docker permissions on results folder. (#33)
* Add comprehensive Docker CI/CD pipeline - Enhanced Dockerfile with multi-stage build and security best practices - Added Docker build, run, and test scripts with Redis-specific configurations - Created GitHub Actions workflows for PR validation, master publishing, and release publishing - Added docker-compose.yml for local development with Redis - Updated documentation with Docker usage examples - Configured for redis-performance/vector-db-benchmark Docker Hub repository - Default configuration: engines=redis, dataset=random-100, experiment=redis-m-16-ef-64 - Multi-platform support (linux/amd64, linux/arm64) - Security scanning with Trivy for releases * Update Docker workflows for update-redisearch default branch - Updated PR validation to trigger on update-redisearch branch - Updated publishing workflow to use update-redisearch branch instead of master - Updated Docker tags to use update-redisearch-{sha} format - Updated documentation to reflect correct default branch * Corrected docker repo, base branch, and test-image of redis. * fixed missing redis container * feat: enhance benchmark functionality with dataset discovery, validation, and performance monitoring - Add --describe command for datasets and engines with columnar display - Implement real-time performance summaries (QPS, P50/P95 latency) - Add comprehensive dataset validation system with GitHub Actions - Complete dataset metadata with vector_count and description fields - Improve download reliability with proper HTTP headers - Standardize precision formatting (0.01 increments up to 0.97, then 0.0025) - Enhanced Docker configurations for better Redis testing defaults - Add validation documentation and automated CI/CD checks This maintains backward compatibility while significantly improving usability, data quality, and performance insights for vector database benchmarking. * Moved validate and update datasets to scripts folder * Moved validate and update datasets to scripts folder * fix: use Poetry with --no-root flag for GitHub Action dependencies - Add Poetry installation to validate-datasets workflow - Use --no-root to install dependencies without packaging the project - Run validation script with 'poetry run' to access all dependencies - Fixes ModuleNotFoundError for stopit and other dependencies when testing --describe functionality * Added boto3 dependency * Added basic test for RediSearch * Updated deps to work for python 3.12. fixed deprecation warnings * Updated poetry lock * Adding redis-tools to the verify step (redis-cli) * Adding python3 3.13 to the test matrix * Using random-100 for faster testing * Updated poetry lock * Using random-100 for faster testing * Added Redis Vector Sets checks on CI * Fixed docker permissions on results folder. --------- Co-authored-by: fcostaoliveira <filipe@redis.com>
1 parent ad7d53d commit cbe4c83

File tree

2 files changed

+41
-29
lines changed

2 files changed

+41
-29
lines changed

Dockerfile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ RUN apt-get update && apt-get install -y \
6363
wget \
6464
&& rm -rf /var/lib/apt/lists/*
6565

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

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

8077
# Create directories with proper permissions
8178
RUN mkdir -p /app/results /app/datasets && \
82-
chown -R appuser:appgroup /app && \
79+
80+
chmod -R 777 /app/results /app/datasets && \
8381
chmod -R 755 /app
8482

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

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

95102
# Set entrypoint
96-
ENTRYPOINT ["python"]
103+
104+
ENTRYPOINT ["/app/entrypoint.sh"]
105+
97106

98107
# Default command (show help)
99108
CMD ["run.py", "--help"]

README.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,16 @@ docker pull filipe958/vector-db-benchmark:latest
8484
# Run with help
8585
docker run --rm filipe958/vector-db-benchmark:latest run.py --help
8686

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

91-
# With results output (mount current directory)
88+
# Basic Redis benchmark with local Redis (recommended)
9289
docker run --rm -v $(pwd)/results:/app/results --network=host \
9390
filipe958/vector-db-benchmark:latest \
94-
run.py --host localhost --engines redis --dataset random-100 --experiment redis-default-simple
91+
run.py --host localhost --engines redis-default-simple --dataset random-100
92+
93+
# Without results output
94+
docker run --rm --network=host filipe958/vector-db-benchmark:latest \
95+
run.py --host localhost --engines redis-default-simple --dataset random-100
96+
9597
```
9698

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

105107
# Run benchmark against Redis
106-
docker run --rm --network=host filipe958/vector-db-benchmark:latest \
107-
run.py --host localhost --engines redis --dataset random-100 --experiment redis-default-simple
108+
109+
docker run --rm -v $(pwd)/results:/app/results --network=host \
110+
filipe958/vector-db-benchmark:latest \
111+
run.py --host localhost --engines redis-default-simple --dataset random-100
108112

109113
# Or use the convenience script
110-
./docker-run.sh -H localhost -e redis -d random-100 -x redis-default-simple
114+
./docker-run.sh -H localhost -e redis-default-simple -d random-100
115+
111116

112117
# Clean up Redis container when done
113118
docker stop redis-test && docker rm redis-test
@@ -149,20 +154,18 @@ poetry install
149154
Run the benchmark:
150155

151156
```bash
152-
Usage: run.py [OPTIONS]
153-
154-
Example: python3 -m run --engines *-m-16-* --datasets glove-*
155-
156-
Options:
157-
--engines TEXT [default: *]
158-
--datasets TEXT [default: *]
159-
--host TEXT [default: localhost]
160-
--skip-upload / --no-skip-upload
161-
[default: no-skip-upload]
162-
--install-completion Install completion for the current shell.
163-
--show-completion Show completion for the current shell, to
164-
copy it or customize the installation.
165-
--help Show this message and exit.
157+
# Basic usage examples
158+
python run.py --engines redis-default-simple --dataset random-100
159+
python run.py --engines redis-default-simple --dataset glove-25-angular
160+
python run.py --engines "*-m-16-*" --dataset "glove-*"
161+
162+
# Docker usage (recommended)
163+
docker run --rm -v $(pwd)/results:/app/results --network=host \
164+
filipe958/vector-db-benchmark:latest \
165+
run.py --host localhost --engines redis-default-simple --dataset random-100
166+
167+
# Get help
168+
python run.py --help
166169
```
167170

168171
Command allows you to specify wildcards for engines and datasets.

0 commit comments

Comments
 (0)