Code Monkey home page Code Monkey logo

ec2-slave-plugin's Introduction

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)

ec2-slave-plugin's People

Contributors

adphillips avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ec2-slave-plugin's Issues

Adding ec2 instances as slaves by tag

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?

EBS Backed Instances are only "stopped" not "terminated"

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.

AMI not found error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.