immich icon indicating copy to clipboard operation
immich copied to clipboard

Docker-less Alpine installation

Open Chiogros opened this issue 3 years ago • 20 comments

Hi,

The docker-based installation is not convenient for everyone. For example, a docker-less installation would allow LXC/D containers usage, without using tricky tips for using Docker inside of them.

I already successfully installed a standalone Immich. This branch would be used for scripting a command-line interactive installation.

Thanks for your feedback!

Chiogros avatar Aug 31 '22 12:08 Chiogros

FYI, you can run this image to run docker in LXC normally

image

This is how I run Immich on my Promox/LXC setup

alextran1502 avatar Aug 31 '22 13:08 alextran1502

There are some tips to run Docker in LXC containers (playing with nesting option if I remember), although IMO it is not the best way to do.

Chiogros avatar Aug 31 '22 13:08 Chiogros

There are some tips to run Docker in LXC containers (playing with nesting option if I remember), although IMO it is not the best way to do.

What are the reasons?

alextran1502 avatar Aug 31 '22 14:08 alextran1502

Allowing a container to go out of its initial scope, even if sometimes it can be convenient, is not the good way just for running applications.

In the same way as in Docker you could use --privilegied, running a LXC container with privilegied rights could lead to some security flaws. (My) PVE is hosting toons of services, I can't imagine a single one being able to disturb the host system.

Chiogros avatar Aug 31 '22 14:08 Chiogros

Allowing a container to go out of its initial scope, even if sometimes it can be convenient, is not the good way just for running applications.

In the same way as in Docker you could use --privilegied, running a LXC container with privilegied rights could lead to some security flaws. (My) PVE is hosting toons of services, I can't imagine a single one being able to disturb the host system.

It's my point of view, I though it could interest some people. If not, we can close the PR, no problem.

Fair assessment. I was asking for my knowledge. You are welcome to implement the PR. I bet there are people that don't want to use Docker as a mean of deployment the app

alextran1502 avatar Aug 31 '22 14:08 alextran1502

Great news, thanks!

Chiogros avatar Aug 31 '22 15:08 Chiogros

There are still a few bugs with Alpine services. I'm working on.

Chiogros avatar Sep 04 '22 10:09 Chiogros

Hey @alextran1502,

I solved last bugs, you can try it yourself. If you encounter anything bad or think things different, please tell me, I'll try to do my best.

I tried to implement machine-learning in Alpine. I better understand why you have not set up machine-learning in an alpine image...

So for the moment, expected for ML, everything seems to work. ML installation is skipped.

Thanks for your feedback.

Chiogros avatar Sep 04 '22 19:09 Chiogros

Hi @Chiogros, your contribution is so interesting. Your scripts are quite readable as well. Would you mind if I give you some questions?

  1. Can we put /web/immich-web, /server/immich-server, /server/immich-microservices, /machine-learning/immich-machine-learning in installation directory like alpine.sh? I found that these files may work only with Alpine OS, especially OpenRC.
  2. Can we fetch alpine_ver directly from current user's OS? As you can see if user try to run your script on another alpine version, it can cause error from package updating.

I also have a plan to create standalone docker image by using PM2. I hope I can re-use your script.

panoti avatar Sep 04 '22 19:09 panoti

Hi @panoti,

Can we put /web/immich-web, /server/immich-server, /server/immich-microservices, /machine-learning/immich-machine-learning in installation directory like alpine.sh? I found that these files may work only with Alpine OS, especially OpenRC.

I first thought about the same architecture as you: ./installation/services/openrc/. In this way, we could then support systemd-based OS by mkdir-ing ./services/systemd/ and translate openrc services to systemd services.

However, every docker images used are alpine images, excepted for ML. Keeping docker/standalone OS the same would certainly be easier to maintain (same packages name, package manager, shell, ...). But it's a way we could try.

Can we fetch alpine_ver directly from current user's OS? As you can see if user try to run your script on another alpine version, it can cause error from package updating.

Yes, it's on my todo-list :)

Thanks!

Chiogros avatar Sep 04 '22 20:09 Chiogros

I first thought about the same architecture as you: ./installation/services/openrc/. In this way, we could then support systemd-based OS by mkdir-ing ./services/systemd/ and translate openrc services to systemd services.

I really like this organization because it may help us distinguish between service managers.

However, every docker images used are alpine images, excepted for ML. Keeping docker/standalone OS the same would certainly be easier to maintain (same packages name, package manager, shell, ...). But it's a way we could try.

yeah, but I believe that it will make our source code become mess up if we have more kind of service managers like systemd, sysvinit, ....

Yes, it's on my todo-list :)

Sound great, thank you.

panoti avatar Sep 05 '22 08:09 panoti

Very interesting PR. I'll use it as a basis for a coming Yunohost package 🚀 !

Limezy avatar Sep 06 '22 10:09 Limezy

Hi all,

I tried to find a way to run TensorFlow on Alpine, without success. I've found a packaged glibc for Alpine, but I have a sticky deps/lib/libtensorflow.so.2: __memcpy_chk: symbol not found at runtime. The only thing we could get for the moment for Alpine is an installation without ML.

However, I'll look for a Debian full installation script. In this way, ML could be installed on the same machine as DB and server.

I also look for an upgrade functionnality.

To be continued...

Chiogros avatar Sep 06 '22 17:09 Chiogros

Debian/Ubuntu may be more popular than alpine. Machine learning service is optional, so if you wanna continue using alpine, just skip it in default.

panoti avatar Sep 06 '22 18:09 panoti

Thank you for the detail comments in each file. It helps a lot!

I think we want to include an installation script for Debian/Ubuntu as well. What is your plan on this?

alextran1502 avatar Sep 07 '22 11:09 alextran1502

What is your plan on this?

I didn't started anything for Debian/Ubuntu, but I'll start as soon as everything will be okay for Alpine (except ML).

There is one thing and a half to do to support another distro:

  • find the corresponding packages for its package manager + distro + version
  • for systemd family, port OpenRC services files (done once)

The longer will be the first one as you can imagine.

Chiogros avatar Sep 07 '22 20:09 Chiogros

Hi, I finally managed how to upgrade Immich. Everything is okay for me, I let you review what have been done since your last feedback.

Chiogros avatar Sep 08 '22 21:09 Chiogros

Everything looks good to me. Can you write down some words for the testing procedure and the required environment to test? Thank you for your contribution!

alextran1502 avatar Sep 11 '22 23:09 alextran1502

Everything looks good to me. Can you write down some words for the testing procedure and the required environment to test? Thank you for your contribution!

Hope it is what you were looking for. If not, please let me know!

Chiogros avatar Sep 14 '22 19:09 Chiogros

@Chiogros Thank you, I will spin up an alpine VM and test then let you know the result. We probably need to move all of the instruction to the WIKI to keep things nice and clean in the readme. It is getting long :P

alextran1502 avatar Sep 14 '22 21:09 alextran1502

Hello everybody, I finally convinced myself to start a Docker VM. Good luck to everyone who could want to maintain this script.

Chiogros avatar Jan 15 '23 18:01 Chiogros