Skip to content

Developers Guide

Ignatious Johnson edited this page Jan 24, 2017 · 6 revisions

Introduction

Developers guide to make changes in the packaging repo for debain/redhat contrail packages

Keywords:

SKU  -- Openstack release name (mitaka, newton etc..)
SERIES -- OS release (trusty, xenial etc..)

DEBIAN: Make targets design

Makefile has common target %-deb , which can handle make of all the packages for all SKU’s/SERIES, This is achieved by

1. control/control.in and rules are always for latest SKU/SERIES

Making rules and control or control.in work for the Latest/greatest SKU/SERIES

2. Creating SKU or SERIES.SKU specific control/rules file

Create control. and/or control.. for each package under debian (only if it is different)

3. Created rules. and/or rules.. for each package under debian(only if it is different)

4. Dynamic identification of control and rules file

Finding the control/rules file dynamically during make, following is the precedence order to determine the control and rules files to use.

control    <—————Lowest precedence
contro.in
control.<SERIES>.in
control.<SERIES>.<SKU>.in   <—————Highest precedence

Similarly rule file precedent order follows,

rules        <—————Lowest precedence
rules.<SERIES>
rules.<SERIES>.<SKU>    <—————Highest precedence

DEBIAN: Developers coding guidelines

When introducing new SKU/SERIES,

If there is a change in dependency for the new SKU/SERIES, Rollback the control.in as below

Copy existing  control.in to control.<PREVIOUS_SERIES>.in
Copy existing control.in to control.<PREVIOUS_SERIES>.<PREVIOUS_SKU>.in and add dependency  specific to that SKU   (Only  if a particular SKU  has  different  set of dependencies other than  control.<PREVIOUS_SERIES>.in created in previous step)
Modify  the existing control.in to work for the new SKU/SERIES

If there is a change in files to be installed/packaged for the new SKU/SERIES, Rollback the rules as below

Copy existing  rules to rules.<PREVIOUS_SERIES>.in
Copy existing rules.in to rules.<PREVIOUS_SERIES>.<PREVIOUS_SKU>.in and add install files specific to that SKU   (Only  if a particular SKU  has  different  set of files to be installed/packaged other than  rules.<PREVIOUS_SERIES>.in created in previous step)
Modify the existing rules to work for the new SKU/SERIES

If there is no change in dependencies and files to be installed/packaged for the new SKU/SERIES

Existing rules/control will work for the new SKU/SERIES

Advantages of this design

we can avoid code duplication in Makefile for every SKU with just the target name suffix change
No need to worry about control.in/rules change if there is no difference between previous and new SKU/SERIES

REDHAT: Make targets design

TODO