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

feat(ml): support multiple urls #14347

Merged
merged 12 commits into from
Dec 4, 2024
Merged

feat(ml): support multiple urls #14347

merged 12 commits into from
Dec 4, 2024

Conversation

mertalev
Copy link
Contributor

@mertalev mertalev commented Nov 25, 2024

Description

A current limitation of remote machine learning is that it expects constant uptime: jobs will fail to be processed if the remote container is down. This PR adds the ability to specify multiple URLs for remote machine learning that are attempted sequentially. This improves the reliability of the feature by allowing a fallback to the local machine learning container when the remote container is not available.

Note: this PR changes the server config type of the machine learning URL to an array. To avoid breaking every Immich instance, string fields are wrapped in an array before validation. I tested with the official mobile app and didn't notice any issues, but I'm not sure if there are any cases where this would be a breaking change.

Testing

Tested that machine learning tasks with one URL work, that specifying two URLs and making the first fail will lead to the second URL being used for that request, and tested the setting UI as in this video

remote-urls.mov

@github-actions github-actions bot added documentation Improvements or additions to documentation 🖥️web 🗄️server labels Nov 25, 2024
@alextran1502
Copy link
Contributor

We are not using this property in the mobile app so as long as you can login, it is good

unnecessary `?.`
add load balancing section
doc formatting

wording

wording

linting
@mertalev mertalev force-pushed the feat/ml-multi-remote branch from 02083a0 to b164b9e Compare November 25, 2024 22:59
Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

Code looks good to me, will probably give it a spin tomorrow

docs/docs/guides/remote-machine-learning.md Outdated Show resolved Hide resolved
server/src/dtos/system-config.dto.ts Show resolved Hide resolved
Copy link
Contributor

@alextran1502 alextran1502 left a comment

Choose a reason for hiding this comment

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

Good work! Thank you

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

You have changed it from a string to a list, but all the variable names are still url, which is confusing imo. Should it not be urls now? For compatibility we could support both for a time, give a warning for url, and map that to urls

@mertalev mertalev enabled auto-merge (squash) December 4, 2024 19:58
@mertalev mertalev merged commit 4bf1b84 into main Dec 4, 2024
36 checks passed
@mertalev mertalev deleted the feat/ml-multi-remote branch December 4, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants