forked from UAVLab-SLU/DRV_public
-
Notifications
You must be signed in to change notification settings - Fork 2
Storage Service Guide
Mohammad edited this page Nov 29, 2024
·
4 revisions
This guide provides information on choosing between different storage services to manage and store your simulation data in Drone World.
-
Google Cloud Storage:
- Great for large-scale storage and high-speed access.
- Ideal for projects that require scalability and cloud integration.
-
Google Drive Storage:
- User-friendly and easy to share files.
- Good for smaller projects or collaborative sharing.
- Note: Currently very slow when viewing reports.
You can easily switch between different storage services by simply commenting or uncommenting the relevant lines in storage_config.py
.
File Location:
DroneWorld\backend\PythonClient\multirotor\storage\storage_config.py
- Go to the Google Cloud Console.
- Navigate to IAM & Admin > Service Accounts.
- Click Create Service Account, provide a name, and proceed.
- Assign the Editor role to the service account for full file management.
- Alternatively, for more restrictive access, assign:
- Storage Object Viewer
- Storage Object Creator
- After creating the service account, go to the Keys tab.
- Click Add Key > Create New Key and select JSON.
- Download the
key.json
file and store it securely.
- In Google Drive, create a folder named
reports
in the root of your Drive. - Right-click the folder, select Share, and add the service account’s email (found in the
key.json
file) with Editor access.
- Place the downloaded
key.json
file inDroneWorld\backend
. - Update the
folder_id
instorage_configuration.py
with the ID of your shared Google Drive folder:- Right-click the folder in Google Drive, select Get Link, and copy the folder ID from the URL (e.g.,
https://drive.google.com/drive/folders/<folder_id>
).
- Right-click the folder in Google Drive, select Get Link, and copy the folder ID from the URL (e.g.,
- In the Google Cloud Console, go to Storage > Buckets.
- Click Create Bucket, provide a unique name, and complete the setup.
- Navigate to IAM & Admin > Service Accounts.
- Click Create Service Account, provide a name, and proceed.
- Assign the following roles to the service account:
- Storage Object Viewer
- Storage Object Creator
- After creating the service account, go to the Keys tab.
- Click Add Key > Create New Key and select JSON.
- Download the
key.json
file and store it securely.
- Navigate to your GCS bucket in the Google Cloud Console.
- Create a folder named
reports
in the root of your bucket.
- Go to your GCS bucket in the Google Cloud Console.
- Navigate to the Permissions tab.
- Click Grant Access and add the service account’s email (from
key.json
). - Assign the roles:
- Storage Object Viewer
- Storage Object Creator
- Place the downloaded
key.json
file inDroneWorld\backend
. - Update the
bucket_name
instorage_configuration.py
with the name of your GCS bucket.
-
Secure Your Credentials: Keep the
key.json
file safe and do not share it publicly or commit it to version control. - Adjust Permissions as Needed: You can modify IAM roles if you require different access levels.
- Restart the Application: Restart the application after making configuration changes to apply the new settings.
- Test the Setup: Upload a test file to ensure the application interacts with your chosen storage service correctly.