3.4.1.3.1. Environment Preparation

3.4.1.3.1.1. Getting Started

Warning

Please use a non-root user for building SIMP!

3.4.1.3.1.1.1. Ensure Sufficient Entropy

The SIMP build generates various keys and does quite a bit of package signing. As such, your system must be able to keep its entropy pool full at all times. If you check /proc/sys/kernel/random/entropy_avail and it shows a number below 1024, then you should either make sure that rngd is running and pointed to a hardware source (preferred) or install and use haveged.

sudo yum install haveged
sudo systemctl start haveged
sudo systemctl enable haveged

3.4.1.3.1.2. Set Up Ruby

We highly recommend using RVM to make it easy to develop and test against several versions of Ruby at once without damaging your underlying Operating System.

3.4.1.3.1.2.1. RVM Installation

The following commands, taken from the RVM Installation Page can be used to install RVM for your user.

gpg2 --keyserver hkp://keys.gnupg.net --recv-keys \
    409B6B1796C275462A1703113804BB82D39DC0E3 \
    7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.5.7
source ~/.rvm/scripts/rvm

3.4.1.3.1.2.2. Set the Default Ruby

You will want to use Ruby 2.5.7 as your default RVM for SIMP development.

rvm use --default 2.5.7

Note

Once this is done, you can simply type rvm use 2.5.7.

3.4.1.3.1.2.3. Bundler

The next important tool is Bundler. Bundler makes it easy to install Gems and their dependencies. It gets this information from the Gemfile found in the root of each repo. The Gemfile contains all of the gems required for working with the repo. More info on Bundler can be found on the Bundler Rationale Page and more information on Rubygems can be found at Rubygems.org.

rvm all do gem install bundler

3.4.1.3.1.3. Set Up Docker

Docker is typically provided by an OS repository. You may need to enable that repository depending on your distribution.

sudo yum install docker

The Docker package may not provide a dockerroot group. If it does not exist post installation, create it:

sudo groupadd dockerroot

Allow your (non-root) user to run docker:

sudo usermod -aG dockerroot <user>

When you build your system make sure you set the default size for the docker container or the ISO build may not work properly.

To do this on a EL system, set the following in /etc/sysconfig/docker-storage and restart the docker service.

Note

You will need to start and stop docker once before adding in this option or the service will fail to start.

DOCKER_STORAGE_OPTIONS="--storage-opt dm.basesize=100G"

Note

You may need to log out and log back in before your user is able to run as dockerroot.

As root, edit /etc/docker/daemon.json and change the ownership of the docker daemon socket:

{
  "live-restore": true,
  "group": "dockerroot"
}

Start the docker daemon:

sudo systemctl start docker
sudo systemctl enable docker

3.4.1.3.1.4. Build Your Build Containers

The simp-core project provides suitable build Dockerfiles for both EL 6 and EL 7 under the build/Dockerfiles/ directory.

These work well for building both CentOS 6 and 7 artifacts. Their usage is noted in the comments at the top of each file.

Unfortunately: making distributable build containers for RHEL has proven to be a challenge, so you’ll need to run RHEL builds directly on a local host. Use the Dockerfiles as a guide to see what packages you’ll need in order to build successfully.

A simple way to get a quick package list is to run grep "yum .* -y" on the appropriate Dockerfile.