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

Support two levels of parallelity in stages

    Details

    • Similar Issues:

      Description

      Support scripted parallel blocks in parallel stages in a declarative pipeline.

      Example pipeline:

      pipeline {
          agent none
          stages {
              stage('Parallel Stage') {
                  parallel {
                      stage('Stage 1') {
                          steps {
                              echo "Stage 1"
                          }
                      }
                      stage('Stage 2') {
                          steps {
                              script {
                                  parallel (
                                      "Stage 2.1.": {
                                          echo "Stage 2.1."
                                      },
                                      "Stage 2.2.": {
                                          echo "Stage 2.2."
                                      }
                                  )
                              }
                          }
                      }
                  }
              }
          }
      }
      

      Currently it is not properly visualized in blue ocean as shown in parallel-stages.png

       

      The idea how it should be visualized is shown in parallel-stages-new.png

        Attachments

          Issue Links

            Activity

            Hide
            rockmax Rajat Saxena added a comment -

            Blueocean team - Any updates on this? Are you guys working on this issue since its a blocker for us?

             

            • Adobe Developer
            Show
            rockmax Rajat Saxena added a comment - Blueocean team - Any updates on this? Are you guys working on this issue since its a blocker for us?   Adobe Developer
            Hide
            shanidar1 Shani Dar added a comment -

            What I did as a workaround is building a parallel stage dynamically - 

            We deploy 5 services for two clouds, we want to deploy all in parallel.  Let's say each service takes 5 min to deploy, we had to wait 10 minutes because we couldn't run two cloud stages in parallel that runs multiple services stages also in parallel:

            So I built one parallel stage with all 10 services, and named each step with a relevant prefix:

             

            stage('Deploy') {
                                steps {
                                    script {
                                        def parallelStagesMap = [:]
                                            AWS_CLUSTER_NAME.collect {
                                               parallelStagesMap.put("AWS ${it}", buildUtils.Deploy('AWS', it))
                                            }
                                            GCP_CLUSTER_NAME.collect {
                                               parallelStagesMap.put("GCP ${it}", buildUtils.Deploy('GCP', it))
                                            }
            
                                         parallel parallelStagesMap
                                    }
                                }
                            }
            

             

             

             

             

            Show
            shanidar1 Shani Dar added a comment - What I did as a workaround is building a parallel stage dynamically -  We deploy 5 services for two clouds, we want to deploy all in parallel.  Let's say each service takes 5 min to deploy, we had to wait 10 minutes because we couldn't run two cloud stages in parallel that runs multiple services stages also in parallel: So I built one parallel stage with all 10 services, and named each step with a relevant prefix:   stage( 'Deploy' ) { steps { script { def parallelStagesMap = [:] AWS_CLUSTER_NAME.collect { parallelStagesMap.put( "AWS ${it}" , buildUtils.Deploy( 'AWS' , it)) } GCP_CLUSTER_NAME.collect { parallelStagesMap.put( "GCP ${it}" , buildUtils.Deploy( 'GCP' , it)) } parallel parallelStagesMap } } }        
            Hide
            ianfixes Ian Katz added a comment - - edited

            That's a good workaround. I can't speak for everyone here, but my personal interest in this issue is more to do with the first attached screenshot in the original issue – the ability to have multiple sequential stages shown in each parallel branch. In other words, to not have it all squish horizontally into a single stage that represents the entire branch.

            Show
            ianfixes Ian Katz added a comment - - edited That's a good workaround. I can't speak for everyone here, but my personal interest in this issue is more to do with the first attached screenshot in the original issue – the ability to have multiple sequential stages shown in each parallel branch. In other words, to not have it all squish horizontally into a single stage that represents the entire branch.
            Hide
            shanidar1 Shani Dar added a comment -

            Ian Katz I agree, I'm also waiting for this solution, that's what I did meanwhile until this issue will be resolved..

            Show
            shanidar1 Shani Dar added a comment - Ian Katz I agree, I'm also waiting for this solution, that's what I did meanwhile until this issue will be resolved..
            Hide
            rvnairme Rahul Nair added a comment -

            Is there a plan to update the visualization as shown in parallel-stages-new.png ? Or is it available in already in any of the new releases ?

            Show
            rvnairme Rahul Nair added a comment - Is there a plan to update the visualization as shown in parallel-stages-new.png ? Or is it available in already in any of the new releases ?

              People

              • Assignee:
                Unassigned
                Reporter:
                kurzy Daniel Kurzynski
              • Votes:
                93 Vote for this issue
                Watchers:
                96 Start watching this issue

                Dates

                • Created:
                  Updated: