-
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
173 implement report pulling in gcs storage class and refactor simulation server #176
173 implement report pulling in gcs storage class and refactor simulation server #176
Conversation
e34f683
to
114744a
Compare
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 good work. The code is well-refactored and thoughtfully abstracted.
from PythonClient.multirotor.storage.storage_config import get_storage_service | ||
|
||
class AirSimApplication: | ||
# Parent class for all airsim client side mission and monitors | ||
def __init__(self): | ||
# Set up the storage service | ||
self.storage_service = GCSStorageService() | ||
self.storage_service = get_storage_service() |
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 great. Further abstracts away from direct implementation details.
@@ -1,3 +1,3 @@ | |||
from .gsc_storage_service import GCSStorageService | |||
from .gcs_storage_service import GCSStorageService |
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.
Thanks for fixing typo.
"""Uploads a file to the cloud storage service.""" | ||
pass | ||
|
||
@abstractmethod | ||
def list_reports(self): | ||
"""Lists all report batches from the storage service.""" | ||
pass | ||
|
||
@abstractmethod | ||
def list_folder_contents(self, folder_name): | ||
"""Lists the contents of a specific report folder.""" | ||
pass | ||
|
||
@abstractmethod | ||
def serve_html(self, folder_name, relative_path): | ||
"""Serves an HTML file from the storage service.""" |
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 good. New methods to help us refactor simulation_server.
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 works, including uploading and viewing files on the react app, tested it myself.
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.
File is properly refactored, looks good.
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.
The best part. This module serves as the central place for all of the storage service settings. You can easily switch between different storage services by simply commenting or uncommenting the relevant lines. It helps keep everything organized and abstracted.
#173
This should work for now, refactored and pulled out methods that I believed could be used somewhere else, back into the GCS class, added the methods used in simulator to be rooted in the GCS class while still abiding by react interactions.
It was changed to allow for a more easily changed and concentrated storage framework, no long do we have to chase down methods and build it from scratch 4 times.
I took all of the methods from the simulator and abstracted them into the GCS class, while keeping a method call in the simulator to abide by the @app method requirements. further methods that I believed would not be used else where I kept in simulator and changed its interactions to use our GCS class rather than hardcoding everything.