Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle docker_firsttime also in the Daemon containers #1759

Closed
2 tasks done
bschmalhofer opened this issue May 6, 2022 · 3 comments
Closed
2 tasks done

Handle docker_firsttime also in the Daemon containers #1759

bschmalhofer opened this issue May 6, 2022 · 3 comments
Assignees
Labels
docker Docker related issues enhancement New feature or request
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented May 6, 2022

Just ran into another problematic case. Started under Docker an setup with four services 'web' and one service 'daemon' and one service 'minio'. OTOBO_SYCN_WITH_S3 is set and /opt/otobo is not mounted as a volume. In the GUI I got the notification that the Daemon is not running. The message is correct as in the Daemon contaier only /opt/otobo_install/entrypoint.sh daemon is running. That process is waiting for the existence of /opt/otobo/bin/otobo.Daemon.pl. But this never happens as /opt/otobo is never populated in the container daemon. In a normal setup this is perfectly sensible, as the container web populates the directory /opt/otobo.

TODO:

  • call handle_docker_firsttime() also in the container daemon
  • But add a locking mechanism so that containers don't get into each others way

The lock is sensible anyways. as it is not guaranteed that only a single container web is started when /opt/otobo is mounted.

Originally posted by @bschmalhofer in #1755 (comment)

@bschmalhofer bschmalhofer self-assigned this May 6, 2022
@bschmalhofer bschmalhofer added the enhancement New feature or request label May 6, 2022
@bschmalhofer bschmalhofer added this to the OTOBO 10.1.5 milestone May 6, 2022
@bschmalhofer bschmalhofer added the docker Docker related issues label May 6, 2022
@bschmalhofer
Copy link
Contributor Author

Found out that using flock on mounted Docker volumes is not well supported. See https://forums.docker.com/t/docker-volume-file-permission-and-locking/24335/4. So it's back to the drawing board. Let's keep it simple and support only two cases:

  1. The current standard case: /opt/otobo is a Docker volume shared between a single web and daemon container
  2. The S3 case where /opt/otobo is part of the Docker image

re. 1.: This is handled fine in the current approach. web does the copying and daemon is waiting until /opt/otobo is available. Actually daemon is checking only the existence of bin/otobo.Daemon.pl. So there is room for a race condition. Maybe add a flag file that indicates that copy_otobo_next() has finished.

re. 2.: There is only one process active in /opt/otobo. No need for locking. We only need an indicator that daemon should call copy_otobo_next().

@bschmalhofer
Copy link
Contributor Author

Checked whether it works with separate /opt/otobo

TODO:

  • check with /opt/otobo in a volume

@bschmalhofer
Copy link
Contributor Author

No complaints so far. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Docker related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant