I have been working around Gitlab CI from last one month. Initially, I setup gitlab shared runners. Then we thought having a self hosted runner on aws would be better to manage the cost at once place.
Actually, we have 6 micro-services using self hosted runner i.e., aws ec2 - t3.micro (2vCPU, 1GB). These jobs are to build and push a docker image & deploy it on the ECS cluster.
We have front-end android & ios projects, currently running on shared runners, which requires heavy cpu & memory resources may be t3.xlarge (4vCPU, 16GB).
I have planned on configuring AWS-Auto scaling GitLab runner with Spot instance so that all projects can run on AWS.
Microservices runner will have t3.micro as spot instance where as Frontend will have t3.xlarge spot instance for every job Gitlab Ci trigger. the spot instance life time is 60 minutes.
2 frontend applications runs together 12 times a day with 3 minutes each. 6 microservices runs together 10 times a day with 2 minutes each.
The following is the cost I predicted based on existing resource usage but not incurred by Gitlab or AWS so far.
Applications Execution Time [per Job/Day/Month] Jobs per Day SpotInsatnce Price Monthly
2 frontend 3 mins / 36 mins / 1080 mins 12 jobs t3.xlarge X 12 X 30 = $25
5 microservices 10 mins / 20 mins / 600 mins 2 jobs t3.micro X 10 X 30 = $3
Where as Gitlab provides 2000 execution minutes for just $4. Here, It is costing me approx $25 using AWS.
My question here is, is it really better to have self-hosted runner with ec2 autoscaling with spot instance or is it better with gitlab shared runner?
Or let me know If I am missing something, please enlighten me regard the same.
Thanks in advance