Skip to content

feat(web,server)!: configure machine learning via the UI - #3768

Merged
alextran1502 merged 3 commits into
mainfrom
feat/server-feature-flags
Aug 25, 2023
Merged

alextran1502 merged 3 commits into
mainfrom
feat/server-feature-flags

Conversation

@jrasm91

@jrasm91 jrasm91 commented Aug 18, 2023 •

Copy link
Copy Markdown
Member

Breaking Change

The way we disabled machine learning has changed in this pull request.

To disable machine learning now, use IMMICH_MACHINE_LEARNING_ENABLED=false

(previously IMMICH_MACHINE_LEARNING_URL=false)


In this PR:

  • Make machine learning url configurable via the admin settings (still can be set/disabled via IMMICH_MACHINE_LEARNING_URL)
  • Add options to disable certain ML features in the UI (these skip corresponding jobs)
  • Remove unused search config endpoint (replaced with the new features endpoint)
  • Update jobs to become disabled with corresponding feature flags

Tested scenarios:

  • Start up with ML disabled via env verify jobs are disabled and ML doesn't run on upload
  • Start up with ML enabled and disabled via the UI and verify ML stops running
  • Start up with ML enabled and disable individual features. Verify associated jobs stop running
  • Start up with ML enabled and verify all jobs still function correctly

image

@vercel

vercel Bot commented Aug 18, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
immich ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 25, 2023 0:14am

@jrasm91
jrasm91 force-pushed the feat/server-feature-flags branch from 202048d to 69c94ef Compare August 18, 2023 18:36
@martabal

martabal commented Aug 18, 2023 •

Copy link
Copy Markdown
Contributor

Awesome !
One concern : Users who use the AIO image don't have to worry about configuring the url of the machine-learning (it's 127.0.0.1). Can we still rely on the IMMICH_MACHINE_LEARNING_URL env for the default url ?

@bo0tzz

bo0tzz commented Aug 18, 2023

Copy link
Copy Markdown
Member

The ML URL is the sort of environment config that I think should really be left in an env var if we can. I do like all the feature flag options!

@jrasm91

jrasm91 commented Aug 18, 2023

Copy link
Copy Markdown
Member Author

We can certainly leave it as an environment variable. I personally switch mine between two machines all the time, so would love to be able to configure it dynamically. I guess I'll think about it some more and see if there is a clean way to do it.

@jrasm91

jrasm91 commented Aug 18, 2023

Copy link
Copy Markdown
Member Author

The ML URL is the sort of environment config that I think should really be left in an env var if we can. I do like all the feature flag options!

What about if we make the "default" value configurable via an environment variable, but you can override it via the UI and a value from the database? So overrides get merged into defaults, but we can make the default value something like process.env.MACHINE_LEARNING_URL || immich-machine-learning:3003?

@jrasm91
jrasm91 force-pushed the feat/server-feature-flags branch from 12fc142 to 6510dbd Compare August 19, 2023 01:08
@jrasm91
jrasm91 marked this pull request as ready for review August 19, 2023 01:12
Comment thread server/src/domain/system-config/system-config.core.ts Outdated
@jrasm91 jrasm91 changed the title feat(web,server): configure machine learning via the UI feat(web,server)!: configure machine learning via the UI Aug 24, 2023
@jrasm91

jrasm91 commented Aug 24, 2023

Copy link
Copy Markdown
Member Author

There are some things that I would like to improve upon, but I think it might be better to do it in a separate pull request. It would be great to organize, standardize, and consolidate all the environment variables and configuration settings. There is an open PR to load config from a file and we also have some variables with IMMICH_ prefix and others without. I would love to merge this and the config file PR, standardize the names, and update the documentation all in a single release.

@jrasm91
jrasm91 force-pushed the feat/server-feature-flags branch from 392b71f to 7422aec Compare August 25, 2023 00:13
@jrasm91
jrasm91 requested a review from martabal August 25, 2023 01:46
@alextran1502
alextran1502 merged commit 8211afb into main Aug 25, 2023
@alextran1502
alextran1502 deleted the feat/server-feature-flags branch August 25, 2023 04:15

This branch was previously deployed

1 inactive deployment
Preview — 7422aecd Deployed Aug 25, 2023 by vercel[bot]
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.

4 participants