-
Notifications
You must be signed in to change notification settings - Fork 21
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
Database manager not working on local dev machine #2171
Comments
Yes, there was a long saga over the summer here, that to make a long story short, the running ITRB instances were trying to download databases via this mechanism and this was causing big problems. I applied that quick hack, not realizing that others were using it. In the mean time, I thought @saramsey had already fixed this issue more robustly. What happened to that? Is that languishing in a branch, or is there a needed command-line flag? |
Ah, I see. What if we only skip the (I think it's pretty important to have the database manager functioning for dev work - it's a huge mess otherwise when trying to run pytests) |
apologies - skip the rsync line if |
I think we concluded that we don't want to be downloading databased on arax.ncats.io either because we do that manually as well. In fact, I thought the final conclusion was that don't ever want database downloading to be happening while ARAX is "running". And so I thought the decision was to only let the database manager perform downloads when run from the CLI. And I thought @saramsey implemented this already. @saramsey ? If not, I will just reverse my change. It has caused more thrashing than it avoided at this point. |
Well, as far as I can tell, the issue with simply uncommenting that line of code is that RTX/code/ARAX/ARAXQuery/ARAX_infer.py Line 310 in c9dd387
and the initializer for the NodeSynonymizer class conditionally instantiates the ARAXDatabaseManager class, RTX/code/ARAX/NodeSynonymizer/node_synonymizer.py Lines 46 to 47 in c9dd387
which can attempt to download databases. I thought we had decided we did not want that to ever happen at query time (i.e., downstream of But maybe the simpler thing is just to change those two lines of ARAX_infer.py to just log a TRAPI error and give up. I'm not wild about downloading databases at query time; we should just have ARAX fail loudly if it is missing a database file. When we restart the application, it will download the databases at application start-up. Just my $0.02. But that is why I didn't simply comment out that line in |
Also consider that |
My feeling is that NodeSynonymizer's initializer should just fail if a database file is missing. It should under no circumstances attempt to download database files. But that's not the case as things stand currently. |
I think there may be more code paths at query time that indirectly could call |
So, what do we want to do? Apologies I didn't push this (i.e., 2098) through earlier. But I guess it's probably for the best that we discuss the specific proposed solution before implementing. |
I should say @amkglen that I have just locally uncommented that line of code, when I have wanted to install databases. Which is not ideal but was my work-around until we can get this issue resolved more definitively. |
I propose that we just update the class so that it will only actually download files if run from the CLI, e.g.,
Any other ways that the database manager is called, it will decline to do an actual rsync but be noisy about the fact that it got into a state where it would have. |
I'd also like it to rsync when it is called at Flask application start-up (we can have a special initializer parameter for that, of course) |
Do you want me to code that up? |
I can do it right now. |
I'm working on this in branch |
okay, thanks. |
Can you all please check commit 63e0449 to see if it looks sane? |
In that commit, I've done a few things:
|
The line we wanted to uncomment is still commented out?
|
D'oh! (Homer Simpson impression) Done |
With commit 63918bb, it seems to work on my MBP. |
Do you want to test the branch on |
Legends! |
Merged. |
Testing on |
Testing looks good. I have moved |
I'm now going to delete the |
Deleted. Closing this issue out for now (just reopen if anything looks amiss). |
@amykglen can you confirm that with the latest code in |
@saramsey - just confirmed so just to clarify - the database manager is no longer run automatically when we run ARAX pytests (without running the whole Flask application), so we should run |
@amykglen: Near as I can tell, the only way If so, you correct. That's gone, as of commit e528c6c. It happened on Aug. 29, when you were away. I think (and others at the time concurred) that we don't want the database manager being run in the initializer for ARAXQuery. The If you want the old automation back, it's perfectly fine to check in a shell script like I know you have done a lot of work on expand which necessarily involves running the pytests a lot. So I'd really welcome your thoughts. |
thanks @saramsey - no, I'm content running the database manager manually as needed. just wanted to clarify that that's the SOP now |
So I'm finally getting my local dev machine updated with the latest databases after my summer away, and running
python ARAX_database_manager.py
on my machine inmaster
fails to update databases and instead prints a bunch of errors like these:I dug into ARAX_database_manager.py, and it looks like @edeutsch commented out the
rsync
command in August and replaced it with the 'ERROR: Wanted to run..' message here:c87c238#diff-6c5ef8a6fc1a29e4d6b0769025a7776adf87952fcc3814d3d45b6e9015687b65R342
when I undo that change (uncomment the
rsync
line and remove the error line), the database manager works normally for me.is there a reason why the
rsync
line is commented out inmaster
? was there an issue with it on one of our instances or something?The text was updated successfully, but these errors were encountered: