Skip to content

Repo for collecting the packaging meta-data for StarlingX upstream packages

License

Notifications You must be signed in to change notification settings

starlingx-staging/stx-packaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starling X multi-os packaging

This project builds the necessary packages and the Linux ISO to host the Containerizing StarlingX Infrastructure As a POC this project works now for debian base OS to generate a debian base image with parts of the Starling X software stack

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

The development tools and git repositories that you need are installed by running setup.sh

bash setup.sh

If you are under a proxy in order to make pbuilder make use of your apt-cache, you just need to set this

export http_proxy=http://your-proxy:8080/ in ~/.pbuilderrc

Building

Here are some step by step series of examples that tell you how to get a development env running according to different scenarios:

Building a package provided by Starling X ( Flock service )

Set up git repository that host the source and build scripts

After executing setup.sh the repositories that we specify on the repo file are downloaded, ie:

$ cat repos
https://github.com/VictorRodriguez/x.stx-fault.git,poc_debian_build
https://github.com/marcelarosalesj/x.stx-config.git,debian

This is a csv file with these fields:

* git repo
* branch

This gives the freedom to developers to host their own forks of Starling X git repositories repos to work. This gives flexibility for developers in the meantime that the Gerrit review is approved. Originally the repos file should point to the official starling x Gerrit repositories.

$ cat repos
https://git.starlingx.io/stx-fault,master
https://git.starlingx.io/stx-config,master

Build the DEB file

Once we have clone the proper repository where the flock service is hosted, we can build as:

make package PKG=fault/fm-common DISTRO=debian
* PKG=path to the directory where our fm-common project lives
* DISTRO= debian | centos | suse ( for now only works for debian )

Another example could be fm-mgr:

make package PKG=x.stx-fault/fm-mgr DISTRO=debian

One difference here is that fm-mgr depends on build time of fm-common that we previously build, How to add a local build dependency to our build system in chroot, in this case is as simple as edit the file:

$ cat x.stx-fault/fm-mgr/debian/build_deps
fm-common

The Makefile located in : x.stx-fault/fm-mgr/debian/Makefile will build first fm-common in case we forgot to build it

After that it will copy the .deb generated into /usr/local/mydebs/ that is our local mirror/mount point for pbuilder tool to search local build dependencies

If you are not in a Linux machine but it has docker and Makefile tools, you still can build an STX DEB:

make package PKG=x.stx-fault/fm-mgr DISTRO=debian BUILD_W_CONT=y

The flag BUILD_W_CONT=y will create a docker image with all the enviroment necesary to build the package and leave the results in:

stx-packaging $ ls configs/docker-debian-img/results/
Packages.gz			fm-common-dev_0.0-1_amd64.deb

As you can see you can also set there an specific Packages.gz that you prefer with fixed packages versions for your build

Building a package tunned by Starling X ( Horizon for example )

Following the same approach from the section "Set up git repository that host the source and build scripts" from above our repo file should look like:

$ cat repos
https://github.com/VictorRodriguez/x.stx-upstream.git,master

Once we have clone the repo we can see that inside there is a Makefile with the proper patches and build instructions

~/stx-packaging/x.stx-upstream/openstack/python-horizon/debian
Makefile

We could even move to this directory and type make or from our root repo directory build as usual:

make package PKG=x.stx-upstream/openstack/python-horizon/ DISTRO=debian

Building an upstream package (bc and kernel)

make upstream_pkg PKG=bc

This generates a directory:

upstream_pkgs/bc/

With a generic Makefile to reuse if you want to add personal patches to the upstream package before adding it to:

  • stx-integ
  • stx-upstream

Clean (but not erase your patches) with:

make clean_upstream_pkg PKG=bc

distclean completely with:

make distclean_upstream_pkg PKG=bc

Another example more useful than bc calculator is:

make upstream_pkg PKG=linux-source-4.15.0
make upstream_pkg PKG=keystone

Porting of functional Starling X patches located at:

In order to insert the patches to the kernel just copy them into this directory:

stx-packaging/upstream_pkgs/linux-source-4.15.0/linux-4.15.0/debian/patches

And put a series file that indicates the order of applying

Sanity Test cases

This repo has its own sanity test to check that everything works:

make testbuild

Container for development

Inside configs/docker-debian-img there is a Dockerfile with a Makefile.

To create a Docker image to develop:

	make

	make run

	root@e82355206aab:/# cd stx-packaging/ && ./setup.sh

This will create the chroot with all the build set up for pbuilder

A sanity test is included as well:

	make test

This will run the container and execute ./setup.sh && build fm-common

Known issues

  • unknown python version. check setup.py

This is a common error when the setup.py of your source code does not include any shebang line. The root cause of this bug release on the debmake file analyze.py

A valid workaround is to set a proper shebang into the setup.py of your source file in the meantime that we work on a proper patch with debmake maintainer

Architecture

Architecture slides and diagrams at this google presentation

Built With

  • pbuilder - allows users to setup a chroot environment for building debian packages *
  • debmake - program to make a Debian source package

Versioning

We use SemVer for versioning.

Authors

License

This project is licensed under the Apache License - see the LICENSE.md file for details

Acknowledgments

STX community for great feedback during the conception of this POC

About

Repo for collecting the packaging meta-data for StarlingX upstream packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published