You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a config switch in config.php to tell OC that we're in a clustered environment.
At first, this switch must only make sure to force-disable the market app. The reason is that if someone uses the market app to install an app on a single cluster node, the app code will be missing from the other nodes and cause breakage. Force-disabling the market app also means that occ upgrade will not update any app code when run on a single node as it would cause similar issues.
Additionally, the switch could also make the configuration file read-only (like "config_is_read_only").
When followig this approach, how can apps be installed respectively updated?
The following is much more efford and going another path, but what about to tell the config the presence of the cluster node(s) (yes, more than two nodes...), and find a way to start installing / updating nodes from the command line only, maybe by just dropping the line to copy paste ? and an additionally check (via the database ?) that all nodes have/run the same versions - else dropping a warning ?
I consider the management of a clustered setup to be a complex task and a very individual task as well.
Usually I'd expect a clustered setup to be driven my some kind of automated deployment mechanism.
This might be something like docker, ansible or what soever.
The operator of such a clustered setup will prepare the rollout of updates to core and apps via this single deployment mechanism. We shall not intervene in this mechanism by any means.
Furthermore you cannot run mixed versions of an app. Assume there is a database schema change involved: the new code will apply the schema change and all nodes with the old code will no longer work.
I think there are enough tools out there to allow proper deployment of clustered setups - there is no need to reinvent the wheel and add any kind of mechanism into the ownCloud code base.
@mmattel the points you mention about tracking node app versions has been discussed before. It would be a possible extension to make cluster setup easier. But said extension is not a trivial addition. We identified some potential race conditions with host name updates when dealing with docker nodes. Something to be discussed later on once we consider going that route.
For now the flag is added to avoid admins mistakenly creating broken setups through market app installs.
At first, this switch must only make sure to force-disable the market app. The reason is that if someone uses the market app to install an app on a single cluster node, the app code will be missing from the other nodes and cause breakage. Force-disabling the market app also means that occ upgrade will not update any app code when run on a single node as it would cause similar issues.
In order to fix this issue on a more global basis I suggest to prevent app installation and upgrade in core. The api methods ca be called by any app. Only disabling market seems to be too specific from my pov.
@DeepDiver1975 which API methods ? Do you mean that an app could call APIs to install/upgrade other apps ? If yes, I agree, these code paths should be blocked, possibly with exceptions.
@DeepDiver1975 which API methods ? Do you mean that an app could call APIs to install/upgrade other apps ? If yes, I agree, these code paths should be blocked, possibly with exceptions.
@PVince81@DeepDiver1975 hm, working on federated cluster I had the necessity of finding out if requests originated from another apache server or the load balancer. I think it would be nicer to have a list of valid web servers. From a support perspective it would be great to have more information on the overall owncloud architecture, eg:
I think it would be nicer to have a list of valid web servers
That would be for the second phase. It becomes way more complicated when you need to detect the host name of a web server and dealing with "expired" web server host names with docker instances that are restarted and reuse the same host names. Ask @felixboehm and @patrickjahns as we had a discussion about this, and whatever solution we'd need would be more than just adding this switch. Something to be designed, estimated and scheduled.
The switch is now here only to prevent the market app to work.
Thinking about a very dynamic environment where nodes are added and removed based on their needs I consider an entry in the config.php the wrong approach.
Furthermore in a clustered setup where multiple nodes act as workers of one instance there should be no knowledge about the other nodes. Nodes are stateless. Any request can be executed by any node. Any inter node communication is a breakage of this pattern.
I think the problem with host names was if we count the host names to detect if we're in a clustered env or not. If only one host: single node. However in the case of docker instances getting a new host name upon boot up, there would be a small time window with the old host name and the new host name, which add up to two. So OC would believe it's in a clustered env for this period of time until the host name expires after TTL... Race condition fun...
@PVince81@DeepDiver1975 what is the difference between upgrade.automatic-app-update and operation.mode ... the former at least tells you what it does ... operation.mode is even cryptically documented as The mode of operations has various impact on the behavior of ownCloud. That doesn't tell the admin when he needs to change this.
why is there no allow_user_to_change_email setting for this? why are there config options for this at all? The user backend should indicate if an attribute is readonly or not
No, because this is about upgrading apps automatically when running occ upgrade.
The use case is for an admin who wants to manually decide when to update apps either by clicking "Update" in the web UI market app or CLI. So we don't block install/update here.
Activity
mmattel commentedon Nov 5, 2017
When followig this approach, how can apps be installed respectively updated?
The following is much more efford and going another path, but what about to tell the config the presence of the cluster node(s) (yes, more than two nodes...), and find a way to start installing / updating nodes from the command line only, maybe by just dropping the line to copy paste ? and an additionally check (via the database ?) that all nodes have/run the same versions - else dropping a warning ?
DeepDiver1975 commentedon Nov 6, 2017
I consider the management of a clustered setup to be a complex task and a very individual task as well.
Usually I'd expect a clustered setup to be driven my some kind of automated deployment mechanism.
This might be something like docker, ansible or what soever.
The operator of such a clustered setup will prepare the rollout of updates to core and apps via this single deployment mechanism. We shall not intervene in this mechanism by any means.
Furthermore you cannot run mixed versions of an app. Assume there is a database schema change involved: the new code will apply the schema change and all nodes with the old code will no longer work.
I think there are enough tools out there to allow proper deployment of clustered setups - there is no need to reinvent the wheel and add any kind of mechanism into the ownCloud code base.
Finally: adding this flag seems reasonable 👍
PVince81 commentedon Nov 6, 2017
@mmattel the points you mention about tracking node app versions has been discussed before. It would be a possible extension to make cluster setup easier. But said extension is not a trivial addition. We identified some potential race conditions with host name updates when dealing with docker nodes. Something to be discussed later on once we consider going that route.
For now the flag is added to avoid admins mistakenly creating broken setups through market app installs.
DeepDiver1975 commentedon Nov 6, 2017
In order to fix this issue on a more global basis I suggest to prevent app installation and upgrade in core. The api methods ca be called by any app. Only disabling market seems to be too specific from my pov.
PVince81 commentedon Nov 6, 2017
@DeepDiver1975 which API methods ? Do you mean that an app could call APIs to install/upgrade other apps ? If yes, I agree, these code paths should be blocked, possibly with exceptions.
PVince81 commentedon Nov 6, 2017
However we need to make sure that the DB upgrade part can run. It's only the code upgrade that we block ?
DeepDiver1975 commentedon Nov 6, 2017
app installation is an api on the IAppManager - see https://github.com/owncloud/core/pull/29458/files#diff-8fa91b147fc76360cb3cfca41a1db57dR444
Adding mode of operations - either single-instance or clustered-insta…
Adding mode of operations - either single-instance or clustered-insta…
[stable10] Adding mode of operations - either single-instance or clus…
butonic commentedon Nov 7, 2017
@PVince81 @DeepDiver1975 hm, working on federated cluster I had the necessity of finding out if requests originated from another apache server or the load balancer. I think it would be nicer to have a list of valid web servers. From a support perspective it would be great to have more information on the overall owncloud architecture, eg:
Part of this can be learned and shared by storing it in the db, but learning != having an explicit configuration.
PVince81 commentedon Nov 7, 2017
That would be for the second phase. It becomes way more complicated when you need to detect the host name of a web server and dealing with "expired" web server host names with docker instances that are restarted and reuse the same host names. Ask @felixboehm and @patrickjahns as we had a discussion about this, and whatever solution we'd need would be more than just adding this switch. Something to be designed, estimated and scheduled.
The switch is now here only to prevent the market app to work.
butonic commentedon Nov 7, 2017
It should prevent the market app from installing app? Downloads should still be possible.
Regarding cluster deployments it feels redundant with the
config_is_read_onlyoption. What are the scenarios:So, IMO we can reuse the
config_is_read_onlyoption (probably rename it). Or ... to reduce the number of code paths, make it readonly by default.DeepDiver1975 commentedon Nov 7, 2017
Thinking about a very dynamic environment where nodes are added and removed based on their needs I consider an entry in the config.php the wrong approach.
Furthermore in a clustered setup where multiple nodes act as workers of one instance there should be no knowledge about the other nodes. Nodes are stateless. Any request can be executed by any node. Any inter node communication is a breakage of this pattern.
DeepDiver1975 commentedon Nov 7, 2017
absolutly - but at the end @PVince81 and @felixboehm made the decision to add this ....
PVince81 commentedon Nov 7, 2017
I think the problem with host names was if we count the host names to detect if we're in a clustered env or not. If only one host: single node. However in the case of docker instances getting a new host name upon boot up, there would be a small time window with the old host name and the new host name, which add up to two. So OC would believe it's in a clustered env for this period of time until the host name expires after TTL... Race condition fun...
butonic commentedon Nov 9, 2017
It seems we need to document how to configure ownCloud in different deployment scenarios.
make things less automatic, suitable for deployment tools like ansible, puppet, chef, whatever
@PVince81 @DeepDiver1975 what is the difference between
upgrade.automatic-app-updateandoperation.mode... the former at least tells you what it does ...operation.modeis even cryptically documented asThe mode of operations has various impact on the behavior of ownCloud.That doesn't tell the admin when he needs to change this.(reverse) proxy stuff
directories
make things readonly
allow_user_to_change_emailsetting for this? why are there config options for this at all? The user backend should indicate if an attribute is readonly or notother systems related
jeez ... how can anyone set up oc correctly?
butonic commentedon Nov 9, 2017
cant we just reuse upgrade.automatic-app-update ?
PVince81 commentedon Nov 9, 2017
No, because this is about upgrading apps automatically when running occ upgrade.
The use case is for an admin who wants to manually decide when to update apps either by clicking "Update" in the web UI market app or CLI. So we don't block install/update here.
lock commentedon Aug 1, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.