StarlingX build tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zuul 5bab3cd63e Merge "Upgrade packages for libvirt 4.7.0 support" 7 months ago
centos-mirror-tools Merge "Upgrade packages for libvirt 4.7.0 support" 7 months ago
deployment deployment: libvirt: add disk to all-in-one cluster 7 months ago
doc [Doc] Release Notes Management 8 months ago
release Support feature branches in branch-stx.sh 7 months ago
releasenotes Add docs, releasenotes jobs 7 months ago
toCOPY Update populate_downloads to use latest libibverbs 8 months ago
.gitignore Add docs, releasenotes jobs 7 months ago
.gitreview correct gitreview setting for master 7 months ago
.zuul.yaml Add docs, releasenotes jobs 7 months ago
DependenciesReviewer.py Add script to verify that repo's SRPMs matches with mirror's SRPMs 9 months ago
Dockerfile.centos73 Add build tools 10 months ago
Dockerfile.centos73.TC-builder fixing namefile running make build 9 months ago
Makefile fix making building image issues 9 months ago
README.rst Port documentation from markdown into rst 9 months ago
buildrc Add build tools 10 months ago
tb.sh Merge "Enabling detach mode in tb.sh for run command" 9 months ago
test-requirements.txt Add bashate job nonvotingwq 10 months ago
tox.ini Add docs, releasenotes jobs 7 months ago

README.rst

stx-tools

StarlingX Build Tools

The StarlingX build process is tightly tied to CentOS in a number of ways, doing the build inside a Docker container makes this much easier on other flavors of Linux.

Container Build Preparation

We will use a copy of your existing .gitconfig in the container to pick up existing configuration. The StarlingX build system also has some specific requirements that do not need to be in your personal .gitconfig. Copy it into toCOPY to be picked up in the container build.

Configuration

tbuilder uses a two-step configuration process that provides access to certain configuration values both inside and outside the container. This is extremely useful for path variables such as MY_REPO with have different values inside and outside but can be set to point to the same place.

The buildrc file is a shell script that is used to set the default configuration values. It is contained in the tbuilder repo and should not need to be modified by users as it reads a localrc file that will not be overwritten by tbuilder updates. This is where users should alter the default settings.

Sample localrc

Makefile

tbuilder contains a Makefile that can be used to automate the build lifecycle of a container. The commands below are handled by the Makefile and will read the contents of the buildrc file.

The targets commonly used are: * build - build the Docker images as required (This includes dev-centos, to build just the base dev image use target base-build.) * clean - remove the stx-builder image (The dev-centos image is not removed, use base-clean to do that)

Base Container Build

The container build has been split into two parts to simplify iterating on build development. The basic CentOS image and the nearly 500 required development packages are pre-installed into a base image (local/dev-centos:7.3) that is then used for the StarlingX builder-specific bits.

will run essentially the following manual build command:

STX Builder Container Build

StarlingX Builder container images are tied to your UID so image names should include your username.

NOTE:

  • Do NOT change the UID to be different from the one you have on your host or things will go poorly. i.e. do not change --build-arg MYUID=$(id -u)
  • The Dockerfile needs MYUID and MYUNAME defined, the rest of the configuration is copied in via buildrc/localrc.

Use the Builder Container

The tb.sh script is used to manage the run/stop lifecycle of working containers. Copy it to somewhere on your PATH, say $HOME/bin if you have one, or maybe /usr/local/bin.

The basic workflow is to create a working directory for a particular build, say a specific branch or whatever. Copy the buildrc file from the tbuilder repo to your work directory and create a localrc if you need one. The current working directory is assumed to be this work directory for all tb.sh commands. You switch projects by switching directories.

By default LOCALDISK will be placed under the directory pointed to by HOST_PREFIX, which defaults to $HOME/starlingx.

The tb.sh script uses sub-commands to select the operation: * run - Runs the container in a shell. It will also create LOCALDISK if it does not exist. * stop - Kills the running shell. * exec - Starts a shell inside the container.

You should name your running container with your username. tbuilder does this automatically using the USER environment variable.

tb.sh run will create LOCALDISK if it does not already exist before starting the container.

Set the mirror directory to the shared mirror pointed to by HOST_MIRROR_DIR. The mirror is LARGE, if you are on a shared machine use the shared mirror. For example you could set the default value for HOST_MIRROR_DIR to /home/starlingx/mirror and share it.

Running the Container

Start the builder container:

or by hand:

Running a Shell Inside the Container

Since running the container does not return to a shell prompt the exec into the container must be done from a different shell:

or by hand:

Notes:

  • The above will reusult in a running container in systemd mode. It will have NO login.
  • I tend to use tmux to keep a group of shells related to the build container
  • --user=${USER} is the default username, set MYUNAME in buildrc to change it.

Stop the Container

or by hand:

What to do to build from WITHIN the container

To make git cloning less painful

To start a fresh source tree

Instructions

Initialize the source tree.

To generate cgcs-centos-repo

The cgcs-centos-repo is a set of symbolic links to the packages in the mirror and the mock configuration file. It is needed to create these links if this is the first build or the mirror has been updated.

Where the argument to the script is the path of the mirror.

To build all packages:

To generate cgcs-tis-repo:

The cgcs-tis-repo has the dependency information that sequences the build order; To generate or update the information the following command needs to be executed after building modified or new packages.

To make an iso:

First time build

The entire project builds as a bootable image which means that the resulting ISO needs the boot files (initrd, vmlinuz, etc) that are also built by this build system. The symptom of this issue is that even if the build is successful, the ISO will be unable to boot.

For more specific instructions on how to solve this issue, please the README on installer folder in stx-beas repository.

WARNING HACK WARNING

Troubleshooting