adphillips / ec2-slave-plugin Goto Github PK
View Code? Open in Web Editor NEWJenkins plugin for slaves on Amazon EC2
Jenkins plugin for slaves on Amazon EC2
This is a plugin to the Jenkins CI server that will allow you to setup a build slave to run on Amazon EC2 instance, given an Amazon Machine Image (AMI) id. When would you want to use this plugin? Well, this plugin would come in handy if you have then need to run builds periodically and wish to leverage Amazon EC2 cloud instances to do that work. Usage should be fairly intuitive, simply create a new node of type "EC2 Image Slave". Open up "slaveConfig.png" for an idea of what it will look like. Differs from original EC2 plugin whose intent was dynamic allocation of X number of instances from stock AMIs on demand. It is based on the idea of Ephemeral nodes. The purpose of the new plugin is to be able to configure an EC2 node in the same way you do all other nodes in Jenkins. This would allow much more flexibility on launching techniques and allow windows instances to work. • no need for a specialized EC2 launcher, Jenkins built-ins are fine • only starts and stops EC2 instances, useful when you have preconfigured AMIs but don't want them running all the time (not same as dynamic provisioning) This is a maven project. To build, run: $ mvn clean -DskipTests install this will yield a proper Jenkins plugin at target/ec2-slave.hpi You can also test this plugin in an embedded Jenkins by running $ mvn hpi:run or $ mvnDebug hpi:run TODOs: Form Fields * add help text to fields * field verification / more advanced input types for fields * writeup wiki documentation on how to prepare EC2 slaves ETC/Nice to have * list any potential runnaway instances (i.e. unbound slaves) and allow user to kill them on the spot * possibly support starting of existing (stopped) EC2 instances in addition to AMIs * workspace preservation (is there a plugin already for this?) Testing * more testing on runaway instance prevention (a slave should not spin up more than one concurrent instance)
I'm looking for a plugin that adds existing ec2 instances as Jenkins slaves by tag (i.e. existing instances that are idle). Does this or any other plugin you know of provide this functionality?
I get the AMI not found error when checking for AMI's. Any clue? Using Jenkins version 1.442
Status Code: 400, AWS Request ID: 8b4d0953-3e43-47f1-a696-aff108f9ea91, AWS Error Code: InvalidAMIID.NotFound, AWS Error Message: The AMI ID 'ami-012b7a44' does not exist
at com.amazonaws.http.HttpClient.handleErrorResponse(HttpClient.java:586)
at com.amazonaws.http.HttpClient.execute(HttpClient.java:282)
at com.amazonaws.http.HttpClient.execute(HttpClient.java:160)
at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:5010)
at com.amazonaws.services.ec2.AmazonEC2Client.describeImages(AmazonEC2Client.java:2367)
at jenkins.plugins.ec2slave.EC2ImageSlave$DescriptorImpl.doValidateAmi(EC2ImageSlave.java:158)
I am going to look at the source code tomorrow, but just thought I drop in this here in case if anyone knows about it.
(BTW - The AMI id specified in the stack trace is a public image. So feel free to use the same ID)
Thanks!
Mikkin
Even with setting the default shutdown behavior to 'terminate' and verifying that terminate protection is off the plugin only "stops" EBS instances but they don't terminate. Verified that the plugin is calling a Terminate Request.... Baffling.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.