title: Jenkins Docker EC2 Plugin Parallel Jobs
body: <p>We have Jenkins configured on AWS based primarily on the setup described <a href="https://tech.ticketfly.com/our-journey-to-continuous-delivery-chapter-4-run-jenkins-infrastructure-on-aws-container-service-ef37e0304b95" rel="nofollow noreferrer">here</a>.</p>
  
  <p>As part of that configuration, we are using the <a href="https://wiki.jenkins.io/display/JENKINS/Amazon+EC2+Container+Service+Plugin" rel="nofollow noreferrer">Amazon EC2 Container Service Plugin</a> to provision build agents on demand. At the surface, this seems to be working correctly. When there are no running slave tasks in ECS, the plugin will start a morty-ecs-slave task and run the first build in the queue. However if another job gets added to the queue, it simply waits for the running job to complete before starting. Is it possible to spin up ~5 parallel builds for a particular pipeline job so that we can have multiple branches running at the same time? This is our current configuration:</p>
  
  <p><a href="https://i.stack.imgur.com/osush.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/osush.png" alt="enter image description here"></a></p>
  
  <p>Our pipeline is configured as such:</p>
  
  <pre><code>pipeline {
    agent {
        node {
            label "morty-ecs-slave"
        }
    }
  
    .... the rest of our stages/steps
  }
  </code></pre>
  
  <p>Please let me know if there is any more information I can provide, I'm admittedly <em>very</em> new when it comes to spinning up this kind of workflow.</p>