I recently wrote about spawning KVM VMs like Docker Containers using GitLab CI. My friend was trying to replicate what I was doing and was having some issues visualizing it all. There are a lot of moving parts to keep track of. To help him out, I made the above diagram. Hopefully some of you find it useful.
One thing to note, that the diagram doesn't show is that you can set the KVM host runner to accept multiple concurrent jobs in the runner config and then you can have multiple spawned VMs running jobs at once. For diagramming purposes it was easier to just show one VM.
Other use cases
As I started writing this, I started thinking about other potential use cases, I came up with a couple:
- Using another VM provider - Parallels, VMware, HyperV, etc
- Launching AWS or some other cloud machines. Instead of using local VMs, you could launch VMs in the cloud.
- If your job required your software to interact with other machines, ie some sort of database or webserver, you could modify the launch and cleanup scripts to have several machines running at once.
Setting up CI/CD can be a challenge. As with any good challenge it also offers some rewards. It has drastically improved the way I write software. It is probably the single step change in my effectiveness as a developer that I've seen in my career. I can't imagine not using it anymore. If you would like help setting things up so you can get all those benefits, contact us. We are working hard on trying to make the benefits of CI/CD accessible to all and we'd love to talk to you.