build_openstack_packages

An Ansible role for generating custom RPMSs of OpenStack Projects using DLRN

Parameters

  • cifmw_bop_dlrn_deps: (List) A list of DLRN project system dependencies.

  • cifmw_bop_build_repo_dir: (String) The directory where the DLRN repo is built. Defaults to {{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework-data') }}/logs.

  • cifmw_bop_dlrn_repo_url: (String) The URL of the DLRN repository.

  • cifmw_bop_dlrn_from_source: (String) Install DLRN from git. Defaults to False.

  • cifmw_bop_dlrn_venv: (String) DLRN Virtualenv directory Default to {{ ansible_user_dir }}/dlrn_venv`.

  • cifmw_bop_patch_rebaser_repo_url: (String) The URL of patch rebaser repository.

  • cifmw_bop_rdoinfo_repo_url: (String) The URL of the rdoinfo repository that contains the project definitions for DLRN.

  • cifmw_bop_rdoinfo_repo_name: (String) Name of the rdoinfo repository.

  • cifmw_bop_initial_dlrn_config: (String) Name of the initial DLRN config. Defaults to centos9-stream.

  • cifmw_bop_dlrn_target: (String) Name of the DLRN target. Defaults to centos9-stream.

  • cifmw_bop_use_components: (Integer) Build the openstack rpm packages under component. Defaults to 1. Set 0 to avoid using it.

  • cifmw_bop_yum_repos_dir: (String) The path to repos generated by repo-setup tool.

  • cifmw_bop_openstack_release: (String) The default release of OpenStack project. Defaults to master.

  • cifmw_bop_osp_release: (String) The downstream openstack release name.

  • cifmw_bop_openstack_project_path: (String) The full path of openstack cloned project to be built.

  • cifmw_bop_gating_repo_dest: (String) The path of directory to store gating repo file and repo metadata. Defaults to cifmw_bop_build_repo_dir var.

  • cifmw_bop_dlrn_cleanup: (Boolean) Clean up the DLRN artifacts. Defaults to False.

  • cifmw_bop_branchless_projects: List of project does not have stable branches.

  • cifmw_bop_skipped_projects: List of projects on which DLRN build needs to be skipped.

  • cifmw_bop_change_list: Zuul Change list constructed while using Depends-On in CI to build rpm packages using DLRN.

  • cifmw_bop_release_mapping: A list of openstack release names and their respective branch names.

Examples

Construct cifmw_bop_change_list list

cifmw_bop_change_list var contains a list of dict containing branch, change number, host, project name and change refspec. It is used by build_openstack_packages to download the spec change of a project and build rpm out of that.

cifmw_bop_change_list is constructed from a OpenDev Depends-On based on following conditions:

  • Depends-On project is not in cifmw_bop_skipped_projects list.

  • Depends-On project is not a RDO project.

  • Zuul override-checkout branch should be similar to project branch. (It is useful in case of downstream).

  • Depends-On project branch is in cifmw_bop_release_mapping.

We want to build DLRN rpm packages from following reviews:

cifmw_bop_change_list:
  - "branch": "stable/2023.1"
    "change": "913763"
    "host": "https://review.opendev.org"
    "project": "openstack/neutron"
    "refspec": "refs/changes/63/913763/3"
cifmw_bop_change_list:
  - "branch": "stable/2023.1"
    "change": "913763"
    "host": "https://review.opendev.org"
    "project": "openstack/neutron"
    "refspec": "refs/changes/63/913763/3"

  - "branch": "main",
    "change": "162",
    "host": "https://github.com"
    "project": "openstack-k8s-operators/tcib"
    "refspec": "refs/changes/62/162/60ad76dbeacb491c0bddca419c61d398e83fe1af"

Run the role

- hosts: localhost
  vars:
    cifmw_bop_yum_repos_dir: /tmp/repos
  pre_tasks:
    - name: Clone neutron-tempest-plugin
      ansible.builtin.git:
        accept_hostkey: true
        dest: "/tmp/neutron-tempest-plugin"
        repo: "https://github.com/openstack/neutron-tempest-plugin"

    - name: Set cifmw_bop_openstack_project_path
      ansible.builtin.set_fact:
        cifmw_bop_openstack_project_path: "/tmp/neutron-tempest-plugin"

  roles:
    - role: "build_openstack_packages"