KorAP / KorAP-Docker

:whale2: Single Command Installation for KorAP
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

super_client_info is not created in time for profile full #3

Closed kupietz closed 8 months ago

kupietz commented 1 year ago

docker-compose 3.8 does not support depends_on/condition anymore. Maybe just use restart: on-failure and/or change Readme to start profile init first.

$ INDEX=./index /usr/local/bin/docker-compose --profile=full up
[+] Running 12/12
 ⠿ kalamar-full Pulled                                                                                                                                                    9.0s
 ⠿ full-init Pulled                                                                                                                                                       9.0s
   ⠿ ca7dd9ec2225 Pull complete                                                                                                                                           0.6s
   ⠿ 76360fc3b85c Pull complete                                                                                                                                           0.8s
   ⠿ 2d7c9db0ed61 Pull complete                                                                                                                                           3.6s
   ⠿ 269d81532972 Pull complete                                                                                                                                           4.3s
   ⠿ a045c356e9be Pull complete                                                                                                                                           4.5s
   ⠿ f2d97d92bde9 Pull complete                                                                                                                                           6.8s
   ⠿ 10b018faf0a1 Pull complete                                                                                                                                           6.9s
   ⠿ a31ae67957fe Pull complete                                                                                                                                           7.0s
   ⠿ 5be8e8f28ae6 Pull complete                                                                                                                                           7.1s
   ⠿ 020f5a3f176c Pull complete                                                                                                                                           7.1s
[+] Running 2/1
 ⠿ Container korap-docker-full-init-1      Created                                                                                                                        1.1s
 ⠿ Container korap-docker-kustvakt-full-1  Created                                                                                                                        0.0s
 ⠋ Container korap-docker-kalamar-full-1   Creating                                                                                                                       0.0s
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /home/kupietz/KorAP-Docker/super_client_info
Akron commented 1 year ago

Is that a docker-compose fork? https://docs.docker.com/compose/release-notes/ lists 2.13.0 (2022-11-23) as the most recent version and it includes depends_on.

kupietz commented 1 year ago

I mean the compose specification 3 and also the latest compose version https://docs.docker.com/compose/release-notes/ lists 2.13.0 (2022-11-23)

Both support depends_on , but not a condition option for depends_on so that you can only test if another container is started. With the old docker-compose version 1.29.2 condition still works for me.

EDIT: BTW: also with restart: on-failure it doesn't work very well.

Akron commented 1 year ago

Interesting - I guess, the compose specification deviates here from the docker compose specification. I thought following the non-implementation specific specification would help to be compatible with podman. There depends_on supports conditions. We may want to downgrade to a 2.x-version then ... ?

kupietz commented 1 year ago

Do you think this would help or have you tried it? I think the problem is that Docker Compose version v2.13.0 does not support the configoption of depends_on.

$ INDEX=./index /usr/local/bin/docker-compose --profile=full up -d
[+] Running 0/0
 ⠋ Container 230877c6b31b_230877c6b31b_230877c6b31b_korap-docker_kustvakt-full_1  Recreate                                                               0.0s
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /home/kupietz/KorAP-Docker/super_client_info
kupietz@pc-409:~/KorAP-Docker$ /usr/local/bin/docker-compose -v
Docker Compose version v2.13.0

versus:

kupietz@pc-409:~/KorAP-Docker$ INDEX=./index /usr/bin/docker-compose --profile=full up -d
Recreating korap-docker-full-init-1 ... done
Recreating 230877c6b31b_230877c6b31b_230877c6b31b_230877c6b31b_korap-docker_kustvakt-full_1 ... done
Recreating korap-docker_kalamar-full_1                                                      ... done
kupietz@pc-409:~/KorAP-Docker$ /usr/bin/docker-compose -v
docker-compose version 1.29.2, build unknown

But it doesn't matter as we can simple start profile init first.

podman-compose is a different issue.

Akron commented 1 year ago

Well - I have no problems with docker-compose 2.14.0 either way ... so I can't really say there is a difference. The containers are all created at startup and then kustvakt waits until kalamar init exits with 0.

Akron commented 1 year ago

Oh - maybe the -d is the problem? When all containers are detached, the exit code may not be catchable?

Akron commented 1 year ago

No - works for me with -d as well ...

Akron commented 1 year ago

It seems that the startup order works correctly (with all depends_on blabla) also on kodi, but the file is created on run time, not creation time. But for me configs work on kodi and they seem to be mounted (or rather loaded) on runtime instead of creation time. I created a KorAP-Docker-2 directory with an adjusted compose file and for me that worked.

Akron commented 1 year ago

While configs work on kodi, they do not work in the GitHub CI instance ...

Akron commented 1 year ago

We probably want init to be removed from the full profile and live with the separate step until we find a stable and portable oneliner.

kupietz commented 8 months ago

Seems to be rock-stable, now, and the oneliner is already on gerrit.