Recent Changes - Search:

edit SideBar

Jenkins

Sisyphus had Hudson.

Terratest has Jenkins

Installation on Terratest

As root:

  sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
  sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
  yum install jenkins
  sudo service jenkins start

Open up port 80, 443 and 8080 on terratest. As root, I ran system-config-firewall, which worked in a terminal and opened up the ports. /sbin/iptables -L should include something like:

[root@terratest src]# /sbin/iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:7379
ACCEPT udp -- anywhere anywhere state NEW udp dpt:7379
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:8079
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:webcache
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@terratest src]#

Set up security

  1. http://terra.eecs.berkeley.edu:8080/configureSecurity
  2. Security Realm -> Jenkins’ own user database
  3. Authorization -> Matrix-based security
  4. User/group to add:
  5. Click on the far right icon to enable all the perms

Email on moog

Moog handles the email. Moog needs to be told to relay the email.

  1. Edit /etc/mail/local-host-names and add the host
  2. kill -1 sendmail

Also, send email to addresses hosted on moog like @moog.eecs, not @eecs so that moog handles the email.

Git

The configuration panel says:

  Failed to connect to repository : Command "git -c core.askpass=true ls-remote -h https://github.com/cxbrooks/fmusdk2.git HEAD" returned status code 129:
  stdout:
  stderr: Unknown option: -c
  usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
           [-p|--paginate|--no-pager] [--no-replace-objects]
           [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
           [--help] COMMAND [ARGS]

The log says:

  Started by user Christopher Brooks
  Building in workspace /var/lib/jenkins/workspace/fmusdk2
   > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
  Fetching changes from the remote Git repository
   > /usr/local/git/bin/git config remote.origin.url https://github.com/cxbrooks/fmusdk2.git # timeout=10
  Fetching upstream changes from https://github.com/cxbrooks/fmusdk2.git
   > /usr/local/git/bin/git --version # timeout=10
   > /usr/local/git/bin/git -c core.askpass=true fetch --tags --progress https://github.com/cxbrooks/fmusdk2.git +refs/heads/*:refs/remotes/origin/*
  ERROR: Error fetching remote repo 'origin'
  ERROR: Error fetching remote repo 'origin'
  Sending e-mails to: cxh@eecs.berkeley.edu
  Finished: FAILURE

/usr/local/git/bin/git is

  bash-4.1$ /usr/local/git/bin/git --version
  git version 2.2.1

Hmm, git itself is having problems:

  bash-4.1$ git clone https://github.com/cxbrooks/fmusdk2.git 
  Cloning into 'fmusdk2'...
  fatal: Unable to find remote helper for 'https'

Solution: git clone: fatal: Unable to find remote helper for 'https': Install curl devel: yum install curl-devel, reconfigure git and reinstall.

Curl Under Jenkins

Under Jenkins, running git clone by hand was yielding:

  bash-4.1$ git clone https://repo.eecs.berkeley.edu/git/xxx/yyy.git
  Cloning into 'gdp'...
  fatal: unable to access 'https://repo.eecs.berkeley.edu/git/xxx/yyy.git/': Protocol https not supported or disabled in libcurl

The problem here is that jenkins needs to have matlab in the path first for the ptII build, so the fix of:

  export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}

will not work.

My workaround was to configure Jenkins: "Prepare an environment for the run" -> "Properties Content":

  LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH

Get PMD to Ignore Directories

We are running PMD's CPD to look for duplicate C code. I want it to ignore the node_modules directories.

To do this, I edited pmd-src-5.2.3/pmd-core/src/main/java/net/sourceforge/pmd/cpd/CPDConfiguration.java, see the FIXMEs in two places:

 public FilenameFilter filenameFilter() {
        if (language == null) {
            throw new IllegalStateException("Language is null.");
        }

        final FilenameFilter languageFilter = language.getFileFilter();
        final Set<String> exclusions = new HashSet<String>();

        if (excludes != null) {
            FileFinder finder = new FileFinder();
            for (String excludedFile : excludes) {
               // FIXME: Add just the name of the excluded file.
                exclusions.add(excludedFile);
                File exFile = new File(excludedFile);
                if (exFile.isDirectory()) {
                    List<File> files = finder.findFilesFrom(excludedFile, languageFilter, true);
                    for (File f : files) {
                        exclusions.add(f.getAbsolutePath());
                    }
                } else {
                    exclusions.add(exFile.getAbsolutePath());
                }
            }
        }
        FilenameFilter filter = new FilenameFilter() {
            public boolean accept(File dir, String name) {
                File f = new File(dir, name);
                // FIXME: Check to see if the exclusion matches just the name
                if (exclusions.contains(f.getAbsolutePath())
                                || exclusions.contains(name)) {
                    System.err.println("Excluding " + f.getAbsolutePath());
                    return false;
                }
                return languageFilter.accept(dir, name);
            }
        };
        return filter;
    }

 

Here's the script we use in Jenkins to do code coverage:

#!/bin/sh -x
cd $WORKSPACE
# cd src
# wget -O /var/lib/jenkins/src/pmd-bin-5.2.3.zip "http://downloads.sourceforge.net/project/pmd/pmd/5.2.3/pmd-bin-5.2.3.zip?r=http%3A%2F%2Fpmd.sourceforge.net%2F&ts=1419873083&use_mirror=superb-dca2"
# unzip pmd-bin-5.2.3.zip

cd /var/lib/jenkins/src/pmd-src-5.2.3

if [ ! -d $WORKSPACE/reports/cpd ]; then
mkdir -p $WORKSPACE/reports/cpd
fi

echo "Look for duplicate code"
java -Xmx5000m -classpath '/home/jenkins/src/pmd-src-5.2.3/pmd-core/target/classes:/home/jenkins/src/pmd-src-5.2.3/lib/*' \
net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files $WORKSPACE --format net.sourceforge.pmd.cpd.XMLRenderer \
--language c --exclude node_modules > $WORKSPACE/reports/cpd/gdpCPD.xml


echo "Convert to html"
xsltproc pmd-core/etc/xslt/cpdhtml.xslt $WORKSPACE/reports/cpd/gdpCPD.xml > $WORKSPACE/reports/cpd/index.html

echo "Done with cpd"

Jenkins hanging while parsing the output from the JavaDoc Tool

I upgraded to jdk1.8.0_45, the builds ran successfully once and then started to hang.

bash-4.1$ which java
/usr/lib/jvm/jdk1.8.0_45/bin/java
bash-4.1$ ls -lc /usr/lib/jvm/jdk1.8.0_45/bin/java
-rwxr-xr-x 1 uucp 143 7734 Apr 20 17:06 /usr/lib/jvm/jdk1.8.0_45/bin/java

The build from Apr 21 11:53 worked as did the one from Apr 22 04:49.

However, two builds on Apr 23 did not work

Xvfb stopping
[FINDBUGS] Collecting findbugs analysis files...
[FINDBUGS] Finding all files that match the pattern reports/ptII-findbugs.xml
[FINDBUGS] Parsing 1 file in /home/jenkins/workspace/ptII
[FINDBUGS] Successfully parsed file /home/jenkins/workspace/ptII/reports/ptII-findbugs.xml wi\
th 1397 unique warnings and 2 duplicates.
[FINDBUGS] Computing warning deltas based on reference build #155
[WARNINGS] Parsing warnings in console log with parser Maven
[WARNINGS] Parsing warnings in console log with parser Java Compiler (javac)
[WARNINGS] Parsing warnings in console log with parser GNU Make + GNU C Compiler (gcc)
[WARNINGS] Parsing warnings in console log with parser JavaDoc Tool

Using jstack on the java pid yields:

"Executor #1 for master : executing ptII #157" daemon prio=10 tid=0x00007f93b818a800 nid=0x1f\
3c runnable [0x00007f9484435000]
   java.lang.Thread.State: RUNNABLE
        at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
        at java.util.regex.Pattern$Curly.match0(Pattern.java:4170)
        at java.util.regex.Pattern$Curly.match(Pattern.java:4132)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4500)
        at java.util.regex.Pattern$Start.match(Pattern.java:3408)
        at java.util.regex.Matcher.search(Matcher.java:1199)
        at java.util.regex.Matcher.find(Matcher.java:592)
        at hudson.plugins.warnings.parser.RegexpParser.findAnnotations(RegexpParser.java:86)
        at hudson.plugins.warnings.parser.RegexpLineParser.parse(RegexpLineParser.java:94)
        at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:280)
        at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:259)
        at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:3\
82)
        at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:324)
        at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.jav\
a:152)
        at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:\
349)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBui\
ld.java:721)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
        at hudson.model.Run.execute(Run.java:1766)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:374)

The error could have been because one directory did not have java files in it?

[javadoc] javadoc: warning - No source files for package ptolemy.domains.ptinyos.demo.Surge.output

Upgrading was probably the real fix.

5/19/2015- The nightly build hung again. jstack said:

"Executor #0 for master : executing ptII #190" daemon prio=10 tid=0x00007f4c581b9800 nid=0x8f23 runnable [0x00007f4d52fbc000]
java.lang.Thread.State: RUNNABLE
at java.util.regex.Pattern$Curly.match0(Pattern.java:4158)
at java.util.regex.Pattern$Curly.match(Pattern.java:4132)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
at java.util.regex.Pattern$Branch.match(Pattern.java:4500)
at java.util.regex.Pattern$Start.match(Pattern.java:3408)
at java.util.regex.Matcher.search(Matcher.java:1199)
at java.util.regex.Matcher.find(Matcher.java:592)
at hudson.plugins.warnings.parser.RegexpParser.findAnnotations(RegexpParser.java:86)
at hudson.plugins.warnings.parser.RegexpLineParser.parse(RegexpLineParser.java:94)
at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:280)
at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:259)
at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:382)
at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:324)
at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:152)
at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:349)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)

And

      [junit] javadoc: warning - No source files for package ptolemy.domains.wireless.bluetooth
"Executor #1 for master : executing ptII #217" daemon prio=10 tid=0x00007f3a502dd800 nid=0x7e8c runnable [0x00007f39efefc000]
   java.lang.Thread.State: RUNNABLE
        at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715)
        at java.util.regex.Pattern$GroupTail.match(Pattern.java:4615)
        at java.util.regex.Pattern$Curly.match0(Pattern.java:4170)
        at java.util.regex.Pattern$Curly.match(Pattern.java:4132)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4502)
        at java.util.regex.Pattern$GroupHead.match(Pattern.java:4556)
        at java.util.regex.Pattern$Branch.match(Pattern.java:4500)
        at java.util.regex.Pattern$Start.match(Pattern.java:3408)
        at java.util.regex.Matcher.search(Matcher.java:1199)
        at java.util.regex.Matcher.find(Matcher.java:592)
        at hudson.plugins.warnings.parser.RegexpParser.findAnnotations(RegexpParser.java:86)
        at hudson.plugins.warnings.parser.RegexpLineParser.parse(RegexpLineParser.java:94)
        at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:280)
        at hudson.plugins.warnings.parser.ParserRegistry.parse(ParserRegistry.java:259)
        at hudson.plugins.warnings.WarningsPublisher.parseConsoleLog(WarningsPublisher.java:382)
        at hudson.plugins.warnings.WarningsPublisher.perform(WarningsPublisher.java:324)
        at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:152)
        at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:349)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
        at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
        at hudson.model.Build$BuildExecution.post2(Build.java:183)
        at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
        at hudson.model.Run.execute(Run.java:1766)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:98)
        at hudson.model.Executor.run(Executor.java:374)

and

    [junit] Constructing Javadoc information...
    [junit] javadoc: warning - No source files for package org.terraswarm.gdp
    [junit] javadoc: warning - No source files for package org.terraswarm.gdp.apps
    [junit] javadoc: warning - No source files for package ptolemy.actor.lib.modules.jjs
    [junit] Registered Taglet doc.doclets.RatingTaglet ..

I'll try fixing those errors and see what happens.

Edit - History - Print - Recent Changes - Search
Page last modified on June 12, 2015, at 09:37 AM