-
Notifications
You must be signed in to change notification settings - Fork 5
Configure default related models for new projects #905
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
Conversation
✅ Deploy Preview for antenna-preview canceled.
|
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.
Pull Request Overview
This PR streamlines the creation of new projects by automatically configuring default related models and services. It introduces environment-driven configuration for processing services and pipelines to reduce manual setup steps for both local development and production environments.
- Automatically creates default related models (Station/Deployment, Research Site, Device, Collection) when projects are created
- Adds configurable default processing service creation based on environment variables
- Implements selective pipeline enabling/disabling through configuration settings
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
config/settings/base.py | Adds environment variables for default processing service configuration |
ami/tests/fixtures/main.py | Updates test fixtures to handle new project creation patterns and return project identifiers |
ami/ml/models/project_pipeline_config.py | Removes unused imports |
ami/ml/models/processing_service.py | Adds custom manager, pipeline filtering logic, and default service creation functionality |
ami/main/tests.py | Adds comprehensive tests for new project setup functionality with various configuration scenarios |
ami/main/models.py | Implements custom ProjectManager with automatic default model creation and refactors related helper functions |
.envs/.production/.django-example | Adds production environment configuration for default processing service |
.envs/.local/.django | Adds local development environment configuration for default processing service |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Nice work! Quick question:is default project creation triggered from the admin or the project view? Also, would using a JSON/YAML config for defaults be more flexible than env vars? |
One more thought: what about adding a few default images to the default deployment so users can immediately experiment with processing pipelines? |
Thank you @mohamedelabbas1996! I agree with all your points.
I added all of these ideas to the implementation details of this ticket. I am going to merge this PR while it's all simple & safe changes. |
* feat: configure default related models with new projects * feat: allow specifying which pipelines are enabled by default * feat: add denmark/uk model to default pipelines * feat: add tests for default enabled pipelines * chore: rename default station * fix: undefined variables in certain cases * chore: cleanup typos and comments * Update ami/ml/models/processing_service.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: live processing endpoint URL
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Exciting! Looking forward to check this out. |
* feat: clean up when events are regrouped for a deployment * feat: add created & updated at columns to sessions/events list * feat: configure default related models with new projects * feat: allow specifying which pipelines are enabled by default * feat: add denmark/uk model to default pipelines * feat: add tests for default enabled pipelines * chore: rename default station * fix: undefined variables in certain cases * chore: cleanup typos and comments * fix: update default sampling method for collections * Configure default related models for new projects (#905) * feat: configure default related models with new projects * feat: allow specifying which pipelines are enabled by default * feat: add denmark/uk model to default pipelines * feat: add tests for default enabled pipelines * chore: rename default station * Update ami/ml/models/processing_service.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: live processing endpoint URL * feat: process images immediately after uploading (prototype) * feat: read timestamp from EXIF data in special cases * chore: clean up comments and unused * feat: query method to select pipelines enabled for project * feat: process_single_image function in a new home * fix: default pipeline query * feat: fallback to the current datetime for test uploads * chore: disable auto-processing manual uploads by default * fix: select only pipelines with an avail processor for the project * feat: move the create method to the view * fix: allow the current project to be passed in post / form data * feat: require project in source image upload * feat: use project feature flag for auto processing * fix: pass project ID when creating source image in test * fix: separate titles for source images & source image collections * feat: use default pipeline in project settings first
Summary
Currently there are several manual steps required each time a new project is created. This PR introduces several changes to streamline the creation of new projects, both for local development and in live environments for users.
List of Changes
TODO: set default lat & lon based on current country in the Request
TODO: create a default project when a user is registered (a hidden scratch project) #899
TODO: allow setting a default pipeline for a project to use for processing (multiple are enabled & available, even after this PR, so which should be used for automatic processing) #901
TODO: auto-populate some collections #907
Related Issues
This was added as part of #901, and it closes part of #899
Related #893
Screenshots
Deployment Notes
Copy the new
DEFAULT_*
settings from the.production/.django-example
config file to the live environments if desired.Checklist