Commit b0d52a2a authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs/shared-runners-build-minutes' into 'master'

Documentation for shared Runners build minutes quota

See merge request !1081
parents 9eab2270 f183ebc1
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
.col-sm-10 .col-sm-10
= form.number_field :shared_runners_minutes, class: 'form-control' = form.number_field :shared_runners_minutes, class: 'form-control'
.help-block .help-block
Set the maximum number of build minutes that a group can use on shared runners per month. Set the maximum number of build minutes that a group can use on shared Runners per month.
0 for unlimited. 0 for unlimited.
= link_to "(?)", help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-minutes") = link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
%span.light Build minutes quota: %span.light Build minutes quota:
%strong %strong
= group_shared_runner_limits_quota(group) = group_shared_runner_limits_quota(group)
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-minutes") = link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
Enabled Enabled
- if project.shared_runners_minutes_limit_enabled? - if project.shared_runners_minutes_limit_enabled?
- limit = project.actual_shared_runners_minutes_limit.to_i - limit = project.actual_shared_runners_minutes_limit.to_i
(Limited to #{limit} minutes per month) (Limited to #{limit} build minutes per month)
- else - else
(Unlimited minutes) (Unlimited build minutes)
- else - else
Disabled Disabled
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
.col-sm-10 .col-sm-10
= f.number_field :shared_runners_minutes_limit, class: 'form-control', min: 0 = f.number_field :shared_runners_minutes_limit, class: 'form-control', min: 0
%span.help-block#shared_runners_minutes_limit_help_block %span.help-block#shared_runners_minutes_limit_help_block
Set the maximum number of build minutes that a group can use on shared runners per month. Set the maximum number of build minutes that a group can use on shared Runners per month.
Set 0 for unlimited. Set 0 for unlimited.
Set empty to inherit global setting of #{current_application_settings.shared_runners_minutes}. Set empty to inherit the global setting of #{current_application_settings.shared_runners_minutes}.
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-minutes") = link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
- page_title "Pipeline Quota" - page_title "Pipelines quota"
%h3.page-title Group Pipeline Quota %h3.page-title
%p.light Monthly build minutes usage across shared runners for #{@group.name} Group pipelines quota
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
%p.light
Monthly build minutes usage across shared Runners for the
%strong #{@group.name}
group
.pipeline-quota.container-fluid .pipeline-quota.container-fluid
.row .row
...@@ -11,7 +16,7 @@ ...@@ -11,7 +16,7 @@
Usage since Usage since
= last_reset.strftime('%b %d, %Y') = last_reset.strftime('%b %d, %Y')
- else - else
Current Period Usage Current period usage
%div %div
= group_shared_runner_limits_quota(@group) = group_shared_runner_limits_quota(@group)
minutes minutes
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
Audit Events Audit Events
- if @group.shared_runners_enabled? && @group.shared_runners_minutes_limit_enabled? - if @group.shared_runners_enabled? && @group.shared_runners_minutes_limit_enabled?
= nav_link(controller: :pipeline_quota) do = nav_link(controller: :pipeline_quota) do
= link_to group_pipeline_quota_path(@group), title: "Pipeline Quota" do = link_to group_pipeline_quota_path(@group), title: "Pipelines quota" do
%span %span
Pipeline Quota Pipelines quota
%li %li
= link_to 'Edit Group', edit_group_path(@group) = link_to 'Edit Group', edit_group_path(@group)
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
- quota_limit = project.namespace.actual_shared_runners_minutes_limit - quota_limit = project.namespace.actual_shared_runners_minutes_limit
.bs-callout.bs-callout-warning .bs-callout.bs-callout-warning
%p %p
You have used all your shared runner minutes You have used all your shared Runners build minutes.
= "(#{quota_used} of #{quota_limit})." = "(#{quota_used} of #{quota_limit})."
- if can?(current_user, :admin_build, @project) - if can?(current_user, :admin_build, @project)
%br %br
For more information, go to the For more information, go to the
= succeed "." do = succeed "." do
= link_to namespace_project_runners_path(project.namespace, project) do = link_to namespace_project_runners_path(project.namespace, project) do
runners page Runners page
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- if cookies[:hide_shared_runner_quota_message].blank? && has_limit && namespace.shared_runners_minutes_used? && can_see_status - if cookies[:hide_shared_runner_quota_message].blank? && has_limit && namespace.shared_runners_minutes_used? && can_see_status
.shared-runner-quota-message.alert.alert-warning.hidden-xs{ data: { scope: scope } } .shared-runner-quota-message.alert.alert-warning.hidden-xs{ data: { scope: scope } }
= namespace.name = namespace.name
has exceeded their build minutes quota. Pipelines will not run anymore on shared runners. has exceeded their build minutes quota. Pipelines will not run anymore on shared Runners.
.pull-right .pull-right
= link_to 'Remind later', '#', class: 'hide-shared-runner-limit-message alert-link' = link_to 'Remind later', '#', class: 'hide-shared-runner-limit-message alert-link'
...@@ -6,7 +6,7 @@ The maximum size of the [build artifacts][art-yml] can be set in the Admin area ...@@ -6,7 +6,7 @@ The maximum size of the [build artifacts][art-yml] can be set in the Admin area
of your GitLab instance. The value is in MB and the default is 100MB. Note that of your GitLab instance. The value is in MB and the default is 100MB. Note that
this setting is set for each build. this setting is set for each build.
1. Go to **Admin area > Settings** (`/admin/application_settings`). 1. Go to the **Admin area ➔ Settings** (`/admin/application_settings`).
![Admin area settings button](img/admin_area_settings_button.png) ![Admin area settings button](img/admin_area_settings_button.png)
...@@ -16,5 +16,59 @@ this setting is set for each build. ...@@ -16,5 +16,59 @@ this setting is set for each build.
1. Hit **Save** for the changes to take effect. 1. Hit **Save** for the changes to take effect.
## Shared Runners build minutes quota
> [Introduced][ee-1078] in GitLab Enterprise Edition 8.16.
If you have enabled shared Runners for your GitLab instance, you can limit their
usage by setting a maximum number of build minutes that a group can use on
shared Runners per month. Set 0 to grant unlimited build minutes.
While build limits are stored as minutes, the counting is done in seconds.
1. Go to the **Admin area ➔ Settings** (`/admin/application_settings`).
![Admin area settings button](img/admin_area_settings_button.png)
1. Navigate to the **Continuous Integration** block and enable the Shared
Runners setting. Then set the build minutes quota limit.
![Shared Runners build minutes quota](img/ci_shared_runners_build_minutes_quota.png)
1. Hit **Save** for the changes to take effect.
---
While the setting in the Admin area has a global effect, as an admin you can
also change each group's build minutes quota to override the global value.
1. Navigate to the **Groups** admin area and hit the **Edit** button for the
group you wish to change the build minutes quota.
![Groups in the admin area](img/admin_area_groups.png)
1. Set the build minutes quota to the desired value and hit **Save changes** for
the changes to take effect.
![Edit group in the admin area](img/admin_area_group_edit.png)
Once saved, you can see the build quota in the group admin view.
![Group admin info](img/group_quota_view.png)
The quota can also be viewed in the project admin view if shared Runners
are enabled.
![Project admin info](img/admin_project_quota_view.png)
When the build minutes quota for a group is set to a value different than 0,
the **Pipelines quota** page is available to the group page settings list.
![Group settings](img/group_settings.png)
You can see there an overview of the build minutes quota of all projects of
the group.
![Group pipelines quota](img/group_pipelines_quota.png)
[art-yml]: ../../../administration/build_artifacts.md [art-yml]: ../../../administration/build_artifacts.md
[ee-1078]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1078
...@@ -286,7 +286,7 @@ feature 'Builds', :feature do ...@@ -286,7 +286,7 @@ feature 'Builds', :feature do
it 'displays a warning message' do it 'displays a warning message' do
visit namespace_project_build_path(project.namespace, project, build) visit namespace_project_build_path(project.namespace, project, build)
expect(page).to have_content('You have used all your shared runner minutes') expect(page).to have_content('You have used all your shared Runners build minutes.')
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment