Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Servers connecting to Akraino Jenkins using this method must have access to the internet.

Please follow below steps to connect a slave to Akraino Jenkins.

  1. Create a user named Jenkins on the machine you want to connect to Akraino Jenkins and give the user sudo rights.
  2. Install needed software on the machine you want to connect to Akraino Jenkins as slave.
    1. openjdk 8
    2. monit
  3. If the slave will be used for running virtual deployments, Functest, and Yardstick, install below software and make Jenkins user the member of the groups.
    1. docker
    2. libvirt
  4. Create slave root in Jenkins user home directory.

    Code Block
    languagebash
    mkdir

...

  1.  -p

...

  1.  /home/jenkins/akraino/slave_root


  2. Clone Akraino

...

  1. ci-management repository.

...

  1. Code Block
    languagebash
    mkdir -p

...

  1.  /home/jenkins/

...

  1. akraino/repos

...

  1. 
    cd

...

  1.  /home/jenkins/

...

  1. akraino/repos

...

  1. 
    git

...

  1.  clone

...

  1.  https://gerrit.akraino.org/

...

  1. r/ci-management


  2. Contact LF by sending mail

...

  1. to Akraino Helpdesk and request creation of a slave on Akraino Jenkins. Include below information in your mail.

    1. Slave root (/home/jenkins/

...

    1. akraino/slave_root)

...

    1. Number of executors (the number of concurrent jobs to allow on the slave

...

  1. Once you get confirmation from LF stating that your slave is created on Akraino Jenkins, check if the firewall on LF is open for the server you are trying to connect to Jenkins.

...

    1. ).
    2. Label(s). The label(s) define what jobs can be run on a particular slave. Each job should have a slave-label defined in its JJB definition.
    3. A slave name. This has generally followed the convention of "<OS>-dev-<CPUs>c-<RAM>g", though this is not a strict rule. The important thing is that the name is a unique and useful identifier. Other elements, such as "prd" or "snd" to identify the environment or numbering at the end, will be added by LF.
  1. You will receive a confirmation from LF containing the complete slave name and a secret token.
  2. Run the following script in order to make sure there is no problem connecting. You should see INFO: Connected in the console log.

    Code Block
    languagebash
    cp /home/jenkins/akraino/repos/ci-management/utils/jenkins-jnlp-connect.sh /home/jenkins/

...

  1. 
    cd

...

  1.  /home/jenkins

...

  1. 
    sudo

...

  1.  ./jenkins-jnlp-connect.sh

...

  1.  -j /home/jenkins

...

  1.  -u

...

  1.  jenkins

...

  1.  -n

...

  1.  <slave

...

  1.  name

...

  1.  on

...

  1.  Akraino

...

  1.  Jenkins>

...

  1.  -s

...

  1.  <the

...

  1.  token you

...

  1.  received

...

  1.  from

...

  1.  LF>

...

  • If you receive an error, follow the steps listed on the command output.
  1. Run the same script with test(-t) on foreground in order to make sure no problem on connection. You should see INFO: Connected in the console log.

...

  1.  -t


    1. If you receive a connectivity error, then you need to check your firewall and allow outgoing connections for the port.

  2. Kill the Java slave.jar process.

  3. Run the same script normally without test (-t) in order to get monit script created.

    Code Block
    languagebash
    sudo

...

  1.  ./jenkins-jnlp-connect.sh

...

  1.  -j

...

  1.  /home/jenkins

...

  1.  -u

...

  1.  jenkins

...

  1.  -n

...

  1.  <slave name

...

  1.  on

...

  1.  Akraino

...

  1.  Jenkins>

...

  1.  -s

...

  1.  <the

...

  1.  token

...

  1.  you

...

  1.  received

...

  1.  from

...

  1.  LF>


  2. Edit monit configuration and enable http interface. The file to edit is /etc/monit/monitrc on Ubuntu systems. Uncomment below lines.

    Code Block
    # set httpd port

...

  1.  2812 and
    #     use address localhost  # only accept connection from localhost
    #     allow localhost        # allow localhost to connect to the server and


  2. Restart monit service.

    1. Without systemd:

...

    1. sudo service monit restart

    2. With systemd: you have to enable monit service first and then restart it.

sudo systemctl enable monit

    1. sudo systemctl enable monit
      sudo systemctl restart monit

  1. Check to see if

...

  1. Jenkins comes up as managed service in monit.

...

  1. sudo monit status

  2. Connect slave to Akraino Jenkins using monit.

...

  1. sudo monit start jenkins

  2. Check slave on Akraino Jenkins to verify the slave is reported as connected.

...

  1.  The slave on Akraino Jenkins should have some executors in “Idle” state if the connection is successful

...

Notes

PGP Key Instructions

Public PGP Key can be uploaded to public key server so it can be taken from there using your mail address. Example command to upload the key to key server is

...

  1. .

...

The Public PGP Key can also be attached to the email by storing the key in a file and then attaching it to the email.

...