Skip to content

Add a runner cost factor for new public projects

What does this MR do?

This MR adds a CI runner minutes cost factor of 0.01 to public projects in namespaces created after July 17, 2021. With this cost factor, a user on the Free plan will be able to use 50000 CI runner minutes on their public projects. This cost factor is intended to prevent cryptomining abuse, the majority of which comes from new Free tier public projects.

This MR also updates the Project.with_shared_runners_limit_enabled scope to include public projects in namespaces created after July 17, 2021. This change will include these projects in the list of projects that consume CI minutes on a namespace's usage quota page.

Lastly, it updates the CI runner minutes docs to mention that public projects consume CI runner minutes at a low cost factor.

Issue: #330581
Release post MR: gitlab-com/www-gitlab-com!85418 (merged)

Screenshots

Note: to show the new functionality in these gifs, I moved the "release date" of the public project cost factor into the past. Users will not see this functionality until July 17.

In this first gif, you can see that the public project runner-minutes-public appears on its group's usage quota page. The number of minutes used shows as 0 because I have run less than the 6000 seconds worth of jobs needed use up one minute with the public project cost factor. In the Rails console, you see that the total number of consumed seconds on the group is currently 101. I then run a job on runner-minutes-public that will sleep for 300 seconds. The gif ends there to spare you from watching a job log for 5 minutes.

Screen_Recording_2021-07-01_at_14.29.57

In this second gif, you see that the 300 second sleep job has completed. In the Rails console, you see that the group has now consumed 104 seconds, 300 * 0.01 = 3 seconds more than previously.

Screen_Recording_2021-07-01_at_14.56.08

Edited by Avielle Wolfe

Merge request reports