<div dir="ltr"><div dir="ltr"><div>Hi Tristan,</div><div><br></div><div>Thanks for this great recap. I updated the related Taiga epic today according to the README TODO list.</div><div>Then we now have 4 more stories to groom in : <a href="https://tree.taiga.io/project/morucci-software-factory/epic/2077">https://tree.taiga.io/project/morucci-software-factory/epic/2077</a></div><div><br></div><div>Cheers,</div><div>Fabien<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2019 at 8:30 AM Tristan Cacqueray <<a href="mailto:tdecacqu@redhat.com">tdecacqu@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hello,<br>
<br>
This sprint we worked on a new set of distro-jobs to investigate a new<br>
rpm build pipeline. The goal is to unify the <a href="http://review.rdoproject.org" rel="noreferrer" target="_blank">review.rdoproject.org</a> rdoinfo,<br>
softwarefactory sfinfo and dci dci-config jobs. All these jobs do the<br>
same thing: build rpm on new change, enable integration tests, and<br>
publish them in the gate pipeline.<br>
<br>
Here is the results of this investigation:<br>
<br>
# Add a new distroinfo configuration endpoint in managesf resources<br>
<br>
The first idea is to remove duplication of information and keeps package<br>
information in the existing resources definition. To do that we plan on<br>
adding a "distroinfo" resource type:<br>
<br>
```<br>
resources:<br>
  distroinfos:<br>
    # the distro name<br>
    tdpw:<br>
      projects:<br>
        # the project to collect package information<br>
        - tdpw<br>
      distroinfo:<br>
        releases:<br>
        - name: master<br>
          branch: rpm-master<br>
<br>
        # custom templates for 'source-repositories' configuration<br>
        package-configs:<br>
          internal-package:<br>
            name: "%(project)s"<br>
            upstream: <a href="https://softwarefactory-project.io/r/tdpw/%(project)s.git" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/tdpw/%(project)s.git</a><br>
            distgit: <a href="https://softwarefactory-project.io/r/tdpw/%(project)s-distgit.git" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/tdpw/%(project)s-distgit.git</a><br>
          internal-package-with-spec-included:<br>
            name: "%(project)s"<br>
            upstream: <a href="https://softwarefactory-project.io/r/tdpw/%(project)s.git" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/tdpw/%(project)s.git</a><br>
            distgit: <a href="https://softwarefactory-project.io/r/tdpw/%(project)s.git" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/tdpw/%(project)s.git</a><br>
          external-package-openstack:<br>
            name: "%(project)s"<br>
            upstream: <a href="https://git.openstack.org/openstack/%(project)s.git" rel="noreferrer" target="_blank">https://git.openstack.org/openstack/%(project)s.git</a><br>
            distgit: <a href="https://softwarefactory-project.io/r/tdpw/%(project)s-distgit.git" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/tdpw/%(project)s-distgit.git</a><br>
```<br>
<br>
Then in the project source-repository list we could have a 'package-config'<br>
option so that the endpoint would be able to generate the distroinfo<br>
file with all the package automatically included, similarly to what we<br>
do for zuul tenant config.<br>
<br>
<br>
# dnrl-preprare job provided by sfconfig<br>
<br>
After deployment, sfconfig configures a dlrn-base abstract job that will<br>
use the dlrn-prepare role with these variables:<br>
```<br>
  dlrn_url: <a href="https://sftests.com/dlrn/" rel="noreferrer" target="_blank">https://sftests.com/dlrn/</a><br>
  dlrn_api_url: <a href="https://sftests.com/dlrn-worker-api/" rel="noreferrer" target="_blank">https://sftests.com/dlrn-worker-api/</a><br>
  dlrn_config_dir: <a href="http://sftests.com/config/dlrn" rel="noreferrer" target="_blank">sftests.com/config/dlrn</a><br>
  dlrn_config_url: <a href="https://sftests.com/manage/v2/configurations/dlrn" rel="noreferrer" target="_blank">https://sftests.com/manage/v2/configurations/dlrn</a><br>
```<br>
<br>
The goal of dlrn-prepare is to setup the distroinfo.yml and dlrn.ini on<br>
the test instances.<br>
<br>
<br>
# dlrn-build and dlrn-publish job pipeline<br>
<br>
The distro-jobs repository contains a couple of abstract jobs. The<br>
dlrn-build definition looks like this:<br>
<br>
```<br>
- job:<br>
    name: dlrn-build<br>
    description: Build project's package.<br>
    parent: dlrn-base<br>
    run: playbooks/dlrn/build.yaml<br>
    post-run: playbooks/dlrn/fetch.yaml<br>
    provides: dlrn-repo<br>
    requires: dlrn-repo<br>
```<br>
<br>
It uses the new provides/requires zuul artifact logic. The idea is that<br>
in the case of depends-on, we want to be able to use the rpm built by<br>
the change ahead without rebuild them in each queue item. The enabling<br>
task is:<br>
<br>
```<br>
- name: Add intermediary repositories from changes ahead<br>
  blockinfile:<br>
    path: "{{ dlrn_data }}/{{ dlrn_project }}.cfg"<br>
    marker: ''<br>
    insertafter: '# SPECULATIVE REPO HERE'<br>
    content: |<br>
      {% for artifact in zuul.artifacts|default([]) %}{% if <a href="http://artifact.name" rel="noreferrer" target="_blank">artifact.name</a> == 'dlrn-repo' %}<br>
      [{{ artifact.project }}-{{ artifact.change }}-{{ artifact.patchset }}]<br>
      name={{ artifact.project }}-{{ artifact.change }}-{{ artifact.patchset }}<br>
      enabled=1<br>
      baseurl={{ artifact.url }}/current<br>
      gpgcheck=0<br>
<br>
      {% endif %}{% endfor %}<br>
```<br>
<br>
# the project interface<br>
<br>
The internal details of distro-jobs and configuration are still being<br>
explored, but the end user interface should looks like this:<br>
<br>
* Defines the distro information in the resources<br>
* Add dlrn-build and dlrn-publish job to project's pipelines.<br>
<br>
Here is an example distribution pipeline configurations:<br>
<br>
```<br>
---<br>
# Distro jobs implementation<br>
- job:<br>
    name: tdpw-dlrn-build<br>
    parent: dlrn-build<br>
    vars:<br>
      dlrn_project: tdpw<br>
<br>
- job:<br>
    name: tdpw-dlrn-publish<br>
    parent: dlrn-publish<br>
    vars:<br>
      dlrn_project: tdpw<br>
      dlrn_user:<br>
        username: tdpw<br>
        password: secret<br>
<br>
# Distro ci jobs<br>
- job:<br>
    name: tdpw-ci-functional<br>
    requires: dlrn-repo<br>
    run: playbooks/functional.yaml<br>
<br>
# Ci pipelines<br>
- project-template:<br>
    name: tdpw-jobs<br>
    check:<br>
      jobs:<br>
        - tdpw-dlrn-build<br>
        - tdpw-ci-functional:<br>
            dependencies:<br>
              - tdpw-dlrn-build<br>
    gate:<br>
      queue: tdpw<br>
      jobs:<br>
        - tdpw-dlrn-build<br>
        - tdpw-ci-functional:<br>
            dependencies:<br>
              - tdpw-dlrn-build<br>
        - wait-for-changes-ahead:<br>
            dependencies:<br>
              - tdpw-ci-functional<br>
        - tdpw-dlrn-publish:<br>
            dependencies:<br>
              - wait-for-changes-ahead<br>
    release:<br>
      jobs:<br>
        - tdpw-dlrn-publish<br>
```<br>
<br>
# Automatic dependencies bump<br>
<br>
Time ran out, but it seems like we should also be able to leverage the<br>
git-drivers or the gerrit-drivers to also run the DLRN service inside a<br>
zuul jobs. For example, when a new tag is created in one the upstream<br>
project, a dlrn-propose job could propose a review to bump the version<br>
number automatically.<br>
<br>
<br>
# Example implementations<br>
<br>
We prototyped those changes with the tdpw project<br>
([t]est [d]istribution [p]ackaging [w]orkflow):<br>
<br>
The dlrn-prepare job: <a href="https://softwarefactory-project.io/r/15206" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/15206</a><br>
The distro-jobs: <a href="https://softwarefactory-project.io/r/15207" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/15207</a><br>
The tdpw ci pipelines: <a href="https://softwarefactory-project.io/r/15208" rel="noreferrer" target="_blank">https://softwarefactory-project.io/r/15208</a><br>
<br>
<br>
Todos are tracked in the README of distro-jobs.<br>
<br>
Regards,<br>
-Tristan<br>
-----BEGIN PGP SIGNATURE-----<br>
<br>
iQEzBAEBCAAdFiEE6xA96LXmnmMcb/F5IrmgXJJcxdgFAlyIsZIACgkQIrmgXJJc<br>
xdg9Zwf/TIzaizv8Of1iEpzul+plR5e6+bzvn+73Bg2B0zL4GewqH4Xix5yCm322<br>
8Hnym6GITT2XqoFaEeg5Vvq69AXGJ29YN0p+LaSbKD0txuIA1jUNJ17zEbISV1eC<br>
TSLF7HxcMCH1OvLg46Njudfd71/RjEKkrNQyTUqsEnTUJpIFXhkhHLgZwiApgtvX<br>
OL0uzldgMxL5DfM8mSgE1SsvtKybyJjLba445rXyYIj+KE4Y8aAJSy8kbeV2sPfV<br>
ki9H0attqiMv2WD2I88ODg/J0MNTA7vnLfoQwnxA43fHUw8bctE0qxNSlkJy0/Hh<br>
iLVaK0qHbbSpl3tIFFN8tpKqnd2l/g==<br>
=pDmG<br>
-----END PGP SIGNATURE-----_______________________________________________<br>
Softwarefactory-dev mailing list<br>
<a href="mailto:Softwarefactory-dev@redhat.com" target="_blank">Softwarefactory-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/softwarefactory-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/softwarefactory-dev</a><br>
</blockquote></div>