Skip to content

Commit

Permalink
Bump infinity to v0.5.0-dev5 (#3520)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

Bump infinity to v0.5.0-dev5

### Type of change

- [x] Refactoring
  • Loading branch information
yuzhichang authored Nov 25, 2024
1 parent e5af18d commit 08ead81
Show file tree
Hide file tree
Showing 12 changed files with 367 additions and 327 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ COPY cl100k_base.tiktoken /ragflow/9b5ad71b2ce5302211f9c61530b329a4922fc6a4
# Add dependencies of selenium
RUN --mount=type=bind,source=chrome-linux64-121-0-6167-85,target=/chrome-linux64.zip \
unzip /chrome-linux64.zip && \
mv chrome-linux64 /opt/chrome/ && \
mv chrome-linux64 /opt/chrome && \
ln -s /opt/chrome/chrome /usr/local/bin/
RUN --mount=type=bind,source=chromedriver-linux64-121-0-6167-85,target=/chromedriver-linux64.zip \
unzip -j /chromedriver-linux64.zip chromedriver-linux64/chromedriver && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ COPY cl100k_base.tiktoken /ragflow/9b5ad71b2ce5302211f9c61530b329a4922fc6a4
# Add dependencies of selenium
RUN --mount=type=bind,source=chrome-linux64-121-0-6167-85,target=/chrome-linux64.zip \
unzip /chrome-linux64.zip && \
mv chrome-linux64 /opt/chrome/ && \
mv chrome-linux64 /opt/chrome && \
ln -s /opt/chrome/chrome /usr/local/bin/
RUN --mount=type=bind,source=chromedriver-linux64-121-0-6167-85,target=/chromedriver-linux64.zip \
unzip -j /chromedriver-linux64.zip chromedriver-linux64/chromedriver && \
Expand Down
6 changes: 3 additions & 3 deletions api/apps/system_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ def status():
res = {}
st = timer()
try:
res["doc_store"] = settings.docStoreConn.health()
res["doc_store"]["elapsed"] = "{:.1f}".format((timer() - st) * 1000.0)
res["doc_engine"] = settings.docStoreConn.health()
res["doc_engine"]["elapsed"] = "{:.1f}".format((timer() - st) * 1000.0)
except Exception as e:
res["doc_store"] = {
res["doc_engine"] = {
"type": "unknown",
"status": "red",
"elapsed": "{:.1f}".format((timer() - st) * 1000.0),
Expand Down
7 changes: 4 additions & 3 deletions api/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ def read_config(conf_name=SERVICE_CONF):


def show_configs():
logging.info(f"Current configs, from {conf_realpath(SERVICE_CONF)}:")
msg = f"Current configs, from {conf_realpath(SERVICE_CONF)}:"
for k, v in CONFIGS.items():
logging.info(f"{k}: {v}")
msg += f"\n\t{k}: {v}"
logging.info(msg)


def get_base_config(key, default=None):
Expand Down Expand Up @@ -253,7 +254,7 @@ def get_interface_ip(ifname):
try:
ip = get_interface_ip(ifname)
break
except IOError as e:
except IOError:
pass
return ip or ''

Expand Down
3 changes: 3 additions & 0 deletions conf/service_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ es:
hosts: 'http://es01:1200'
username: 'elastic'
password: 'infini_rag_flow'
infinity:
uri: 'http://infinity:23817'
db_name: 'default_db'
redis:
db: 1
password: 'infini_rag_flow'
Expand Down
3 changes: 3 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ KIBANA_PASSWORD=infini_rag_flow
# Update it according to the available memory in the host machine.
MEM_LIMIT=8073741824

# The hostname where the Infinity service is exposed
INFINITY_HOST=infinity

# Port to expose Infinity API to the host
INFINITY_THRIFT_PORT=23817
INFINITY_HTTP_PORT=23820
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
container_name: ragflow-infinity
profiles:
- infinity
image: infiniflow/infinity:v0.5.0-dev2
image: infiniflow/infinity:v0.5.0-dev5
volumes:
- infinity_data:/var/infinity
ports:
Expand Down
3 changes: 3 additions & 0 deletions docker/service_conf.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ es:
hosts: 'http://${ES_HOST:-es01}:9200'
username: '${ES_USER:-elastic}'
password: '${ELASTIC_PASSWORD:-infini_rag_flow}'
infinity:
uri: '${INFINITY_HOST:-infinity}:23817'
db_name: 'default_db'
redis:
db: 1
password: '${REDIS_PASSWORD:-infini_rag_flow}'
Expand Down
649 changes: 338 additions & 311 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ hanziconv = "0.3.2"
html-text = "0.6.2"
httpx = "0.27.0"
huggingface-hub = "^0.25.0"
infinity-sdk = "0.5.0.dev2"
infinity-sdk = "0.5.0.dev5"
infinity-emb = "^0.0.66"
itsdangerous = "2.1.2"
markdown = "3.6"
Expand Down
11 changes: 7 additions & 4 deletions rag/utils/infinity_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from infinity.common import ConflictType, InfinityException, SortType
from infinity.index import IndexInfo, IndexType
from infinity.connection_pool import ConnectionPool
from infinity.errors import ErrorCode
from rag import settings
from rag.utils import singleton
import polars as pl
Expand Down Expand Up @@ -61,10 +62,13 @@ def __init__(self):
try:
connPool = ConnectionPool(infinity_uri)
inf_conn = connPool.get_conn()
_ = inf_conn.show_current_node()
res = inf_conn.show_current_node()
connPool.release_conn(inf_conn)
self.connPool = connPool
break
if res.error_code == ErrorCode.OK and res.server_status=="started":
break
logging.warn(f"Infinity status: {res.server_status}. Waiting Infinity {infinity_uri} to be healthy.")
time.sleep(5)
except Exception as e:
logging.warning(f"{str(e)}. Waiting Infinity {infinity_uri} to be healthy.")
time.sleep(5)
Expand All @@ -89,10 +93,9 @@ def health(self) -> dict:
inf_conn = self.connPool.get_conn()
res = inf_conn.show_current_node()
self.connPool.release_conn(inf_conn)
color = "green" if res.error_code == 0 else "red"
res2 = {
"type": "infinity",
"status": f"{res.role} {color}",
"status": "green" if res.error_code == 0 and res.server_status == "started" else "red",
"error": res.error_msg,
}
return res2
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/user-setting/setting-system/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum Status {
}

const TitleMap = {
doc_store: 'Elasticsearch',
doc_engine: 'Doc Engine',
storage: 'Object Storage',
redis: 'Redis',
database: 'Database',
Expand All @@ -33,7 +33,7 @@ const TitleMap = {

const IconMap = {
es: 'es',
doc_store: 'storage',
doc_engine: 'storage',
redis: 'redis',
storage: 'minio',
database: 'database',
Expand Down

0 comments on commit 08ead81

Please sign in to comment.