Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-51007

bitbake slows down 20% when started through jenkins

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • Ubuntu 18.04 on a new Dell server, Jenkins 2.118, no plugins, OpenJDK8

      I am currently evaluating new build server hardware and noticed a discrepancy when running them as Jenkins build slaves:

      We are building a yocto-based Linux distribution. My test builds take about 20% longer when run through Jenkins instead of just started on the shell. For a simple reproduction case, I installed the newest Jenkins deb package and used it to build "core-image-sato" from yocto's current master branch. When running that in the shell, it takes about 21 Minutes to finish, when started through Jenkins it uses 25 Minutes.

      Our production builds are running on older hardware and older versions of Jenkins and Ubuntu, but show a similar behaviour.

      A colleague created a Java wrapper for me which shows the same problem, so this appears to be not a Jenkins issue per se, but rather a result of how Java handles subprocesses.

       

      #!/bin/bash
      
      . ./oe-init-build-env
      rm -rf cache sstate-cache tmp
      sync
      time bitbake core-image-sato

       

       

      import java.io.BufferedReader;
      import java.io.InputStreamReader;
      import java.io.File;
      import java.lang.ProcessBuilder.Redirect;
      
      public class ProcessDemo2 {
              public static void main(String[] args) {
                      try {
                              ProcessBuilder pb = new ProcessBuilder();
                              pb.directory(new File("/mnt/data/poky"));
                              pb.command("/bin/bash", "build.sh").redirectErrorStream(true);
                              pb.redirectOutput(Redirect.appendTo(new File("log.txt")));
                              final Process p = pb.start();
                              p.waitFor();
                      } catch (Exception ex) {
                              System.out.println(ex);
                      }
              }
      }

       

            Unassigned Unassigned
            tw Thomas Witt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: