-
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
Skip staging db and aws on missing credentials #243
Conversation
cellpack/bin/upload.py
Outdated
from cellpack.autopack.FirebaseHandler import FirebaseHandler | ||
from cellpack.autopack.DBRecipeHandler import DBUploader | ||
|
||
from cellpack.autopack.interface_objects.database_ids import DATABASE_IDS | ||
from cellpack.autopack.loaders.recipe_loader import RecipeLoader | ||
|
||
############################################################################### | ||
log_file_path = Path(__file__).parent.parent / "logging.conf" |
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.
Are we using the logger anywhere in this file?
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.
Thank you for catching that! I ended up using sys
instead of log
and forgot to clean up the logger setup, will remove it now
* Create a Firebase project in test mode with your google account, select `firebase_admin` as the SDK. [Firebase Firestore tutorial](https://firebase.google.com/docs/firestore) | ||
* Generate a new private key by navigating to "Project settings">"Service account" in the project's dashboard. | ||
* For dev database: | ||
* Create a Firebase project in test mode with your google account, select `firebase_admin` as the SDK. [Firebase Firestore tutorial](https://firebase.google.com/docs/firestore) |
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.
This is very useful!
cellpack/autopack/__init__.py
Outdated
@@ -387,6 +387,10 @@ def load_file(filename, destination="", cache="geometries", force=None): | |||
if database_name == "firebase": | |||
db = DATABASE_IDS.handlers().get(database_name) | |||
initialize_db = db() | |||
if not initialize_db._initialized: | |||
sys.exit( | |||
"The selected database is not initialized. Please set up Firebase credentials to pack remote recipes." |
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.
Could link to the readme/instructions here similar to how we do for missing AWS credentials
cellpack/bin/upload.py
Outdated
recipe_db_handler.upload_recipe(recipe_meta_data, recipe_full_data) | ||
else: | ||
sys.exit( | ||
"The selected database is not initialized. Please set up Firebase credentials to upload recipes." |
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.
Could link to the readme/instructions here similar to AWS
Problem
What is the problem this work solves, including
closes #238
Solution
To address the issue of missing aws or firebase credentials when running local packings, the following changes were made:
- skipped the saving process for staging database and aws s3 bucket
- disabled the automatic opening of new browser tabs related to aws urls
- updated documentation
Type of change
Please delete options that are not relevant.
Steps to Verify: