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

Fix user_config_dir() for GCP/AWS functions #4726

Merged
merged 2 commits into from
Sep 9, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 9, 2021

Compatibility fix for GCP functions and AWS lambda for user config directory in #4628

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced user configuration directory handling, including write permissions check.

📊 Key Changes

  • Refactored the path settings in user_config_dir to improve readability.
  • Implemented a check to identify if the path is writable, with a fallback to /tmp for Linux systems where only /tmp is writable.
  • Added a new utility function is_writeable to verify write access to a given path.

🎯 Purpose & Impact

  • Enhanced Compatibility: Ensures that the user_config_dir function works correctly in environments with restricted write access, such as Google Cloud Functions or AWS Lambda.
  • Improved Robustness: The new writable check prevents errors that could occur when the application tries to write to a directory without the necessary permissions.
  • Potential Impact: Users running YOLOv5 in severless environments should experience fewer permission-related issues, leading to a smoother operation and better user experience. 🚀

@glenn-jocher
Copy link
Member Author

/rebase

@glenn-jocher
Copy link
Member Author

/rebase

Compatability fix for GCP functions and AWS lambda for user config directory in #4628
@glenn-jocher glenn-jocher merged commit 4a025ae into master Sep 9, 2021
@glenn-jocher glenn-jocher deleted the fix/user_config_cloud branch September 9, 2021 15:57
CesarBazanAV pushed a commit to CesarBazanAV/yolov5 that referenced this pull request Sep 29, 2021
* Fix `user_config_dir()` for GCP/AWS functions

Compatability fix for GCP functions and AWS lambda for user config directory in ultralytics#4628

* Windows skip check
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Fix `user_config_dir()` for GCP/AWS functions

Compatability fix for GCP functions and AWS lambda for user config directory in ultralytics#4628

* Windows skip check
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.

User config prefixed by Path.home() breaks in AWS Lambda or any system without /home
1 participant