Page MenuHomePhabricator

use one job for all CI entry points
Closed, DeclinedPublic

Description

Use one job that runs on a nodepool based vm that runs all the common Wikimedia CI entry points. It for each entry point it needs to check that the entry point is correctly configured in the repo under test and if it not continue without failure. If the entry point is correctly configured, execute it and fail if that fails. It could be a Makefile maintained in integration/config.git or some other place. It would be nice if the job parallelizes execution of the individual entry points.

The advantage is that enabling a new entry point in zuul doesn't make old branches of the repo fail.
The advantage over a generic entry point (like a Makefile in the repo under test) is that there is that it doesn't need to be duplicated everywhere. It makes it possible to see which repo successfully uses which type of entry point.

For nodepool slaves it has the advantage that it only uses one VM instead of multiple jobs with each one VM.
It might use less disk (io and space) because it might use fewer workspaces.

An example would be a single central makefile detecting what should be run: https://gerrit.wikimedia.org/r/#/c/242177/

Event Timeline

JanZerebecki raised the priority of this task from to Needs Triage.
JanZerebecki updated the task description. (Show Details)
JanZerebecki subscribed.
JanZerebecki renamed this task from use declarative configuration to enable CI entry points in the repo under test to use one job for all CI entry points.Sep 29 2015, 3:27 PM
JanZerebecki updated the task description. (Show Details)
JanZerebecki set Security to None.
JanZerebecki added subscribers: hashar, zeljkofilipin.

From the CI weekly meeting on Sept 29th 2015.

Seems we could have a central Makefile in integration/config.git. Then have the repositories trigger a single job make-test that would invoke our central Makefile.

The Makefile will automatically detect what kind of commands it can run and do it. For example run npm test when there is a package.json file in the repo.

Change 242177 had a related patch set uploaded (by JanZerebecki):
Generic test runner entry point

https://gerrit.wikimedia.org/r/242177

For parallelizing inside composer test we could run one composer $x in parallel for each entry in composer.json that starts with test-sub- or something. Or upstream a patch to composer upstream that achieves something similar.

Does jjb/jenkins support parallelizing over what are builders in jjb? It would be much less work to make most current jobs into builders then create this job from them.

Using http://docs.openstack.org/infra/jenkins-job-builder/builders.html#builders.multijob or http://docs.openstack.org/infra/jenkins-job-builder/builders.html#builders.trigger-builds might work for running the existing jobs on a nodepool slave basically as a sub-job of the initiating job. Which might be even less work. I found nothing in the jjb docs to parallelize builders which makes sense in in terms of how Jenkins is supposed to parallelize jobs and not steps within jobs.

If we were to solve this via some sort of sub-jobs, do we want to have them share a workspace then?

A problem with my suggestion to use jenkins to trigger other jobs as part a bigger job is that those sub-jobs also need slave slots, but a nodepool slave may only have one slot otherwise unrelated jobs could use the same vm, but it is inteded to be use once. Not sure if there is a solution to that.

Nodepool has the ability to spawn several nodes associated to a job. That is done on the labels:

labels:
  - name: multi-precise
    image: precise
    subnodes: 2
    min-ready: 2
    ready-script: setup_multinode.sh
    providers:
      - name: provider1

http://docs.openstack.org/infra/nodepool/configuration.html?highlight=subnodes#labels

subnodes

Used to configure multi-node support. If a subnodes key is supplied to an image, it indicates that the specified number of additional nodes of the same image type should be created and associated with each node for that image.

Only one node from each such group will be added to the target, the subnodes are expected to communicate directly with each other. In the example above, for each Precise node added to the target system, two additional nodes will be created and associated with it.

The settings are populated in the instance under /etc/nodepool/

http://docs.openstack.org/infra/nodepool/scripts.html#ready-script

I haven't really looked at how it works though :-/

Change 242177 abandoned by Hashar:
Generic test runner entry point

Reason:
This was just a draft / POC following a discussion we had with Jan.

https://gerrit.wikimedia.org/r/242177

hashar triaged this task as Low priority.Jan 5 2016, 2:16 PM
hashar updated the task description. (Show Details)
hashar removed a project: Patch-For-Review.

Declining this one after all. That followed a discussion to use a single makefile to run everything, however we will keep having several jobs to isolate/run them in parallel.