3

To save money, I would like a large number of agent machines to be stopped and started up only when needed. Better yet, a single VM should be copied and launched on demand.

I am using Google Cloud Platform.

I see the Kubernetes plugin, used in Jenkins X, as well as the VirtualBox Plugin, but I get the sense that Jenkins might not be designed for this.

What is the standard way, if any, to do this?

Joshua Fox
  • 131
  • 4
  • but I get the sense that Jenkins might not be designed for this. Please explain why. – 030 Apr 15 '18 at 21:28
  • 1
    Because I find very little info on the Web about how to do it. If autostart were a standard approach, the documents about setting up the agent would include it as a basic case. – Joshua Fox Apr 16 '18 at 04:07
  • 1
    https://stackoverflow.com/questions/40050127/is-possible-for-jenkins-to-auto-start-and-stop-slave-nodes – 030 Apr 16 '18 at 05:52
  • 1
    Thank you. From the discussions online, it seems that the most usual way to use Jenkins is to keep a constant number of slave VMs running. – Joshua Fox Apr 16 '18 at 06:37
  • Perhaps Jenkins x provides a solution, but I have not tried. I hope that start with that the upcoming days. Did you already deploy Jenkins x? – 030 Apr 16 '18 at 07:25
  • 1
    I have not tried Jenkins X. – Joshua Fox Apr 16 '18 at 08:37
  • Also, this describes how to create ephemeral; agents in GCE https://cloud.google.com/solutions/using-jenkins-for-distributed-builds-on-compute-engine – Joshua Fox Apr 16 '18 at 08:37

2 Answers2

1

We use AWS's EC2 Plugin to spin up spot instances in AWS for our Jenkins master based on a single AMI, exactly as you describe, so Jenkins does support this behavior.

From a quick bit of searching Google Cloud seems to offer a similar solution;

Spotinst’s Jenkins Plugin helps you to do more with your Jenkins setup by allowing you to automatically configure and scale a designated Google Compute Engine Preemptible VM as Slaves up and down depending on the number jobs to be completed.

Alex
  • 4,512
  • 6
  • 27
  • 47
0

Google just announced this Jenkins plugin for GCE , which does support autoscaling.

Joshua Fox
  • 131
  • 4