feat: single compose file including hwaccel #14461
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
hwaccel.*.yml
files are separate for two reasons: to make it easier to set all the appropriate settings without missing anything or caring about the details, and to avoid cluttering the services with a bunch of commented lines.However, the fact that they're separate files makes them inconvenient, and many platforms don't expose the ability to have multiple Compose files. Uncommenting the
extends
section and changing the right fields fromcpu
is simple but also somewhat awkward, and it becomes more awkward in a dev workflow as you have to stash and unstash changes.This PR moves all of this into the same Compose file and makes it possible to set the transcoding and machine learning backends just through the
IMMICH_TRANSCODING_BACKEND
andIMMICH_MACHINE_LEARNING_BACKEND
environmental variables. This makes it easier to configure with fewer steps, leaves less room for error, and makes it much more convenient for development.The way it does this is crafty: it defines services for these configs, disables them by assigning a profile to them so they don't actually run, extends the server and machine learning services from the same Compose file, uses environmental variable interpolation in this
extends
section to allow the extended service to be changed dynamically, and lastly unsets theprofiles
field in these services so they do in fact run.How Has This Been Tested?
I tested both with and without these envs and confirmed all immich services run, that these special services don't run, and that the envs affect building and configuration.