You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove need for 'ISPYB_CREDENTIALS' environment variable (#588)
'ispyb.sqlalchemy.url()' takes credentials as an argument, through which the config file can be passed directly to the function instead of relying on the 'ISPYB_CREDENTIALS' environment variable. This eliminates the last traces of our repo's need to explicitly define 'ISPYB_CREDENTIALS'.
Additionally, elements of the CI workflow and test code related to the Murfey and ISPyB databases have also been modified. 'ISPYB_CREDENTIALS' has also been dropped successfully from the test workflow, and fixtures have been put in place to allow for the creation of databases that will be reset to a desired initial state at the end of every test. This means that the database does not have to be shut down and rebooted with every database-related test, which should help with our testing times as we continue to improve Murfey's test coverage.
NOTE: Within our code base, it looks like ISPyB spawns SQLAlchemy Session objects, whereas the Murfey database spawns SQLModel ones. As such, SQLModel's functions might not work when querying the ISPyB database. The database session fixtures for the ISPyB and Murfey test databases have been written to reflect this.
echo "Patching ${f} in SQL files to fix CLI escape issues..."
107
+
sed -i 's/\\-/-/g' "$f"
108
+
109
+
echo "Importing ${f}..."
105
110
mariadb --defaults-file=.my.cnf < $f
106
111
done
112
+
107
113
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api@'%' IDENTIFIED BY 'password_1234'; GRANT ispyb_processing to ispyb_api@'%'; GRANT ispyb_import to ispyb_api@'%'; SET DEFAULT ROLE ispyb_processing FOR ispyb_api@'%';"
108
114
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api_future@'%' IDENTIFIED BY 'password_4321'; GRANT SELECT ON ispybtest.* to ispyb_api_future@'%';"
109
115
mariadb --defaults-file=.my.cnf -e "CREATE USER ispyb_api_sqlalchemy@'%' IDENTIFIED BY 'password_5678'; GRANT SELECT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT INSERT ON ispybtest.* to ispyb_api_sqlalchemy@'%'; GRANT UPDATE ON ispybtest.* to ispyb_api_sqlalchemy@'%';"
0 commit comments