-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/vectornguyen76/search-en…
…gine-shopee into develop
- Loading branch information
Showing
13 changed files
with
338 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,63 @@ | ||
version: "3" | ||
services: | ||
triton-server: | ||
container_name: triton-server | ||
image: nvcr.io/nvidia/tritonserver:23.09-py3 | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:7.10.0 | ||
container_name: elasticsearch | ||
environment: | ||
- node.name=elasticsearch | ||
- cluster.name=es-docker-cluster | ||
- discovery.type=single-node | ||
- bootstrap.memory_lock=true | ||
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" | ||
ulimits: | ||
memlock: | ||
soft: -1 | ||
hard: -1 | ||
ports: | ||
- 9000:8000 | ||
- 9001:8001 | ||
- 9002:8002 | ||
command: tritonserver --model-repository=/models | ||
- 9200:9200 | ||
healthcheck: | ||
test: curl --fail http://localhost:9200/_cat/health || exit 1 | ||
interval: 10s | ||
timeout: 1s | ||
retries: 10 | ||
volumes: | ||
- ./image-search-engine/model_repository:/models | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: 1 | ||
capabilities: [gpu] | ||
- data-elastic-search:/usr/share/elasticsearch/data | ||
|
||
qdrant-vector-database: | ||
container_name: qdrant-vector-database | ||
image: qdrant/qdrant:v1.5.1 | ||
kibana: | ||
image: docker.elastic.co/kibana/kibana:7.10.0 | ||
container_name: kibana | ||
ports: | ||
- 6333:6333 | ||
- 6334:6334 | ||
volumes: | ||
- ./qdrant-vector-database:/qdrant/storage | ||
- 5601:5601 | ||
environment: | ||
ELASTICSEARCH_URL: http://elasticsearch:9200 | ||
ELASTICSEARCH_HOSTS: http://elasticsearch:9200 | ||
depends_on: | ||
elasticsearch: | ||
condition: service_healthy | ||
|
||
image-search-engine: | ||
container_name: image-search-container | ||
image: vectornguyen76/image-search-engine | ||
text-search-engine: | ||
container_name: text-search-container | ||
image: vectornguyen76/text-search-engine | ||
build: | ||
context: ./image-search-engine | ||
context: ./text-search-engine | ||
dockerfile: Dockerfile | ||
environment: | ||
- QDRANT_URL=http://qdrant-vector-database:6334 | ||
- TRITON_SERVER_URL=triton-server:8001 | ||
ports: | ||
- 7000:7000 | ||
volumes: | ||
- ./image-search-engine/logs:/app/logs | ||
- 8000:8000 | ||
environment: | ||
ELASTICSEARCH_HOST: http://elasticsearch:9200 | ||
depends_on: | ||
- qdrant-vector-database | ||
elasticsearch: | ||
condition: service_healthy | ||
|
||
# image-search-engine-gpu: | ||
# container_name: image-search-container-gpu | ||
# image: vectornguyen76/image-search-engine-gpu | ||
# build: | ||
# context: ./image-search-engine | ||
# dockerfile: Dockerfile.gpu | ||
# environment: | ||
# - QDRANT_URL=http://qdrant-vector-database:6334 | ||
# - TRITON_SERVER_URL=triton-server:8001 | ||
# ports: | ||
# - 7000:7000 | ||
# volumes: | ||
# - ./image-search-engine/logs:/app/logs | ||
# depends_on: | ||
# - qdrant-vector-database | ||
# deploy: | ||
# resources: | ||
# reservations: | ||
# devices: | ||
# - driver: nvidia | ||
# count: 1 | ||
# capabilities: [gpu] | ||
frontend_service: | ||
container_name: frontend_prod_container | ||
image: vectornguyen76/frontend_prod_image | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile | ||
ports: | ||
- 3000:3000 | ||
|
||
volumes: | ||
qdrant-vector-database: | ||
data-elastic-search: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
from src.faiss_search.ingest_data import FaissIngest | ||
from src.utils import LOGGER | ||
|
||
# Create an instance of FaissIngest | ||
faiss_ingest = FaissIngest() | ||
|
||
if faiss_ingest.check_index_exists(): | ||
LOGGER.info("Faiss index already exists!") | ||
else: | ||
# Create and save the Faiss index | ||
faiss_ingest.create_index() | ||
|
||
def main(): | ||
""" | ||
Main function to perform QdrantIngest data ingestion. | ||
""" | ||
# Create an instance of FaissIngest | ||
faiss_ingest = FaissIngest() | ||
|
||
if faiss_ingest.check_index_exists(): | ||
LOGGER.info("Index in Faiss already exists!") | ||
else: | ||
LOGGER.info("Create Index in Faiss!") | ||
|
||
# Create and save the Faiss index | ||
faiss_ingest.create_index() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
from src.qdrant_search.ingest_data import QdrantIngest | ||
from src.utils import LOGGER | ||
|
||
# Instantiate the QdrantIngest class | ||
qdrant_ingest = QdrantIngest() | ||
|
||
try: | ||
response = qdrant_ingest.check_collection() | ||
if response.result.status == 1: | ||
LOGGER.info("Collection already exists!") | ||
except Exception as e: | ||
LOGGER.info(f"Error checking collection: {e}") | ||
def main(): | ||
""" | ||
Main function to perform QdrantIngest data ingestion. | ||
""" | ||
qdrant_ingest = QdrantIngest() | ||
|
||
LOGGER.info("Create collection!") | ||
response = qdrant_ingest.create_collection() | ||
LOGGER.info(response) | ||
try: | ||
response = qdrant_ingest.check_collection() | ||
if response.result.status == 1: | ||
LOGGER.info("Collection already exists!") | ||
except Exception as e: | ||
LOGGER.info(f"Error checking collection: {e}") | ||
|
||
qdrant_ingest.add_points() | ||
LOGGER.info("Create collection!") | ||
response = qdrant_ingest.create_collection() | ||
LOGGER.info(response) | ||
|
||
qdrant_ingest.add_points() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.