Coder Social home page Coder Social logo

jfaltermeier / jiro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eclipse-cbi/jiro

0.0 1.0 0.0 16.72 MB

Jenkins infrastructure for projects hosted by the Eclipse Foundation

License: Other

Makefile 0.14% Shell 79.33% Dockerfile 3.78% HTML 0.17% Groovy 0.25% JavaScript 0.70% Jsonnet 5.63% CSS 0.01% Handlebars 10.00%

jiro's Introduction

Eclipse CBI - Jiro

Jiro is a cluster-based Jenkins infrastructure for projects hosted by the Eclipse Foundation.

What is Jiro?

The goal of Jiro is to make the administration of hundreds of Jenkins master instances on a Kubernetes based infrastructure bearable. It uses automation, templates and a configuration-as-code approach. Jiro consist of a set of custom shell scripts and a Makefile. It relies heavily on the Docker CLI, OpenShift CLI and the Jenkins Configuration as Code plugin.

Why Jiro?

After evaluating CloudBees Core (formerly known as CloudBees Jenkins Enterprise), we found it to miss important features like resource quotas and support for separate name spaces. We also expected a lower administration overhead for recurring task like setting up a new Jenkins instance, upgrading plugins, etc. Therefore we decided to evaluate a custom approach (Jiro), which turned out to be ready for prime time.

Why is it called Jiro?

You can interpret Jiro as acronym for "Jenkins Instances Running [on] OpenShift", even though the name originates from Sukiyabashi Jiro. It should be pronounced "Geero" and not be confused with a famous bug-tracking tool.

Tasks

Build and deployment tasks are implemented as Make targets. Dependencies are properly specified, so you don't need to run all the following tasks, e.g., deploy will first build and push the images, then generate the Kubernetes configuration files and finally deploy the instance on the cluster.

Build the Jenkins docker image of a project

$ make image_<project_full_name>

Push a Jenkins image to DockerHub

$ make push_<project_full_name>

Generate Kubernetes (OpenShift) configuration files

$ make k8s_<project_full_name>

Deploy Jenkins instance to the cluster

$ make deploy_<project_full_name>

Clean up build artifacts

$ make clean_<project_full_name>

For all projects at once

$ make all_images
$ make push_all_images
$ make k8s_all_instances
$ make deploy_all_instances
$ make clean_all_instances

Create a new Jenkins instance for a project

$ ./jenkins-new-instance.sh <project_full_name> <project_short_name> <project_display_name>
$ make deploy_<project_full_name>

Create a base image for a new version of Jenkins

$ cp -r jenkins-master-base/latest jenkins-master-base/<new_version>
$ rm jenkins-master-base/latest
$ ln -s jenkins-master-base/<new_version> jenkins-master-base/latest

Utilities

jenkins-cli.sh

Give it the folder to an instance and it will let you call any Jenkins CLI commands at the proper URL. You can get the list of available commands by running

  $ ./jenkins-cli.sh instances/<project_full_name> help

Examples

  • Get the version of the running Jenkins

    $ ./jenkins-cli.sh instances/<project_full_name> version
    
  • Reload the configuration as code configuration file. Note that the config map is not immediately updated on the node running the instance after it has been deployed to the cluster. You may have to wait a couple of seconds/minutes, depending on the cluster load

    $ ./jenkins-cli.sh instances/<project_full_name> reload-jcasc-configuration
    
  • Safe restart / safe shutdown of Jenkins. All instances are configured with the ExitLifecyle, meaning that a restart is actually a shutdown, letting Kubernetes re-spawn a new container thanks to the restart policy of the StatefulSet.

    $ ./jenkins-cli.sh instances/<project_full_name> safe-shutdown
    $ ./jenkins-cli.sh instances/<project_full_name> safe-restart
    
  • Put Jenkins into quiet mode

    $ ./jenkins-cli.sh instances/<project_full_name> quiet-down
    

jenkins-hard-restart.sh

Scale down to 0 the StatefulSet running Jenkins then scale it up to 1. It makes Kubernetes re-provision the pod (it may be re-scheduled on a new node).

$ ./jenkins-hard-restart.sh instances/<project_full_name>

Dependencies

Installation

OpenShift

jiro's People

Watchers

 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.