-
Notifications
You must be signed in to change notification settings - Fork 2
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
adds access to archive database to sdssdb #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelbrownstein I had a quick check with the example you gave. Two things.
- When I first imported the database it was not connected to profile
manga
, as in your example
from sdssdb.sqlalchemy.archive.sas import *
database
<ArchiveDatabaseConnection (dbname='archive_20190507', profile='manga', connected=False)>
I had to set the profile to local first
database.set_profile('local')
database
<ArchiveDatabaseConnection (dbname='archive_20190507', profile='local', connected=True)>
Was that the expected behavior?
- I am having permissions issues. I got
session.query(Tree).all()
and got
ProgrammingError: (psycopg2.ProgrammingError) permission denied for schema sas
I ran
can you re-try, please? |
I thought local would be the default behavior |
@joelbrownstein that worked for the permissions, at least with the given example. I think by default, with |
ok on permissions! and I think you are right about manga, so we need to specify local on that machine. |
@joelbrownstein I think it's not connecting because I don't have the archive db set up in my .pgpass file for |
manga.wasatch.peaks is the infiniband address that the cluster uses, so I don't think you want that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of these relationships need to have the backref pluralized, in those cases where the relationship is many to one.
The relationship changes that I pushed to the archive branch made my archive_20190507 database connection not work correctly; the Python code used to query the db does not work with the relationships and works correctly without. |
@joelbrownstein @nbmurphy I cannot seem to pull the latest changes at Utah to start looking at this. I'm the manga user looking at /uufs/chpc.utah.edu/common/home/sdss10/software/sdss/github/sdssdb/archive. Is this the right place? Also, @nbmurphy can you provide an error message of the type of problem you are getting? |
I ran git pull, can you try now? I can add a crontab to keep it updated, or we can run sdss_install as the manga user? |
It looks updated. Thanks. |
@joelbrownstein can I (manga) have access to edit the directory? I need to debug some stuff in real time for the archive models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joelbrownstein @nbmurphy I've pushed some changes to fix the relationships. It gets a bit funky because some columns are keys that reference itself. Other tables have multiple columns that point to the same foreign key, in which case you need to be more explicit with sqlalchemy about how they join together. I've also added some print_fields
so when loading the models in python you get a bit more info on what the thing is. Please have a look and let me know what you think. Otherwise this seems to work now at Utah. @joelbrownstein You can pull the changes into your version of sdssdb
.
The new changes work with my existing code that implements sdssdb-archive. I also added the requested documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I requested some changes. Also note that I made a number of changes to master so you'll need to merge those and maybe fix some conflicts.
Also, never too late to link this to an issue ...
@albireox your recent changes in master have broken the ability to run To reproduce,
|
@albireox Your recent changes in master regarding |
Yes, the use of Yes, there is a ticket for the Travis issue, #18. Since we really don't have tests I hadn't fixed it yet. It should be easy to and maybe you already have. How are the changes breaking the use of |
@albireox I've fixed the Travis issues here to at least get it to run. I'm working on some ideas on how to improve database testing generally. Once I sort it out I'll submit a new PR. There is a local archive database currently on the manga machine, |
Yes, at some point we should use a I'll have a look at the issue with |
So, the problem happens because I added specifically that
but for some reason just I don't remember exactly why I added the host specifically. I think it was because when I was trying to use the local profile for a tunnel connection it would fail unless I passed |
That makes sense. I agree this will be machine setup specific. Maybe we can leave the |
I've allowed unix sockets via a few selected unids for convenience, which is why it works for you without -h and without -U. However once you add -h, then the connection string should also specify the shared user via -U sdss |
Hi Brian,
I've run pg_restore on the archive database on manga.sdss.org, and installed the archive branch of sdssb on Utah system-wide for this PR.
Can you confirm the following works (or I may need to fix the postgresql schema/table permissions on your userid)?
Cheers,
Joel