Commit d7c054b3 authored by Holger Levsen's avatar Holger Levsen
Browse files

s#slave#agent#g as done by upstream

parent 6121cd22
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ cd vncdotool/
python setup.py install
----

=== adding new slaves to jenkins
=== adding new agents to jenkins

Process to follow to add a new node to jenkins:

@@ -104,12 +104,12 @@ Process to follow to add a new node to jenkins:
  * 'Labels': `$arch $short_name` (with '$short_name' like ff64u if the hostname is ff64u-armhf-rb)
  * 'Usage': select "Only build jobs with label expressions matching this node"
  * 'Launch method': select "Launch agent via execution of command on the master"
     * 'Launch command': `/srv/jenkins/bin/start-slave.sh`
     * 'Launch command': `/srv/jenkins/bin/start-agent.sh`
  * 'Availability': select "Take this agent online when in demand, and offline when idle"
    * 'In demand delay': 0 (so that builds will start right away)
    * 'Idle delay': 5 (this is an arbitrary amount of time)

The slave setup is done so that the slave.jar program doesn't get run on the remote nodes,
The agent setup is done so that the agent.jar program doesn't get run on the remote nodes,
to avoid needing Java available in there.
Jobs wanting to run entirely on a remote host will just execute `jenkins_master_wrapper.sh`
which will do the needed ssh and execute `jenkins_node_wrapper.sh` on the remote host,
+3 −3
Original line number Diff line number Diff line
#!/bin/bash

# Copyright © 2015-2017 Holger Levsen (holger@layer-acht.org)
# Copyright © 2015-2018 Holger Levsen (holger@layer-acht.org)
# Copyright © 2017 Hans-Christoph Steiner (hans@guardianproject.info)
# released under the GPLv=2

@@ -17,9 +17,9 @@ common_init "$@"
GIT_REPO=https://gitlab.com/fdroid/fdroidserver

# define and clean work space on the machine actually running the
# build. jenkins.debian.net does not use Jenkins slaves.  Instead
# build. jenkins.debian.net does not use Jenkins agents.  Instead
# /srv/jenkins/bin/jenkins_master_wrapper.sh runs this script on the
# slave using a directly call to ssh, so this script has to do all
# agent using a directly call to ssh, so this script has to do all
# of the workspace setup.
export WORKSPACE=$BASE/reproducible_fdroid_build_apps
if [ -e $WORKSPACE/.git ]; then
+3 −3
Original line number Diff line number Diff line
#!/bin/bash

# Copyright © 2015-2017 Holger Levsen (holger@layer-acht.org)
# Copyright © 2015-2018 Holger Levsen (holger@layer-acht.org)
# Copyright © 2017 Hans-Christoph Steiner (hans@guardianproject.info)
# released under the GPLv=2

@@ -17,9 +17,9 @@ common_init "$@"
GIT_REPO=https://gitlab.com/fdroid/fdroidserver

# define and clean work space on the machine actually running the
# build. jenkins.debian.net does not use Jenkins slaves.  Instead
# build. jenkins.debian.net does not use Jenkins agents.  Instead
# /srv/jenkins/bin/jenkins_master_wrapper.sh runs this script on the
# slave using a directly call to ssh, so this script has to do all
# agent using a directly call to ssh, so this script has to do all
# of the workspace setup.
export WORKSPACE=$BASE/reproducible_fdroid_build_apps
if [ -e $WORKSPACE/.git ]; then
+3 −3
Original line number Diff line number Diff line
#!/bin/bash

# Copyright © 2015-2016 Holger Levsen <holger@layer-acht.org>
# Copyright © 2015-2018 Holger Levsen <holger@layer-acht.org>
# Copyright © 2016-2017 Hans-Christoph Steiner (hans@guardianproject.info)
# released under the GPLv=2

@@ -17,9 +17,9 @@ common_init "$@"
GIT_REPO=https://gitlab.com/fdroid/fdroidserver

# define and clean work space on the machine actually running the
# build. jenkins.debian.net does not use Jenkins slaves.  Instead
# build. jenkins.debian.net does not use Jenkins agents.  Instead
# /srv/jenkins/bin/jenkins_master_wrapper.sh runs this script on the
# slave using a directly call to ssh, so this script has to do all
# agent using a directly call to ssh, so this script has to do all
# of the workspace setup.
export WORKSPACE=$BASE/reproducible_setup_fdroid_build_environment
if [ -e $WORKSPACE/.git ]; then
+6 −6
Original line number Diff line number Diff line
#!/bin/sh

# slave.jar has to be downloaded from http://localhost/jnlpJars/slave.jar
# agent.jar has to be downloaded from http://localhost/jnlpJars/agent.jar

# There doesn't seem to be any better way to figure out the slave name
# There doesn't seem to be any better way to figure out the agent name
# from here, let's just hope all WORKSPACE have been set correctly
NODE_NAME="$(basename ${WORKSPACE})"

echo "Starting slave.jar for ${NODE_NAME}..."
echo "Starting agent.jar for ${NODE_NAME}..."

f="/var/lib/jenkins/offline_nodes"
if [ -f "$f" ]; then
    if grep -q "$NODE_NAME" "$f"; then
        echo "This node is currently marked as offline, not starting slave.jar"
        echo "This node is currently marked as offline, not starting agent.jar"
        exit 1
    fi
fi

echo "This jenkins slave.jar will run as PID $$."
echo "This jenkins agent.jar will run as PID $$."
#export JAVA_ARGS="-Xmn128M -Xms1G -Xmx1G -client"
export JAVA_ARGS="-Xmx2G"
#export MALLOC_ARENA_MAX=1
exec java $JAVA_ARGS -jar /var/lib/jenkins/slave.jar
exec java $JAVA_ARGS -jar /var/lib/jenkins/agent.jar
Loading