How to set up a runner in the cloud for GitLab.com to solve out of memory problem

I think to solve my problem I need to set up my own runner, but if you know a better way to solve my problem, please let me know. Below I’ll explain the problem and what I think I know of the solution. I need help filling in missing knowledge.

Problem Statement
My CI pipeline tests my web app using Cypress.io+Percy.io. Sometimes the test job fails with out-of-memory errors such as:

[838:0901/035111.494376:FATAL:memory.cc(38)] Out of memory. size=688128
We detected that the Chromium Renderer process just crashed.
This is the equivalent to seeing the ‘sad face’ when Chrome dies.
This can happen for a number of different reasons:

  • You wrote an endless loop and you must fix your own code
  • There is a memory leak in Cypress (unlikely but possible)
  • You are running Docker (there is an easy fix for this: see link below)
  • You are running lots of tests on a memory intense application
  • You are running in a memory starved VM environment
  • There are problems with your GPU / GPU drivers
  • There are browser bugs in Chromium
    You can learn more including how to fix Docker here:
    https://on.cypress.io/renderer-process-crashed
    We detected that the Chromium Renderer process just crashed.
    This is the equivalent to seeing the ‘sad face’ when Chrome dies.
    This can happen for a number of different reasons:
  • You wrote an endless loop and you must fix your own code
  • There is a memory leak in Cypress (unlikely but possible)
  • You are running Docker (there is an easy fix for this: see link below)
  • You are running lots of tests on a memory intense application
  • You are running in a memory starved VM environment
  • There are problems with your GPU / GPU drivers
  • There are browser bugs in Chromium
    You can learn more including how to fix Docker here:
    https://on.cypress.io/renderer-process-crashed

This happens quite frequently but not all of the time. The support team at Percy.io thinks I need to use a runner with more memory.

Solution Statement
I want to run everything in the cloud, I do not want to install my own machines. I want to continue using GitLab.com, I do not want to switch to my own hosted GitLab. Am I able to set up my own runner in this scenario? If so, how do I go about setting up the runner? Where in the cloud do I set it up? I am using Google Cloud Platform (not AWS nor Azure) so is it an option to host my runner on Google Cloud Platform? How do I go about setting that up?

Once I’ve set up my own runner, how do I tell GitLab.com’s CI to run my tests on that runner?

How do I spin that runner up and down on-demand so I’m not charged money for the machine while I’m not using it?