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

builds triggered remotely do not run concurrently

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • None

      This setup consists of master and secondary job

      Master job is setup using 'Active Choices Parameter' to choose a host as parameter. It also lists maven artifact versions to pass the artifact as a parameter to secondary job as well.

      The build step is to 'execute shell' which executes the secondary job remotely with a curl command

      e.g.

      for i in $(echo $HOSTS | sed -e 's/,/ /g'); do
      /usr/bin/curl --data-urlencode "HOST=$i" --data-urlencode "BUILD_URL=${BUILD_URL}" ${JENKINS_URL}job/testing_deploy/buildWithParameters?token=

      {job token}

      done

      The secondary job takes those parameters and runs an ssh command for the host that was passed

      e.g.

      ssh -o RequestTTY=force

      {user}

      @${HOST} <<EOF
      set -xe
      service jboss-as-standalone stop
      mkdir -p /tmp/${JOB_NAME}/${BUILD_NUMBER}
      cd /tmp/${JOB_NAME}/${BUILD_NUMBER}
      wget -O st.ear $BUILD_URL
      chown -v jboss:jboss /tmp/${JOB_NAME}/${BUILD_NUMBER}/

      {artifact id}
      mv -vf /tmp/${JOB_NAME}/${BUILD_NUMBER}/{artifact id}

      /usr/share/jbossas/standalone/deployments/

      {artifact id}

      service jboss-as-standalone start
      exit 0
      EOF

      So the goal is on the master job we can multi select hostnames. If two hostnames are selected from one master job it fires two secondary jobs. This works great. The only issue is that when the secondary jobs are triggered they run serially instead of in parallel.

      The secondary job is setup to use throttle concurrent build plugin

      Max Total concurrent builds = 8
      Max total per node = 2

      We have 4 slaves running, with two executors. So 8 builds should be able to run at once, with two per node. This works on other projects we have but not this.

      It seems if builds have different parameters they are not honoring throttle concurrent builds parameters.

            oleg_nenashev Oleg Nenashev
            phxazusa1 Matt Evans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: