[Feature Request] Add Azure Container Instances Executer
Description
Azure Container Instances (ACI) just became generally available. ACI allows anyone to deploy a container with a single command and no infrastructure. GitLab Runner seems to be a perfect use case for that.
Currently, if I want an autos-scaling CI runner, I have to use something like the docker-machine runner to automatically deploy Docker to a machine in the cloud. But that takes a lot time (my job are long enough as they are). And it is quite over kill especially if you run job infrequently.
ACI containers on the other hand are built for burstability. Need a bunch of containers quick? You got it. Spin them up on ACI. They take very little time to start and you only pay for what you need. If you have a job that takes an hour to run, it only costs $0.06 (1GB memory and 1 vCPU).
While VM pricing is pretty comparable to ACI pricing, VMs with docker-machine will run longer than containers. Especially since they take a while to turn on. Most examples of a GitLab Runner setup with docker-machine have the VMs stick around until there is inactivity. That way every job doesn't take a long time to start. But that also makes it cost more. ACI containers spin up in seconds so you don't have to keep them around.
Here are two examples to illustrate that point.
Docker-machine
Someone runs a job. GitLab-Runner triggers the creation of a VM. The VM is created and starts. This took 5 minutes. The job then runs. The job only took 4 minutes. After 30 minutes of inactivity, the VM is destroyed.
- Total Job Time: 9 minutes
- Total VM Running Time: 34 minutes
- Total Cost: $0.034
ACI
Someone runs a job. GitLab-Runner creates an ACI container. The container is created and starts. This took 5 seconds. The job then runs. The job took 4 minutes. The container is immediately destroyed.
- Total Job Time: 4 minutes and 5 seconds
- Total Container Running Time: 4 minutes
- Total Cost: $0.01
Proposal
Build an ACI executer that creates an ACI container for each job and then deletes it once the job is complete.