Giter VIP home page Giter VIP logo

docker-ephemeral-cloud's Introduction

Docker Ephemeral Cloud plugin

Build Status

Introduction

Ensuring Jenkins has a reliable, scalable, and flexible job slaves is a challenge. The Docker Ephemeral Cloud plugin provides an elastic pool of slaves, using Docker containers, that live only as long as the job.

Motivations

  • Elastic slaves. An executor pool that scales to demand.
  • Perfect isolation. Builds are always executed in a clean environment, isolated from others.
  • Low maintenance. No always-on slaves to maintain.
  • Easy build environments. Environments packaged and shared as Docker images.
  • Focus on builds and stateless jobs.

How it works

When a job is scheduled, Jenkins checks for Docker image configurations that match the labels of the job. When one is found, Docker is invoked via REST APIs to pull the image and run the container. Within the container, the Jenkins JNLP slave jar is downloaded and run. Communication is established to the Jenkins master and the new slave node performs the requested job. When complete, the container is stopped and removed.

Features

  • Use Docker containers as Jenkins slaves.
  • No open ports required. Containers 'phone home' via Jenkins JNLP slave connections.
  • Supports multiple Docker images using slave label mappings.
  • Connect via UNIX socket or remotely over REST. TLS supported.
  • Completely stateless. One executor, one job run per container life.

Using

Prerequisites

Jenkins prerequisites

  • Recommend Jenkins 1.609.3 or newer.
  • Jenkins URL is correctly set in global configuration.
  • JNLP slave ports are enabled and open.

Docker prerequisites

  • Recommend Docker 1.7+
  • Docker is configured and able to access the registries hosting the images.
  • Recommend using TCP + TLS for secure, remote communication.
  • Containers can reach the Jenkins master via the JNLP port.

Image prerequisites

  • Contains a Java install compatible with Jenkins with java on the path. Used for invoking Jenkins slave jar.
  • Contains curl, on the path. Used for downloading the slave jar

Configuring

  1. Add a Docker Ephemeral Cloud configuration in your Jenkins global configuration. ![Cloud Configuration] (cloud_config.png)

  2. Add a Docker image to use as a base for slave containers. ![Image Configuration] (image_basic_config.png)

  3. Run a job. You will see slaves come move through various states as they create, run, and destroy. ![Build executors] (build_executors.png)

Known issues and limitations

Docker Ephemeral Cloud plugin is built using Spotify's docker-client library. Please see their issues page for possible limitations and known issues.

Thanks

Special thanks to Spotify and other contributors to docker-client. The docker-client library is clean and intuitive, making this project a pleasure to write.

docker-ephemeral-cloud's People

Contributors

kmbulebu avatar

Watchers

 avatar  avatar

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.