Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
29d896f9
Commit
29d896f9
authored
Dec 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag to disable shared runner build minutes limit
parent
14813d1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
app/services/ci/register_build_service.rb
app/services/ci/register_build_service.rb
+12
-5
No files found.
app/services/ci/register_build_service.rb
View file @
29d896f9
...
...
@@ -13,7 +13,11 @@ module Ci
def
execute
builds
=
if
runner
.
shared?
if
ENV
[
'DISABLE_SHARED_RUNNER_BUILD_MINTUES_LIMIT'
].
to_s
==
'true'
builds_for_shared_runner
else
builds_for_sharer_runner_with_build_minutes_check
end
else
builds_for_specific_runner
end
...
...
@@ -37,6 +41,13 @@ module Ci
private
def
builds_for_sharer_runner_with_build_minutes_check
# select projects which have allowed number of shared runner minutes or are public
builds_for_shared_runner
.
where
(
"projects.visibility_level=? OR (
#{
builds_check_limit
.
to_sql
}
)=1"
,
Gitlab
::
VisibilityLevel
::
PUBLIC
).
end
def
builds_for_shared_runner
new_builds
.
# don't run projects which have not enabled shared runners and builds
...
...
@@ -44,10 +55,6 @@ module Ci
joins
(
'LEFT JOIN project_features ON ci_builds.gl_project_id = project_features.project_id'
).
where
(
'project_features.builds_access_level IS NULL or project_features.builds_access_level > 0'
)
.
# select projects which have allowed number of shared runner minutes or are public
where
(
"projects.visibility_level=? OR (
#{
builds_check_limit
.
to_sql
}
)=1"
,
Gitlab
::
VisibilityLevel
::
PUBLIC
)
.
# Implement fair scheduling
# this returns builds that are ordered by number of running builds
# we prefer projects that don't use shared runners at all
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment