In !19033 (merged) we defined a Plan.default which could be used by self-hosted installation to define limits on EE installations. This will enable admins to set limits via the DB/rails console as this is an MVC.
In this issue we need to move the usage of PlanLimits to CE.
This would involve:
move a minimal version of Plan to CE
move PlanLimits entirely to CE
move current limit enforcements to CE (pipeline size, pipeline activity, job activity)
Also ensure that:
fixtures are created correctly for development and production environment (implement what was attempted here !20303 (closed))
This page may contain information related to upcoming products, features and functionality.
It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes.
Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
In !19033 (comment 234645138) we changed a bit the strategy: We are going to define a default plan which would be available for self-hosted installations. Admins can set instance-wide limits for the default plan. This is a very cheap way to propagate the limits to self-hosted users.
@jlenny in %12.5 we are enabling pipeline limits for Gitlab.com. This issue is for propagating these limits to self-hosted installation. Aside from allowing to fix https://gitlab.com/gitlab-org/gitlab/issues/33234 it could be a nice feature for admins.
@jlenny - we'd like to expose both apply and expose these limits to self-managed customers so they too can benefit from this work. What we find as best practices on GitLab.com we should apply to self-managed.
@joshlambert@fabiopitino that makes sense but in terms of priority how critical is it? This is a confidential issue so it's hard to judge demand. There's a lot queued up that seems to be higher priority, but am I missing something?
This is effectively implemented already (as of before, but not in all cases). So, we just provide a generic mechanism for support any sorts of application limits, exposing this one as well.
Given the changes we made to !19033 (merged) as part of closing #32823 (closed), this could possibly be closed as consequence. Keeping it open for tracking purpose. It may not need any additional work.
Does this issue actually need to be confidential? It was created that way by you @fabiopitino but I'm not sure what part of it needs to be kept secret, especially if this is just adding a feature from gitlab.com to self-managed.
@jlenny The reason why I made it confidential in the first place is because it's linked to #32823 (closed) which highlights the lack of limits on Gitlab.com as of today and these could be potentially exploited by us advertising it. I've seen we have not been consistent though with the confidentiality for all related issues.
@dimitrieh Yes, this is only to set the limits in the database and the backend will enforce them. In #34634 (comment 234982006) some conversations started in how to extend that across the application and even define a UI for admins.
I'm not sure we have a proper issue for it though.
@ayufan As I think of this again, the current implementation of PlanLimits with the addition of Plan.default will make limits already available to self-hosted, as long as they use EE, right?
Do we want to make this a CE feature? @jlenny WDYT?
I think that adding both free and default is what is causing confusion as:
free must only exist in Gitlab.com
default must exist in self-hosted, if exists in Gitlab.com is not used
Maybe we need to have only 1 of them. How about in #32824 (closed) we remove Plan.default and use Plan.free on self-hosted? This way we simplify the model by having Plan.free to also be the default plan on self-hosted. The other paid hosted plans could be added to the fixture for all environments but they won't be used except for Gitlab.com.
This makes Plan.free the only plan where limits should be defined.
Ideally we should use Plan.default instead of Plan.free on self-hosted but Namespace#actual_plan_name is used a lot on Gitlab.com with the expectation that it could default to free. This is IMO another ~"technical debt" because we are using actual_plan_name as a mix of presentation logic and plan policy. If we could split that and have actual_plan_name to show Free in Gitlab.com UI and in the backend act as Plan.default we could invert that and have Plan.default instead of Plan.free. But this further refactoring concerns me, same as #35161 and #34975 (closed). E.g. Namespace#find_or_create_subscription creates a "free" subscription by default which could cause problems when on self-hosted is expected to be default.
I think a safer option is to use what we already have, which is free plan.
Kamil
Anything that is simpler. However, one thing that confuses me is the meaning of free. On self-hosted it does not make sense.
I guess, it really depends on how it looks. I consider the free to be a specific to GitLab.com, and we have to create it manually, because there's no proper interface to create it.
This leads me to another thought: the free does not differ from any other hosted plans, like silver and bronze. Why we have the special handling for free in such case? This confuses me more than introduction of Plan.default which is a fallback case in all other cases.
So, what I'm saying is not a problem that we create default+free, the problem is that free is created and considered to not be part of all_hosted_plans.
I would try to resolve the special handling of free and make it behave as any other plan that could be created.
Fabio
Anything that is simpler. However, one thing that confuses me is the meaning of free. On self-hosted it does not make sense.
Totally agree with that. I think that after #35161 and #34975 (closed) we should rename entirely free to default which is a name that makes sense for both self-hosted and Gitlab.com. Showing the default plan as Free in the UI is a presentation detail that should be handled differntly, as stated in !20303 (comment 247635800)
the free does not differ from any other hosted plans, like silver and bronze. Why we have the special handling for free in such case?
The free plan seems to be created/associated to the namespace by Namespace#generate_subscription by default, so it's not a special plan and it's also considered a fallback.
the problem is that free is created and considered to not be part of all_hosted_plans.
This is a problem indeed. Free should be part of ALL_HOSTED_PLANS
I'm moving the discussion to #32824 (closed) where we can decide how to proceed.
Some design concerns highlighted during a Slack conversation with @ayufan about ~"technical debt" around Plan model:
When we calculate Namespace#actual_plan we call generate_subscription if one does not exist for the namespace. This defaults to creating a free subscription as fallback. On self-hosted this would end up associating namespaces to a free plan which should not exist on self-hosted. Instead the fallback should be default. This could actually cause a bypass of the limits that admins set for default plan, because any plan (free included) by default has no limits.
We should probably only have 1 of either default or free plans. Both makes things confusing. The one being chosen should be the only fallback plan on both Gitlab.com, self-hosted EE and self-hosted CE.
Using free as fallback is the easiest because it's already widely used for Gitlab.com but the name "free" does not make sense for self-hosted. It means in the first iteration admins on self-hosted would set limits for a free plan. This would happen anyway in the rails console and not yet exposed via the UI.
Using default as fallback means that we need to break the dependency between the fallback plan and UI presentation logic where we display "Free plan". It would also involve a database migration to change instances of free plan to default. This would involve a larger refactoring.
3rd options could be using free as MVC and work towards renaming it to default in the long term.
The fact that we are calling generate_subscription on self-hosted it's a bad design. Namespace should probably be associated to a plan directly with an additional subscription association if plan different than free/default.
Outstanding ~"technical debt" issues that require attention in the same domain:
@ayufan - is there another group that you could recommend who would be able to deliver this? Maybe groupmemory - since enabling our self-managed instances to apply limits would go a long way towards improving their own stability and isolation?
Not sure, but this is pretty straightforward now to move it CE. I'm reluctant to say that this is groupmemory, but someone needs to do it. It is related to general system stability/security/usage and there's very little related to memory optimisation.
What's the priority or urgency in shipping this? If it does go a long way towards improving stability and isolation, then it seems to align with our goals for availability and the isolation working group.
I see a weight of 2 and @ayufan comment that this is pretty straightforward, but when I read through the description and comments it looks like this could be test intensive to make sure we covered all of the permutations. Thoughts?
To @ayufan's point, this is not directly related to memory optimization. However, if this does help with customer experience by allowing them controls to improve stability, and potentially isolation, this seems to be a worthy effort to review for %12.8 for the memory team. Thoughts @joshlambert ?
I see a weight of 2 and @ayufan comment that this is pretty straightforward, but when I read through the description and comments it looks like this could be test intensive to make sure we covered all of the permutations. Thoughts?
@craig-gomes Tests are already done. I think it is more a matter of moving changes and specs from EE to CE. DB does not to be moved, as CE and EE have the same DB schema already, so we only talk about code-changes.
To @ayufan's point, this is not directly related to memory optimization. However, if this does help with customer experience by allowing them controls to improve stability, and potentially isolation, this seems to be a worthy effort to review for %12.8 for the memory team. Thoughts @joshlambert ?
I think we, as a company, should do this in %12.8 or %12.9. I don't know of a better group to tackle this, so if we can fit this in that would be great. I don't think this is higher priority than the import/export work, but if we have room in %12.8 after those items it would be great to do this.
@ayufan - one question I do have is how Plan.default maps to other plans. Is this effectively the plan that "Core" projects have on GitLab.com? So for example, if we ship the most limited plan to Core on GitLab.com, that would become the default for all self-managed projects?
one question I do have is how Plan.default maps to other plans. Is this effectively the plan that "Core" projects have on GitLab.com? So for example, if we ship the most limited plan to Core on GitLab.com, that would become the default for all self-managed projects?
# GitLab.com (today)Plan.gold/silver/bronze/free# EE (today)Plan.default# CE (once backported)Plan.default
So, AFAIK on-premise EE user already have ability to configure limits.
This sounds like it requires a decent amount of domain knowledge and I find it difficult to estimate this based just on what I've read here. Sounds like a great opportunity to fill in any potential knowledge gaps on @gl-memory as we pick this up.
@craig-gomes As this was assigned to ~"group::continuous integration" before I was thinking of working on it as I had put some thoughts together with Kamil. However I'm not actively working on it so it should be unassigned.
I think all the details are reported in the issue but I'm happy to help if anything is not clear.
Not working on this directly but I have another MR that implements application limits - !27004 (merged). I didn't add self-hosted limits not to create the same problem as last time.
This is just to say that we need this backported ASAP since we're going to be building more and more application limits that depend on the default plan.