mirror of
https://github.com/tbelway/immich-podman-quadlets.git
synced 2025-07-09 03:04:27 -04:00
quick and comprehensive setup
This commit is contained in:
parent
08c1aaa254
commit
3d077f5bb8
@ -1 +1,2 @@
|
||||
# immich-podman-quadlets
|
||||
# immich-podman-quadlets
|
||||
If you're using podman, this is the easy way to setup immich.
|
||||
|
78
docs/install/hwa.md
Normal file
78
docs/install/hwa.md
Normal file
@ -0,0 +1,78 @@
|
||||
---
|
||||
sidebar_position: 100
|
||||
---
|
||||
|
||||
# HardWare Acceleration setup for immich with podman
|
||||
|
||||
If you are using NVIDIA on a redhat OS such as fedora or almalinux, reboots sometimes cause the nvidia-uvm and nvidia-uvm-tools to just... not load. Use the following script and systemd file to correct this behaviour:
|
||||
|
||||
You can ultimately place this wherever you want as long as it's referenced appropriately in the systemd file:
|
||||
nv_init.sh
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
echo "modprobe nvidia"
|
||||
/sbin/modprobe nvidia
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
# Count the number of NVIDIA controllers found.
|
||||
NVDEVS=`lspci | grep -i NVIDIA`
|
||||
N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
|
||||
NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l`
|
||||
|
||||
N=`expr $N3D + $NVGA - 1`
|
||||
echo "mknode nvidia"
|
||||
for i in `seq 0 $N`; do
|
||||
if [ ! -e /dev/nvidia$i ]; then
|
||||
mknod -m 666 /dev/nvidia$i c 195 $i
|
||||
fi
|
||||
done
|
||||
|
||||
echo "mknode nvidiactl"
|
||||
if [ ! -e /dev/nvidiactl ]; then
|
||||
mknod -m 666 /dev/nvidiactl c 195 255
|
||||
fi
|
||||
else
|
||||
echo "exit NVIDIA controller"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "modprobe nvidia-uvm"
|
||||
/sbin/modprobe nvidia-uvm
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
# Find out the major device number used by the nvidia-uvm driver
|
||||
D=`grep nvidia-uvm /proc/devices | awk '{print $1}'`
|
||||
|
||||
echo "mknode nvidia-uvm"
|
||||
if [ ! -e /dev/nvidia-uvm ]; then
|
||||
mknod -m 666 /dev/nvidia-uvm c $D 0
|
||||
fi
|
||||
echo "mknode nvidia-uvm-tools"
|
||||
if [ ! -e /dev/nvidia-uvm-tools ]; then
|
||||
mknod -m 666 /dev/nvidia-uvm-tools c $D 0
|
||||
fi
|
||||
else
|
||||
echo "exit nvidia-uvm"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
/etc/systemd/system/init_nvidia.service
|
||||
```bash
|
||||
[Unit]
|
||||
Description=NVIDIA Init for CUDA
|
||||
After=network.target
|
||||
ConditionPathExists=|!/dev/nvidia
|
||||
ConditionPathExists=|!/dev/nvidiactl
|
||||
ConditionPathExists=|!/dev/nvidia-uvm
|
||||
ConditionPathExists=|!/dev/nvidia-uvm-tools
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash ${your_path_to_script}/nv_init.sh
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
136
docs/install/podman-quadlet.md
Normal file
136
docs/install/podman-quadlet.md
Normal file
@ -0,0 +1,136 @@
|
||||
---
|
||||
sidebar_position: 90
|
||||
---
|
||||
|
||||
# Podman deploy with quadlets
|
||||
|
||||
You can deploy Immich on Podman using quadlets.
|
||||
|
||||
Here are some sample rootless quadlet container files that can be placed in /etc/containers/systemd/users/${ID} where ID is the uid of whatever your rootless user is.
|
||||
|
||||
Please note you'll need :z or :Z for selinux enabled hosts.
|
||||
|
||||
If you are doing hardware acceleration with NVIDIA make sure you follow the immich documentation including the appropriate NVIDIA Container Device Interface (https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/cdi-support.html) and adding the device (AddDevice=nvidia.com/gpu=0).
|
||||
|
||||
immich-database.container
|
||||
```bash
|
||||
[Unit]
|
||||
Description=Immich Database
|
||||
Requires=immich-redis.service
|
||||
|
||||
[Container]
|
||||
AutoUpdate=registry
|
||||
EnvironmentFile=${location_of_env_file}
|
||||
Image=registry.hub.docker.com/tensorchord/pgvecto-rs:pg16-v0.2.1
|
||||
Label=registry
|
||||
Network=slirp4netns:port_handler=slirp4netns
|
||||
PublishPort=5432:5432
|
||||
Volume=${host_database_directory}:/var/lib/postgresql/data:z
|
||||
Volume=/etc/localtime:/etc/localtime:ro
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
```
|
||||
|
||||
immich-microservices.container
|
||||
```bash
|
||||
[Unit]
|
||||
Description=Immich Microservices
|
||||
Requires=immich-redis.service immich-database.service
|
||||
|
||||
[Container]
|
||||
#AddDevice=/dev/dri:/dev/dri #Needed for HWA
|
||||
#AddDevice=nvidia.com/gpu=0 #Needed for nvidia HWA, after setting up container tools
|
||||
AutoUpdate=registry
|
||||
EnvironmentFile=${location_of_env_file}
|
||||
Image=ghcr.io/immich-app/immich-server:release
|
||||
Label=registry
|
||||
Network=slirp4netns:port_handler=slirp4netns
|
||||
PublishPort=3002:3002
|
||||
Volume=${host_upload_directory}:/usr/src/app/upload:z
|
||||
Volume=/etc/localtime:/etc/localtime:ro
|
||||
Exec=start.sh microservices
|
||||
#Unmask=/dev/dri:/dev/dri #May be needed if doing HWA
|
||||
#UserNS=keep-id #May be needed if doing HWA
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
```
|
||||
|
||||
immich-ml.container
|
||||
```bash
|
||||
|
||||
[Unit]
|
||||
Description=Immich Machine Learning
|
||||
Requires=immich-redis.service immich-database.service
|
||||
|
||||
[Container]
|
||||
#AddDevice=/dev/dri:/dev/dri #Needed for HWA
|
||||
#AddDevice=nvidia.com/gpu=0 #Needed for nvidia HWA, after setting up container tools
|
||||
AutoUpdate=registry
|
||||
EnvironmentFile=${location_of_env_file}
|
||||
Image=ghcr.io/immich-app/immich-machine-learning:release
|
||||
Label=registry
|
||||
Network=slirp4netns:port_handler=slirp4netns
|
||||
PublishPort=3003:3003
|
||||
Volume=${cache_directory}:/cache:z
|
||||
Volume=/etc/localtime:/etc/localtime:ro
|
||||
#Unmask=/dev/dri:/dev/dri #May be needed for HWA
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
```
|
||||
|
||||
immich-redis.container
|
||||
```bash
|
||||
[Unit]
|
||||
Description=Immich Redis
|
||||
|
||||
[Container]
|
||||
AutoUpdate=registry
|
||||
Image=registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
|
||||
Label=registry
|
||||
Network=slirp4netns:port_handler=slirp4netns
|
||||
PublishPort=6379:6379
|
||||
Timezone=America/Montreal
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
```
|
||||
|
||||
immich-server.container
|
||||
```bash
|
||||
[Unit]
|
||||
Description=Immich Server
|
||||
Requires=immich-redis.service immich-database.service
|
||||
|
||||
[Container]
|
||||
AutoUpdate=registry
|
||||
EnvironmentFile=${location_of_env_file}
|
||||
Image=ghcr.io/immich-app/immich-server:release
|
||||
Label=registry
|
||||
Network=slirp4netns:port_handler=slirp4netns
|
||||
Exec=start.sh immich
|
||||
PublishPort=3000:3000
|
||||
PublishPort=3001:3001
|
||||
Volume=${host_upload_directory}:/usr/src/app/upload
|
||||
Volume=/etc/localtime:/etc/localtime:ro
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
```
|
1
podman-quadlet.md
Symbolic link
1
podman-quadlet.md
Symbolic link
@ -0,0 +1 @@
|
||||
docs/install/podman-quadlet.md
|
Loading…
x
Reference in New Issue
Block a user