GithubHelp home page GithubHelp logo

perf-org-5krepos / jenkins-multi-arch-pipeline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bhaskers-blu-org1/jenkins-multi-arch-pipeline

0.0 1.0 0.0 7.59 MB

Sample configs demonstrating the creation of multi-arch Jenkins build pipelines and deploying the same on a Kubernetes cluster

License: Apache License 2.0

Dockerfile 45.98% Shell 46.94% Smarty 7.09%

jenkins-multi-arch-pipeline's Introduction

Jenkins multi-arch pipeline

This repository hosts code to do multi-arch CI/CD build pipeline using Jenkins. We have done this Proof of Concept using two arch types namely - amd64 and ppc64le. Unless otherwise specified, the multi-arch definition would mean these two architectures only.

Flow diagram

alt text

Approach 1 - Using DooD - Docker outside of Docker

In this approach, we run the docker daemon outside the jenkins slave. In order to do this, we can't use the jenkins slave as is since we have limitations w.r.t non-availability of the docker client binary in the image. Adding the docker client also means that we need to run the image as a root user inside the container instead of the jenkins user.

You can take the DooD approach in the following way:

  1. Clone this repository.

  2. Build and install the manifest tool from here: https://github.com/estesp/manifest-tool/. Alternatively please follow the instructions mentioned here to use manifest - https://docs.docker.com/edge/engine/reference/commandline/manifest/

    Note: Login to the ICP registry before pushing the images in the next step: docker login mycluster.icp:8500

  3. Build the jenkins slaves for both architecture types.

  • cd jenkins-slave-base
  • Build slave base for ppc64le: docker build -t mycluster.icp:8500/default/jenkins-slave-ppc64le -f Dockerfile.ppc64le .
  • Push the image to ICP registry: docker push mycluster.icp:8500/default/jenkins-slave-ppc64le
  • Build slave base for amd64: docker build -t mycluster.icp:8500/default/jenkins-slave-amd64 -f Dockerfile .
  • Push the image to ICP registry: docker push mycluster.icp:8500/default/jenkins-slave-amd64
  • Build manifest and push: manifest-tool --username admin --password admin push from-spec manifest-yaml-slave-base.yaml This would make the slave base image available in ICP registry.
  1. Build the jnlp slave with manifest-tool.
  • cd jenkins-slave/jenkins-jnlp-slave-amd64
  • Build jnlp slave for amd64: docker build -t mycluster.icp:8500/default/slave-jnlp-amd64 .
  • Push the image to ICP registry: docker push mycluster.icp:8500/default/slave-jnlp-amd64
  • cd ../jenkins-jnlp-slave-ppc64le
  • Build jnlp slave for ppc64le: docker build -t mycluster.icp:8500/default/slave-jnlp-ppc64le -f Dockerfile.ppc64le .
  • Push the image to ICP registry: docker push mycluster.icp:8500/default/slave-jnlp-ppc64le
  • Build manifest and push: manifest-tool --username admin --password admin push from-spec manifest-yaml-slave-jnlp.yaml
  1. Configure helm CLI using: https://www.ibm.com/support/knowledgecenter/SSBS6K_2.1.0/app_center/create_helm_cli.html

  2. Make sure your image registry is DNS resolvable. If not, then follow either of these 2 options:

  3. Take the jenkin-values.yaml found on this repository and install jenkins:

     `helm install --name jenkins -f jenkins-values.yaml jenkins`
    
  4. Log in to jenkins server. Download following plugins:

  • Docker
  • Kubernetes - Configure the plugin to work with your ICP setup.
  • Pipeline
  1. Create a Jenkins pipeline project and paste the content of the Jenkinsfile found in the root directory of this repository.

  2. Press build now.

On success you should see this on your jenkins UI:

alt text

jenkins-multi-arch-pipeline's People

Contributors

pensu avatar

Watchers

James Cloos 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.