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

Enable users to register Processing Services & Pipelines #632

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

Conversation

vanessavmac
Copy link
Collaborator

@vanessavmac vanessavmac commented Nov 25, 2024

Summary of Changes

  • Users can register an ML Processing Service (a collection of pipelines)
  • Register pipelines to the Processing Service using an 'Register Pipelines' button
  • To process an image, users select the pipeline. The job checks which services are online before selecting one with lowest latency/response time.

Example User Flow

Users can register processing services associated with an endpoint URL. The endpoint URL has an info endpoint which returns a list of pipelines that should be in this processing service. The "Register Pipelines" button pings the info endpoint and adds the pipelines and algorithms to the processing service.

Screenshot 2025-01-19 at 12 13 26 AM

Pipelines are listed in the overview page along with the number of processing services available.

Screenshot 2025-01-19 at 12 14 28 AM

Screenshot 2025-01-19 at 12 19 16 AM

When a processing service is available, the user can select a pipeline to process a capture with. The processing service with the lowest latency is used to process the images with the selected pipeline.

Screenshot 2025-01-19 at 12 16 10 AM

Follow-Up ToDos (Requires feature spec-ing)

  • Revamp the processing page.
    • Currently, users select a pipeline and the function choose_processing_service_for_pipeline() selects a service that has the lowest latency. The UI could display what services are online and prevent users from using pipelines with no available processing services.
    • Recommend better pipelines (i.e. most recently checked, lowest latency, etc)
  • Come up with a better solution than "Stages" for showing the sequential order of algorithms in a pipeline. This processing service feature PR just uses the default values for "Stages."

Follow-Up Issues

@vanessavmac vanessavmac self-assigned this Nov 25, 2024
Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for ami-dev ready!

Name Link
🔨 Latest commit fb0539a
🔍 Latest deploy log https://app.netlify.com/sites/ami-dev/deploys/678c85ac5ff0fa0008dbac78
😎 Deploy Preview https://deploy-preview-632--ami-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73
Accessibility: 89
Best Practices: 92
SEO: 100
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@vanessavmac vanessavmac requested a review from mihow November 25, 2024 23:16
@mihow mihow changed the title Feat/ml pipeline registry Enable users to register ML Backends & Pipelines Nov 28, 2024
@vanessavmac
Copy link
Collaborator Author

@mihow I'm getting an error for this test in ami-platform/ami/jobs/tests.py:

def test_run_job_unauthenticated(self):
        jobs_run_url = reverse_with_params("api:job-run", args=[self.job.pk])
        self.client.force_authenticate(user=None)
        resp = self.client.post(jobs_run_url)
        self.assertEqual(resp.status_code, 401)

The console logs:

======================================================================
FAIL: test_run_job_unauthenticated (ami.jobs.tests.TestJobView.test_run_job_unauthenticated)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/app/ami/jobs/tests.py", line 176, in test_run_job_unauthenticated
    self.assertEqual(resp.status_code, 401)
AssertionError: 403 != 401

----------------------------------------------------------------------

I think this error is occurring now after I modified the image processing to use the choose_backend_for_pipeline() function in ami-platform/ami/ml/models/pipeline.py. However, I'm not sure why exactly it's occurring. I think it might have to do with how the job status is determined?

Does this only happen when you have SessionAuthentication commented-in in the base.py settings?

Forgot that that was not commented out -- the tests pass when I comment out "rest_framework.authentication.SessionAuthentication",

@vanessavmac vanessavmac requested a review from mihow January 7, 2025 02:41
@vanessavmac vanessavmac changed the title Enable users to register ML Backends & Pipelines Enable users to register Processing Services & Pipelines Jan 12, 2025
@mihow
Copy link
Collaborator

mihow commented Jan 17, 2025

@vanessavmac I merged main into this branch and fixed several conflicts from other updates that have happened. I got into the groove and made several small changes & fixes as well. I think tomorrow we should do one more pass and test on a snapshot of the live database. Then hopefully merge!

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.

2 participants