Skip to content

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mihow
Copy link
Collaborator

@mihow mihow commented Jul 22, 2025

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

  • Automatically create a Default Station (deployment) and assign the Default Research Site & Default Device
  • Automatically create or add a Processing Service, if specified in the environment settings (which is for local dev)
  • Allow specifying a list of pipelines that should be enabled/disabled by default (e.g. limit the choices of models)
  • Automatically create a Default Collection with all images (will not auto-populate)

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

image image image

Deployment Notes

Copy the new DEFAULT_* settings from the .production/.django-example config file to the live environments if desired.

Checklist

  • I have tested these changes appropriately.
  • I have added and/or modified relevant tests.
  • I updated relevant documentation or comments.
  • I have verified that this PR follows the project's coding standards.
  • Any dependent changes have already been merged to main.

Copy link

netlify bot commented Jul 22, 2025

Deploy Preview for antenna-preview canceled.

Name Link
🔨 Latest commit 35e0f5d
🔍 Latest deploy log https://app.netlify.com/projects/antenna-preview/deploys/6882e332cb88720008721fd6

@mihow mihow changed the title Configure default related models with new projects Configure default related models for new projects Jul 22, 2025
@mihow mihow marked this pull request as ready for review July 25, 2025 00:29
@Copilot Copilot AI review requested due to automatic review settings July 25, 2025 00:29
Copilot

This comment was marked as outdated.

@mihow mihow requested a review from Copilot July 25, 2025 01:27
Copilot

This comment was marked as outdated.

@mihow mihow requested a review from Copilot July 25, 2025 01:43
Copy link

@Copilot Copilot AI left a 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


# Default processing service
DEFAULT_PROCESSING_SERVICE_NAME="AMI Data Companion"
DEFAULT_PROCESSING_SERVICE_ENDPOINT=http://ml.antenna.insectai.org/
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will only work if http:// is changed to https://

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.

1 participant