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

Think about a solution for adding external dependencies into the Nextcloud container #1162

Closed
Tracked by #1163
szaimen opened this issue Sep 16, 2022 · 13 comments · Fixed by #1377
Closed
Tracked by #1163

Think about a solution for adding external dependencies into the Nextcloud container #1162

szaimen opened this issue Sep 16, 2022 · 13 comments · Fixed by #1377
Labels
2. developing Work in progress enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@szaimen
Copy link
Collaborator

szaimen commented Sep 16, 2022

E.g. for #751 and #1159 and #1214 and #475 and #1288

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of enhancement New feature or request help wanted Extra attention is needed labels Sep 16, 2022
@szaimen szaimen added this to the next milestone Sep 16, 2022
@Zoey2936
Copy link
Collaborator

I see there currently four option for this, which could work (but no option of them is perfect)

  1. Directly run the container as root
  2. Run the container as root and switch inside the entrypoint to a non root user
  3. Try to use docker exec --user root from the mastercontainer
  4. Use su-exec - but then every user can exec commands as root using su-exec root:root <command> inside the container
RUN set -ex; \
    apk add --no-cache su-exec; \
    chmod u+s /sbin/su-exec

@szaimen
Copy link
Collaborator Author

szaimen commented Sep 16, 2022

Thanks for the input! Agree, no of them is perfrect unfortunately...

@szaimen szaimen added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Sep 17, 2022
@Zoey2936
Copy link
Collaborator

Zoey2936 commented Sep 17, 2022

I think it should work, but how do you want to check that the container first starts, when the apks are installed? (Because the entrypoint doesn't know if there will be deps installed or not)
Or that it only installs packages one time and not every five minutes?

@szaimen
Copy link
Collaborator Author

szaimen commented Sep 17, 2022

Simple: we create a file that the install_dependencies script checks for and crwates after running the first time. If the file is there we exit directly

@Zoey2936
Copy link
Collaborator

And how do you want to handle the first point? (That the entrypoint first continues if the packages are installed?)

@szaimen
Copy link
Collaborator Author

szaimen commented Sep 17, 2022

The entrypoint then checks for this as well...

@szaimen
Copy link
Collaborator Author

szaimen commented Sep 17, 2022

I will think about the exact implementation details later but good to hear that you think it would work!

@Zoey2936
Copy link
Collaborator

The entrypoint then checks for this as well...

So again:
If the deps are successfully installed, it created a file.
If the file exists and cron gets executed again, it will exit.
And the entrypoint will only continue if this file exists.

  1. But what if the file will never be created, because the user don't want to install additional deps, what will the entrypoint then do? Because if it waits at least five minutes this could be annoying, also the installation of the packages could take longer than five minutes.
  2. Or what will the entrypoint do if the installation of the deps aren't installed successfully? (This could also be done using a lock file or something like this)

I know it is still WIP, but I don't understand how at least the first question can be resolved with the current logic of this implementation? Or did I misunderstand the logic?

@szaimen
Copy link
Collaborator Author

szaimen commented Sep 17, 2022

  • But what if the file will never be created, because the user don't want to install additional deps, what will the entrypoint then do? Because if it waits at least five minutes this could be annoying,

I guess we need to create a file in a persistant storage somewhere after running thr scripr successfully one time. If that is present we trigger the logic. If not we dont.

also the installation of the packages could take longer than five minutes.

We need two files for that: one that is created while we install the dependencies and removed adter it is succeasful. The other one gets created when it was successful. Then entrypoint checks if the successful file is there and waits for that max 5min but waits indefinitely when the install file is present.

  • Or what will the entrypoint do if the installation of the deps aren't installed successfully? (This could also be done using a lock file or something like this)

Then waiting max 5min for the succeed file should let it continue as the install file is not present...

@Zoey2936
Copy link
Collaborator

But would it not be better that the ADDITIONAL_APKS env gets already specified on the creation of the nextcloud container (so it gets specified as a mastercontainer env or on the aio panel), so that the entrypoint knows if it needs to wait for the installation or can skip the waiting?

@szaimen
Copy link
Collaborator Author

szaimen commented Sep 17, 2022

This would be easier from an implementation side. However I'd like to leave the logic completely out of the mastercontainer because you then do not need to recreate the mastercontainer all the time that you want to change additional dependencies. Also this makes it easier to maintain if the logic for all of this is only in one container.

@szaimen
Copy link
Collaborator Author

szaimen commented Nov 10, 2022

This is now released with v3.0.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2. developing Work in progress enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
2 participants