Giter VIP home page Giter VIP logo

salt-image-builder's Introduction

Dockerfile and script to build salt images to speed up testing

https://travis-ci.com/netmanagers/salt-image-builder.svg?branch=master

This repo holds a script to build docker images with salt-minion/salt-solo pre-installed so testing Salt formulas is faster/easier, as all the basic requirements (salt, git, etc) are pre-installed in these images, allowing you to skip all the bootstrap process in the image you use.

These are based in dockerhub upstream's images for each distro supported.

The images are tested with Testinfra before commiting, to check salt got installed with the desired version and the dependencies are satisfied.

Images maintained

The distros matrix is maintained for the lastest two, not EOL'ed, major distros versions. If you need to build a version not supported in the distributed .travis.yml file, just modify it (check the env.jobs section), add the combination that suits your needs and add or reuse a suitable Dockerfile.<os_package_manager> to perform the build.

The EOLs can be checked here:

Requirements

This new version of the repo builds directly in Travis-CI. There's a silly python script to allow building the images locally if you want to. To run it, you need

  • Python3
  • Docker (ce is OK)
  • Latest Testinfra installed (>= 4.1.0)

Basic usage of the builder scripts

  1. Edit .travis.yml. Check the matrix of images to build in the section env.jobs. The generic format is
DN=distro_name DV=distro_version PI=packages_installer SV=salt_version SIM=salt_install_method PV=python_version EP="extra list of packages to install between quotes whitespace-separated"

like

- DN=amazonlinux DV=2 PI=yum SV=2018.3 SIM=stable PV=2 EP="yum-utils python-pip procps-ng"
- DN=centos DV=8 PI=rpm SV=master SIM=git PV=3 EP="epel-release python3 python3-pip python3-devel openssl-devel swig"

empty lines or lines starting with # will be ignored (you can install travis gem locally and run travis list on the file to check syntax)

  1. Run ./build.py and take a coffee while building.
  2. When it finishes, you can run docker images and you'll see the new images created, like
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
salt-py2/centos-7       2019.2              bea6a547bd78        6 minutes ago       475MB
salt-py3/ubuntu-18.04   2019.2              b3660626bf24        11 minutes ago      329MB
salt-py3/debian-9       2019.2              5bd9384b94ee        14 minutes ago      269MB

How to use the images

Just edit your kitchen.local.yml file, and add the image you want to use, like

driver:
  name: docker
  use_sudo: false
  remove_images: true
  run_command: /lib/systemd/systemd
  privileged: true
  volume:
    - "/sys/fs/cgroup:/sys/fs/cgroup:ro"

 provisioner:
   salt_install: none

 platforms:
   - name: debian-9
     driver_config:
       image: salt-2019.2-py3:debian-9
   - name: ubuntu-16.04
     driver_config:
         image: salt-2018.3-py2:ubuntu-16.04

TODO

Lots. This is just an initial attempt. Any suggestion/contribution is welcomed :)

salt-image-builder's People

Contributors

javierbertoli avatar myii avatar sblaisot 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.