Skip to main content
Jump to: navigation, search

Difference between revisions of "Jenkins/Connecting JIPP to an external slave"

(Windows via jnlp)
m ( moved page Jenkins/Connecting HIPP to an external slave to Jenkins/Connecting JIPP to an external slave: hipp to jipp)
(No difference)

Revision as of 10:33, 29 October 2018

The Jenkins (JIPP) instances hosted by the Eclipse Foundation are located on a private, non-routable network that can only establish HTTP/S connections to the Internet. To connect your JIPP to an external slave, you'll need to perform some SSH wizardry:

*NIX and SSH slaves

  • On your JIPP, create a job that will only run this shell script once. Edit as required.
   ssh-keygen -t rsa -b 4096 -C "CBI genie" -f ~/.ssh/id_rsa.cbi -N ""
   chmod 600 ~/.ssh/
   echo "Adding pub key to authorized_keys file to log into"
   cat ~/.ssh/ >> ~/.ssh/authorized_keys
   echo "Copy this key to your remote server's ~/.ssh/authorized_keys file"
   cat ~/.ssh/
   echo "Creating config"
   echo "" >> ~/.ssh/config
   echo "Host" >> ~/.ssh/config
   echo "StrictHostKeyChecking no" >> ~/.ssh/config
   echo "Host external-slave" >> ~/.ssh/config
   echo "StrictHostKeyChecking no" >> ~/.ssh/config
   echo "IdentityFile ~/.ssh/id_rsa.cbi"  >> ~/.ssh/config
   echo "PubkeyAuthentication yes"  >> ~/.ssh/config
   echo "ServerAliveInterval 60"  >> ~/.ssh/config
   echo "ProxyCommand ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.cbi netcat %h 22"  >> ~/.ssh/config
   chmod 600 ~/.ssh/config
   echo "Finished setting up SSH config"
   cat ~/.ssh/config
  • Copy the public key that appears in the console to the authorized_keys file of the remote server, as instructed.
  • In Jenkins' management, create a new slave node. Choose the option to "Launch slave via execution of command on Master".
  • Use this command, replacing (projectname) with the name of your project and username with the external username. Sadly, I cannot get bash ~ or $HOME here. If you want to make sure the slave jar is always the same version as the slave, make sure you use the slave jar available from your JIPP instance.
   ssh -C -i /opt/public/hipp/homes/genie.(projectname)/.ssh/id_rsa.cbi username@external-slave "wget -qO slave.jar ; java -jar slave.jar"

Windows via jnlp

To be determined, see bug 490701. SSH also works if OpenSSH/Cygwin is installed on the Windows host.

Back to the top