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

updated to trapi 1.5 #236

Merged
merged 7 commits into from
Apr 16, 2024
Merged

updated to trapi 1.5 #236

merged 7 commits into from
Apr 16, 2024

Conversation

cbizon
Copy link
Contributor

@cbizon cbizon commented Apr 11, 2024

While the name of the PR says promiscuity, the actual code changes are all about going to trapi 1.5

@cbizon
Copy link
Contributor Author

cbizon commented Apr 11, 2024

The failing tests, I believe are because there is not a strider/1.5 out there.

@cbizon
Copy link
Contributor Author

cbizon commented Apr 12, 2024

OK, I modified the cache as discussed this morning. The one tricky thing is that overwrite_cache defaults to False so I think we lose e.g. caching of CQS queries.

I also added logs:[] to created Responses (which happens when we make an infer response at merge time)

@@ -165,19 +174,19 @@ async def entry(message, guid, coalesce_type, caller) -> (dict, int):
# We told the world what we can do!
# Workflow will be a list of the functions, and the parameters if there are any

read_from_cache = bypass_cache or overwrite_cache
Copy link
Contributor

Choose a reason for hiding this comment

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

The name of this variable is the reverse of what it does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh shoot, thanks

results_cache.set_result(input_id, predicate, qualifiers, source_input, caller, workflow_def, final_answer)
elif {"id": "lookup"} in workflow_def or override_cache:
results_cache.set_lookup_result(workflow_def, query_graph, final_answer)
if overwrite_cache:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should instead be if not bypass_cache: because we want to save everything to cache if it wasn't in there, unless users specifically say they want to bypass the whole thing.

response = await subservice_post("strider", strider_url, message, guid, asyncquery=asyncquery, params=params)

return response


async def normalize_qgraph_ids(m):
url = f'{os.environ.get("NODENORM_URL", "https://nodenormalization-sri.renci.org/1.3/")}get_normalized_nodes'
url = f'{os.environ.get("NODENORM_URL", "https://nodenormalization-sri.renci.org/")}get_normalized_nodes'
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we confirmed with Guarav to remove the trapi version?

@@ -756,7 +830,7 @@ async def robokop_lookup(message, params, guid, infer, question_qnode, answer_qn
# For robokop, gotta normalize
message = await normalize_qgraph_ids(message)
if not infer:
kg_url = os.environ.get("ROBOKOPKG_URL", "https://automat.renci.org/robokopkg/1.4/")
kg_url = os.environ.get("ROBOKOPKG_URL", "https://automat.renci.org/robokopkg/1.5/")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the robokopkg url need to remove the trapi version?

@@ -1182,7 +1258,7 @@ async def omnicorp(message, params, guid) -> (dict, int):
with open("to_omni.json","w") as outf:
json.dump(message, outf, indent=2)

url = f'{os.environ.get("RANKER_URL", "https://aragorn-ranker.renci.org/1.4/")}omnicorp_overlay'
url = f'{os.environ.get("RANKER_URL", "https://aragorn-ranker.renci.org/1.5/")}omnicorp_overlay'
Copy link
Contributor

Choose a reason for hiding this comment

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

More trapi version urls

@@ -174,7 +173,7 @@ async def entry(message, guid, coalesce_type, caller) -> (dict, int):
# We told the world what we can do!
# Workflow will be a list of the functions, and the parameters if there are any

read_from_cache = bypass_cache or overwrite_cache
read_from_cache = not (bypass_cache or overwrite_cache)
Copy link
Contributor

Choose a reason for hiding this comment

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

So now the variable name makes sense, but the logic below is wrong. If read_from_cache is true, then we want to get cached results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oof, I'm really swimming upstream on this one.

Copy link
Contributor

@maximusunc maximusunc left a comment

Choose a reason for hiding this comment

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

Looks good! I haven't tested yet because Strider still needs to be updated.

@maximusunc
Copy link
Contributor

Since this isn't merged in yet, can we bump the reasoner-pydantic version to 5.0.2 please?

@cbizon
Copy link
Contributor Author

cbizon commented Apr 16, 2024

OK, it's bumped -

@cbizon cbizon merged commit 6b82d90 into main Apr 16, 2024
1 check failed
@maximusunc maximusunc deleted the promiscuity branch April 16, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants