Skip to content
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

First pass at OpenSearch locally #348

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 14 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@ volumes:
postgres:
services:
elasticsearch:
build: ./elasticsearch
build: ./opensearch
ports:
- "9200:9200"
environment:
discovery.type: single-node
transport.host: 127.0.0.1
xpack.security.enabled: "false"
plugins.security.disabled: "true"
# xpack.security.enabled: "false"
volumes:
- "elasticsearch:/usr/share/elasticsearch/data"
kibana:
image: docker.elastic.co/kibana/kibana:7.9.2
ports:
- "5601:5601"
depends_on:
- elasticsearch
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
- "elasticsearch:/usr/share/opensearch/data"
# kibana:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assume kibana is no longer needed ... what were we using it for with ES?

# image: docker.elastic.co/kibana/kibana:7.9.2
# ports:
# - "5601:5601"
# depends_on:
# - elasticsearch
# environment:
# ELASTICSEARCH_URL: http://elasticsearch:9200
redis:
image: redis:5
ports:
Expand Down Expand Up @@ -141,10 +142,10 @@ services:
- ".:/app"
depends_on:
- postgres
- kibana
# - kibana
- redis
# - video
# - xlm_r_bert_base_nli_stsb_mean_tokens
# - indian_sbert
env_file:
- .env_file
- .env_file
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def init():
else:
raise
es.indices.put_mapping(
body=json.load(open('./elasticsearch/alegre_similarity.json')),
body=json.load(open('./opensearch/alegre_similarity.json')),
# include_type_name=True,
index=app.config['ELASTICSEARCH_SIMILARITY']
)
Expand Down
4 changes: 4 additions & 0 deletions opensearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM opensearchproject/opensearch:2
RUN echo y | bin/opensearch-plugin install analysis-icu
RUN echo y | bin/opensearch-plugin install repository-s3

14 changes: 8 additions & 6 deletions opensearch/alegre_similarity.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"mappings": {
"properties": {
"vector_768": {
"type": "knn_vector",
Expand All @@ -9,10 +8,6 @@
"type": "knn_vector",
"dimension": 768
},
"vector_openai-text-embedding-ada-002": {
"type": "dense_vector",
"dims": 1536
},
"vector_paraphrase-filipino-mpnet-base-v2": {
"type": "knn_vector",
"dimension": 768
Expand All @@ -21,6 +16,14 @@
"type": "knn_vector",
"dimension": 768
},
"vector_paraphrase-multilingual-mpnet-base-v2": {
computermacgyver marked this conversation as resolved.
Show resolved Hide resolved
"type": "knn_vector",
"dimension": 768
},
"vector_openai-text-embedding-ada-002": {
"type": "knn_vector",
"dimension": 1536
},
"content": {
"type": "text"
},
Expand All @@ -32,7 +35,6 @@
},
"model": {
"type": "keyword"
}
}
}
}
Loading