Skip to content

Retry processing #698

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

Merged
merged 55 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e1a76bd
Remove TotalPages when save file on local (#684)
praveshkumar1988 Aug 12, 2024
837d1fa
file_name reference and verify_ssl issue fixed (#683)
praveshkumar1988 Aug 12, 2024
65b8121
User flow changes for recreating supported vector index (#682)
kartikpersistent Aug 12, 2024
826246b
Remove TotalPages when save file on local (#684)
praveshkumar1988 Aug 12, 2024
06b3607
file_name reference and verify_ssl issue fixed (#683)
praveshkumar1988 Aug 12, 2024
c3c9693
User flow changes for recreating supported vector index (#682)
kartikpersistent Aug 12, 2024
6dcfe4c
Reapply "Dockerfile changes with VITE label"
prakriti-solankey Aug 13, 2024
3dde004
Revert "Dockerfile changes with VITE label"
prakriti-solankey Aug 13, 2024
6cf14f6
Merge remote-tracking branch 'refs/remotes/origin/DEV' into DEV
praveshkumar1988 Aug 13, 2024
c075cae
Concurrent processing of files (#665)
kartikpersistent Aug 13, 2024
5d27855
env changes
kartikpersistent Aug 13, 2024
934ba4e
format fixes
kartikpersistent Aug 13, 2024
341460d
set retry status
aashipandya Aug 14, 2024
6ec0682
retry processing backend
aashipandya Aug 16, 2024
3676f3a
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Aug 16, 2024
80ce09f
added the retry icon on rows
kartikpersistent Aug 16, 2024
733f5cd
vite changes in docker compose
kartikpersistent Aug 16, 2024
fe2e2fc
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Aug 16, 2024
8bacfc6
added retry dialog
kartikpersistent Aug 16, 2024
0ff604d
Integrated the Retry processing API
kartikpersistent Aug 19, 2024
97e7066
Integrated the Extract API fro retry processing
kartikpersistent Aug 19, 2024
8b854bd
Integrated ndl toast component
kartikpersistent Aug 19, 2024
7db965b
replaced foreach with normal for loop for better performance
kartikpersistent Aug 19, 2024
f86b6cc
types improvements
kartikpersistent Aug 19, 2024
39b096c
used toast component
kartikpersistent Aug 20, 2024
dabb2ed
spell fix
kartikpersistent Aug 20, 2024
e340591
Issue fixed
praveshkumar1988 Aug 20, 2024
bc8cf14
Merge remote-tracking branch 'refs/remotes/origin/retry_processing' i…
praveshkumar1988 Aug 20, 2024
7e61c8b
Merge branch 'DEV' into retry_processing
kartikpersistent Aug 21, 2024
1371e83
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
aashipandya Aug 28, 2024
c617a1b
processing changes in main
aashipandya Aug 28, 2024
8de4245
Merge branch 'retry_processing' of https://github.com/neo4j-labs/llm-…
aashipandya Aug 28, 2024
a170a8e
Merge branch 'DEV' into retry_processing
kartikpersistent Aug 28, 2024
d76baa0
Merge branch 'retry_processing' of https://github.com/neo4j-labs/llm-…
aashipandya Aug 28, 2024
7e96ec9
function closing fix
kartikpersistent Aug 28, 2024
848bfee
Merge branch 'retry_processing' of https://github.com/neo4j-labs/llm-…
aashipandya Aug 28, 2024
6720ef3
retry processing issue fixed
aashipandya Aug 28, 2024
4af58db
autoclosing the retry popup on retry api success
kartikpersistent Aug 28, 2024
9224d19
removed the retry if check
kartikpersistent Aug 29, 2024
a3809f4
Merge branch 'DEV' of https://github.com/neo4j-labs/llm-graph-builder…
kartikpersistent Aug 29, 2024
cf39373
resetting the node and relationship count on retry
kartikpersistent Aug 29, 2024
24bd4b2
added the enter key events on the popups
kartikpersistent Aug 29, 2024
9378766
fixed wikipedia icon on large file alert popup
kartikpersistent Aug 29, 2024
342762a
setting nodes to 0 and start from last processed chunk logic changes
aashipandya Aug 30, 2024
71ffcfb
Merge branch 'retry_processing' of https://github.com/neo4j-labs/llm-…
aashipandya Aug 30, 2024
c5bdb02
Retry Popup fixes
kartikpersistent Sep 3, 2024
fb4d4f5
status changes for upload failed scenario
kartikpersistent Sep 3, 2024
dd72e34
kept condition specific
aashipandya Sep 3, 2024
573b059
changed status to reprocess from retry
aashipandya Sep 3, 2024
ab5c85f
Reprocess wording changes
kartikpersistent Sep 3, 2024
a64c02f
Merge branch 'retry_processing' of https://github.com/neo4j-labs/llm-…
kartikpersistent Sep 3, 2024
a6b5ca5
tooltip changes
kartikpersistent Sep 3, 2024
69216b0
wordings and size changes
kartikpersistent Sep 4, 2024
5c997a4
Changed status to Reprocess
aashipandya Sep 4, 2024
41b4355
Merge branch 'retry_processing' of https://github.com/neo4j-labs/llm-…
aashipandya Sep 4, 2024
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
33 changes: 25 additions & 8 deletions backend/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ async def extract_knowledge_graph_from_file(
allowedNodes=Form(None),
allowedRelationship=Form(None),
language=Form(None),
access_token=Form(None)
access_token=Form(None),
retry_condition=Form(None)
):
"""
Calls 'extract_graph_from_file' in a new thread to create Neo4jGraph from a
Expand All @@ -161,30 +162,30 @@ async def extract_knowledge_graph_from_file(
merged_file_path = os.path.join(MERGED_DIR,file_name)
logging.info(f'File path:{merged_file_path}')
result = await asyncio.to_thread(
extract_graph_from_file_local_file, uri, userName, password, database, model, merged_file_path, file_name, allowedNodes, allowedRelationship)
extract_graph_from_file_local_file, uri, userName, password, database, model, merged_file_path, file_name, allowedNodes, allowedRelationship, retry_condition)

elif source_type == 's3 bucket' and source_url:
result = await asyncio.to_thread(
extract_graph_from_file_s3, uri, userName, password, database, model, source_url, aws_access_key_id, aws_secret_access_key, allowedNodes, allowedRelationship)
extract_graph_from_file_s3, uri, userName, password, database, model, source_url, aws_access_key_id, aws_secret_access_key, file_name, allowedNodes, allowedRelationship, retry_condition)

elif source_type == 'web-url':
result = await asyncio.to_thread(
extract_graph_from_web_page, uri, userName, password, database, model, source_url, allowedNodes, allowedRelationship)
extract_graph_from_web_page, uri, userName, password, database, model, source_url, file_name, allowedNodes, allowedRelationship, retry_condition)

elif source_type == 'youtube' and source_url:
result = await asyncio.to_thread(
extract_graph_from_file_youtube, uri, userName, password, database, model, source_url, allowedNodes, allowedRelationship)
extract_graph_from_file_youtube, uri, userName, password, database, model, source_url, file_name, allowedNodes, allowedRelationship, retry_condition)

elif source_type == 'Wikipedia' and wiki_query:
result = await asyncio.to_thread(
extract_graph_from_file_Wikipedia, uri, userName, password, database, model, wiki_query, max_sources, language, allowedNodes, allowedRelationship)
extract_graph_from_file_Wikipedia, uri, userName, password, database, model, wiki_query, language, file_name, allowedNodes, allowedRelationship, retry_condition)

elif source_type == 'gcs bucket' and gcs_bucket_name:
result = await asyncio.to_thread(
extract_graph_from_file_gcs, uri, userName, password, database, model, gcs_project_id, gcs_bucket_name, gcs_bucket_folder, gcs_blob_filename, access_token, allowedNodes, allowedRelationship)
extract_graph_from_file_gcs, uri, userName, password, database, model, gcs_project_id, gcs_bucket_name, gcs_bucket_folder, gcs_blob_filename, access_token, file_name, allowedNodes, allowedRelationship, retry_condition)
else:
return create_api_response('Failed',message='source_type is other than accepted source')

if result is not None:
result['db_url'] = uri
result['api_name'] = 'extract'
Expand Down Expand Up @@ -626,6 +627,22 @@ async def merge_duplicate_nodes(uri=Form(), userName=Form(), password=Form(), da
return create_api_response(job_status, message=message, error=error_message)
finally:
gc.collect()

@app.post("/retry_processing")
async def retry_processing(uri=Form(), userName=Form(), password=Form(), database=Form(), file_name=Form(), retry_condition=Form()):
try:
graph = create_graph_database_connection(uri, userName, password, database)
await asyncio.to_thread(set_status_retry, graph,file_name,retry_condition)
#set_status_retry(graph,file_name,retry_condition)
return create_api_response('Success',message=f"Status set to Reprocess for filename : {file_name}")
except Exception as e:
job_status = "Failed"
message="Unable to set status to Retry"
error_message = str(e)
logging.exception(f'{error_message}')
return create_api_response(job_status, message=message, error=error_message)
finally:
gc.collect()

if __name__ == "__main__":
uvicorn.run(app)
1 change: 1 addition & 0 deletions backend/src/entities/source_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ class sourceNode:
is_cancelled:bool=None
processed_chunk:int=None
access_token:str=None
retry_condition:str=None
11 changes: 7 additions & 4 deletions backend/src/graphDB_dataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def update_source_node(self, obj_source_node:sourceNode):
if obj_source_node.processing_time is not None and obj_source_node.processing_time != 0:
params['processingTime'] = round(obj_source_node.processing_time.total_seconds(),2)

if obj_source_node.node_count is not None and obj_source_node.node_count != 0:
if obj_source_node.node_count is not None :
params['nodeCount'] = obj_source_node.node_count

if obj_source_node.relationship_count is not None and obj_source_node.relationship_count != 0:
if obj_source_node.relationship_count is not None :
params['relationshipCount'] = obj_source_node.relationship_count

if obj_source_node.model is not None and obj_source_node.model != '':
Expand All @@ -86,11 +86,14 @@ def update_source_node(self, obj_source_node:sourceNode):
if obj_source_node.total_chunks is not None and obj_source_node.total_chunks != 0:
params['total_chunks'] = obj_source_node.total_chunks

if obj_source_node.is_cancelled is not None and obj_source_node.is_cancelled != False:
if obj_source_node.is_cancelled is not None:
params['is_cancelled'] = obj_source_node.is_cancelled

if obj_source_node.processed_chunk is not None and obj_source_node.processed_chunk != 0:
if obj_source_node.processed_chunk is not None :
params['processed_chunk'] = obj_source_node.processed_chunk

if obj_source_node.retry_condition is not None :
params['retry_condition'] = obj_source_node.retry_condition

param= {"props":params}

Expand Down
Loading