Skip to content
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

Conversation

nguzinski
Copy link
Collaborator

#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.

@nguzinski nguzinski linked an issue Nov 23, 2024 that may be closed by this pull request
11 tasks
@mohamdlog mohamdlog force-pushed the 173-implement-report-pulling-in-gcs-storage-class-and-refactor-simulation-server branch from e34f683 to 114744a Compare November 28, 2024 22:59
Copy link
Member

@mohamdlog mohamdlog left a 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.

Comment on lines +8 to +14
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()
Copy link
Member

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
Copy link
Member

@mohamdlog mohamdlog Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing typo.

Comment on lines +10 to +25
"""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."""
Copy link
Member

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.

Copy link
Member

@mohamdlog mohamdlog Nov 28, 2024

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.

Copy link
Member

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.

Copy link
Member

@mohamdlog mohamdlog Nov 28, 2024

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.

@mohamdlog mohamdlog marked this pull request as ready for review November 28, 2024 23:10
@mohamdlog mohamdlog merged commit d83f318 into main Nov 28, 2024
2 checks passed
@mohamdlog mohamdlog deleted the 173-implement-report-pulling-in-gcs-storage-class-and-refactor-simulation-server branch November 29, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Report Pulling in GCS Storage Class and Refactor Simulation Server
2 participants