DigitalSlideArchive / digital_slide_archive

The official deployment of the Digital Slide Archive and HistomicsTK.
https://digitalslidearchive.github.io
Apache License 2.0
110 stars 50 forks source link

docker-compose pull fails on ubuntu 18.04 #249

Closed andreped closed 1 year ago

andreped commented 1 year ago

I was successful in setting up DSA on a laptop with macOS 12. Installing through docker-compose worked out-of-the-box.

As it seems to work there, I then tried to set it up on a local server with Ubuntu 18.04. I was surprised to see that it failed during installation (see here). It fails when running docker-compose pull. This results in:

ERROR: Invalid interpolation format for "environment" option in service "girder": "${DSA_USER:-}"

Is there anything obvious I am missing?

andreped commented 1 year ago

Using two $$ instead of one $ in the yaml file (see here) gets me "further", e.g.,: https://github.com/DigitalSlideArchive/digital_slide_archive/blob/9b2f47d0c2a8f74d0aa4df887b87af65d88a99e9/devops/dsa/docker-compose.yml#L24

Seems like people did this in other threads as it was necessary to exit the statement. At least it does not fail during pull, but then it fails during docker-compose up, likely due to the program failing to access the environmental variables, or that I would need to apply this change on other files and places. I guess this is not the correct fix. Any ideas?

dgutman commented 1 year ago

So as your probably aware.. docker seems to have many similar flavors depending on which docker version.

There's docker-compose and docker compose, which also have different support for Linux vs Windows and Mac. It's a bit confusing.

Basically the DSA_USER env variable needs to map to the UID of the user starting and stopping the docket container so the assetstore, logs and db have appropriate permissions .

I am guessing there's some slight syntax difference between Ubuntu 18 and 20.04 or from the way your running docker, which I believe on Mac is probably using docker desktop ..

On Sun, Feb 19, 2023, 10:29 AM André Pedersen @.***> wrote:

Using two $$ instead of one $ in the yaml file (see here https://github.com/DigitalSlideArchive/digital_slide_archive/blob/master/devops/dsa/docker-compose.yml) gets me "further", e.g.,:

https://github.com/DigitalSlideArchive/digital_slide_archive/blob/9b2f47d0c2a8f74d0aa4df887b87af65d88a99e9/devops/dsa/docker-compose.yml#L24

Seems like people did this in other threads as it was necessary to exit the statement. At least it does not fail during pull, but then it fails during docker-compose up, likely due to the program failing to access the environmental variables, or that I would need to apply this change on other files and places. I guess this is not the correct fix. Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/DigitalSlideArchive/digital_slide_archive/issues/249#issuecomment-1436046258, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFODTV42OAZSZFBDDJLWUTWYJKAXANCNFSM6AAAAAAVBBPBYA . You are receiving this because you are subscribed to this thread.Message ID: <DigitalSlideArchive/digital_slide_archive/issues/249/1436046258@ github.com>

andreped commented 1 year ago

It's a bit confusing.

It sure is...

I am guessing there's some slight syntax difference between Ubuntu 18 and 20.04 or from the way your running docker, which I believe on Mac is probably using docker desktop ..

The macbook uses Docker desktop, whereas docker and docker-compose was installed through apt or snap, if I remember correctly for Ubuntu 18.04. Am I correct to assume that you have used Ubuntu 20.04 for testing DSA, right? What is the correct way to setup docker on Ubuntu 18.04, such that it works with both Ubuntu versions? The production server has Ubuntu 20.04, whereas the development server has Ubuntu 18.04.

manthey commented 1 year ago

Asa quick test, I dusted off an old Ubuntu 18.04 machine. docker-compose up works on it directly for me.

dgutman commented 1 year ago

So we used ubuntu 20.04 and Ubuntu 18.04 (and I think I've done it on ubuntu 22.04 as well).

The issue is... docker. So when I say I tested it on Ubuntu 18 and Ubuntu 20, I mean that as a "Bare metal" installation.

I now use WSL2 on my home machine, and the base image is Ubuntu 20.04. However ,when I actually do the docker-compose up (or docker compose up.. no dash), it's actually building the docker container as a pass through on my windows machine. Making things even weirder, docker-compose used to be a separate download. It still is actually, on Ubuntu (and similar OSes). On windows and mac, they have are now using docker --NO-DASH-- compose as a plugin, and apparently that plugin is written in RUST. From what I can tell, they should be compatible, but of course there's many caveats.

For example, if I just install docker from the package manage on Ubuntu 18.04, I am pretty sure it's installing a very very old version of docker. In fact, the first step on the docker.com's instructions is to make sure you purge any of these "older" docker versions before installing the latest.

https://docs.docker.com/engine/install/ubuntu/

Thus it is a bit of a confusing mess... I still "fat finger" docker-compose and docker compose, as I switch computers fairly frequently. I think this does bring up a good point though, in that I need to update the documentation and walk through these various scenarios. For this sort of thing, I am not sure if videos are "Easier" than trying to generate text-based instructions. I guess something is better than nothing...

On Mon, Feb 20, 2023 at 1:15 PM David Manthey @.***> wrote:

Asa quick test, I dusted off an old Ubuntu 18.04 machine. docker-compose up works on it directly for me.

— Reply to this email directly, view it on GitHub https://github.com/DigitalSlideArchive/digital_slide_archive/issues/249#issuecomment-1437399018, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFODTQC245R6NC46PK6W7DWYOYF7ANCNFSM6AAAAAAVBBPBYA . You are receiving this because you commented.Message ID: @.*** com>

-- David A Gutman, M.D. Ph.D. Associate Professor of Neurology Emory University School of Medicine

andreped commented 1 year ago

Asa quick test, I dusted off an old Ubuntu 18.04 machine. docker-compose up works on it directly for me.

Sounds like its purging time. Will try to reinstall docker on that server. Haven't really used docker on that machine in a while, so it likely some local setup resulting in this issue. Probably snap installed something instead of apt for instance. Wouldn't have been the first time... Can make a test tomorrow, as I may need to restart the machine after reinstall. Could try to install docker desktop, as I have had more success with that.

I still "fat finger" docker-compose and docker compose, as I switch computers fairly frequently.

We all fat finger from time to time, no worries :P

For this sort of thing, I am not sure if videos are "Easier" than trying to generate text-based instructions.

Videos are a nice suggestion, but I just think docker setup in general tend to be a bit annoying, as with CUDA for instance. But I will make a test first and let you know if it worked tomorrow. But adding more details to the docker installation directly could be a good idea nonetheless, as there seem to be so many ways installation can go wrong...

dgutman commented 1 year ago

Yes--- docker is actually the hardest part of any installation.. which I find a bit baffling to be honest. It gets worse... there's issues with the latest version of MONGODB where it needs a certain instruction set to be enabled in the BIOS. If your running "bare metal" it's not an issue, but particularly in cloud environments, and even in WSL installations, it can be ... problematic.

On Mon, Feb 20, 2023 at 1:28 PM André Pedersen @.***> wrote:

Asa quick test, I dusted off an old Ubuntu 18.04 machine. docker-compose up works on it directly for me.

Sounds like its purging time. Will try to reinstall docker on that server. Haven't really used docker on that machine in a while, so it likely some local setup resulting in this issue. Probably snap installed something instead of apt for instance. Wouldn't have been the first time... Can make a test tomorrow, as I may need to restart the machine after reinstall. Could try to install docker desktop, as I have had more success with that.

I still "fat finger" docker-compose and docker compose, as I switch computers fairly frequently.

We all fat finger from time to time, no worries :P

For this sort of thing, I am not sure if videos are "Easier" than trying to generate text-based instructions.

Videos are a nice suggestion, but I just think docker setup in general tend to be a bit annoying, as with CUDA for instance. But I will make a test first and let you know if it worked tomorrow. But adding more details to the docker installation directly could be a good idea nonetheless, as there seem to be so many ways installation can go wrong...

— Reply to this email directly, view it on GitHub https://github.com/DigitalSlideArchive/digital_slide_archive/issues/249#issuecomment-1437409673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFODTT6YJUZTJNUSCW7M3TWYOZU3ANCNFSM6AAAAAAVBBPBYA . You are receiving this because you commented.Message ID: @.*** com>

-- David A Gutman, M.D. Ph.D. Associate Professor of Neurology Emory University School of Medicine

andreped commented 1 year ago

I purged docker and docker-compose on the ubuntu desktop machine, and followed the docker installation guide as suggested in the README.

Apparently the recommended way to setup docker is through installing docker-desktop. After installing that everything works as intended. DSA deploys seemlessly on Ubuntu 18.04.

Regarding the discussion of docker-compose / docker compose, it is stated that:

From the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all
Docker Desktop versions.

Make sure you switch to [Compose V2](https://docs.docker.com/compose/compose-file/) with the docker
compose CLI plugin or by activating the Use Docker Compose V2 setting in Docker Desktop.
For more information, see the [Evolution of Compose](https://docs.docker.com/compose/compose-v2/)

Hence, after installation I had to use docker compose as docker-compose was not installed.

I assume you are aware of this, but just mentioning this here, in case anyone else run into the same issue as I. I believe the reason my docker setup failed, is because I had snap installed docker-compose or similar, which results in a very dated docker-compose version.

As this issue has been resolved, I am closing this issue.

dgutman commented 1 year ago

Yeah so the docker compose vs docker-compose is a relatively new And confusing wrinkle.. thanks for commenting on this.

On Tue, Feb 21, 2023, 4:21 AM André Pedersen @.***> wrote:

I purged docker and docker-compose on the ubuntu desktop machine, and followed the docker installation guide as suggested in the README https://docs.docker.com/compose/install/.

Apparently the recommended way to setup docker is through installing docker-desktop. After installing that everything works as intended. DSA deploys seemlessly on Ubuntu 18.04.

Regarding the discussion of docker-compose / docker compose, it is stated that:

From the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all

Docker Desktop versions.

Make sure you switch to Compose V2 with the docker

compose CLI plugin or by activating the Use Docker Compose V2 setting in Docker Desktop.

For more information, see the Evolution of Compose

Hence, after installation I had to use docker compose as docker-compose was not installed.

I assume you are aware of this, but just mentioning this here, in case anyone else run into the same issue as I. I believe the reason my docker setup failed, is because I had snap installed docker-compose or similar, which results in a very dated docker-compose version.

As this issue has been resolved, I am closing this issue.

— Reply to this email directly, view it on GitHub https://github.com/DigitalSlideArchive/digital_slide_archive/issues/249#issuecomment-1438131308, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFODTR2WHMJLMA34C7TYZLWYSCIBANCNFSM6AAAAAAVBBPBYA . You are receiving this because you commented.Message ID: @.*** com>