[Blue Ocean]Stages in parallel not being displayed correctly

3,859 views
Skip to first unread message

Alan Wu

unread,
Dec 14, 2016, 4:19:29 PM12/14/16
to Jenkins Developers
First, I want to say thank you to the devs for creating this awesome plugin, I really like how the UI feels and looks.

I have some trouble getting Blue Ocean to display the build correctly,I hope you guys can shed light on what I have done wrong or if there is current limitation on the Blue Ocean build display.

The following pipeline script kicks off workflow on three nodes simultaneously:

parallel 'Slave1':{

    node('TestSlave1') {
        stage ('configure') {
         ...
        }
        stage ('make') {
         ...
        }
        stage ('test') {
         ...
        }
    }
   
}, 'Slave2':{
    node('TestSlave2') {
        stage ('configure') {
         ...
        }
        stage ('make') {
         ...
        }
        stage ('test') {
         ...
        }
    }
}, 'Slave3':{
    node('TestSlave3') {
        stage ('configure') {
         ...
        }
        stage ('make') {
            dir('./setup-build') {
         ...
        }
        stage ('test') {
         ...
        }
    }
}

I expect Blue Ocean to display three parallel lines showing stages on each of these slaves but instead I got one straight line displaying all stages under 'Slave1' as shown in the attachment.

Am I doing something wrong at this moment? As far as I know, stages in parallel was implemented not long ago and perjaps Blue Ocean has not caught up with that update yet?

Anyway input will be greatly appreciated, thank you very much.

Kind regards,
Alan

stages_in_parallel.png

Jesse Glick

unread,
Dec 14, 2016, 4:31:36 PM12/14/16
to Jenkins Dev
On Wed, Dec 14, 2016 at 4:19 PM, Alan Wu <ala...@auckland.ac.nz> wrote:
> As far as I know, stages in
> parallel was implemented not long ago and perjaps Blue Ocean has not caught
> up with that update yet?

B.O. devs can correct me but last I checked it will only display
top-level `stage`s and a single level of `parallel` beneath those, not
arbitrary nesting structures.

James Dumay

unread,
Dec 15, 2016, 1:56:02 AM12/15/16
to Jenkins Developers
That is correct. There is an open bug report tracking this issue - please watch and vote for it. The workaround is to surround your parallel with a stage block and linked issue has an example of how to do that. 

Longer term we may modify the display so parallels not in a stage automatically look like they are defined within a stage for visualization purposes.

James Dumay

unread,
Dec 15, 2016, 2:00:43 AM12/15/16
to Jenkins Developers
While I am here, I'm going to plug Declarative Pipeline (new syntax for Pipeline). Any parallels have to be within a stage and there is not nesting of stages. As such Blue Ocean will visualise it perfectly for you every time you write a Jenkinsfile.

Jesse Glick

unread,
Dec 15, 2016, 1:00:53 PM12/15/16
to Jenkins Dev
On Thu, Dec 15, 2016 at 2:00 AM, James Dumay <jdu...@cloudbees.com> wrote:
> […in Declarative Pipeline] Any parallels have to be within a stage and there is not nesting of stages.

Making it unusable for the originally requested use case, since you
could not differentiate the configure/make/test substages of each
branch. Currently only the low-level *Pipeline Steps* link displays
arbitrary structure. Stage View will display all the stages, but mixed
up in a series, and the display gets messed up for builds in progress.

James Dumay

unread,
Dec 15, 2016, 3:32:38 PM12/15/16
to Jenkins Dev
There's some design kinks to work out for nesting.

I've been asking people to illustrate their desired visualization for nested staging when they've requested we fix visualization and I get a lot of varied expectations regarding how it should look (I suspect we're going to have to pick the most common interpretation)

Certainly something we want to look at in the post-1.0 time frame :)
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/msDK4In10QU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr3y03Rpj9mZR%3D4VY19F7XUAcT0iryWzC58344Lf4_h73A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
James Dumay
Product Manager
CloudBees, Inc.
Skype: jdumaycb Twitter: i386

Alan Wu

unread,
Dec 15, 2016, 4:35:06 PM12/15/16
to Jenkins Developers
Thanks so much for all the quick responses.

Personally I think having the ability to visualise nested stages within each parallel node are important.

Says if I now have the parallel block within a stage called "Build and test" and add in a "deploy" stage after it,
here is my two cents on how I imagine my use case should look.

                         / Slave1 -- configure -- build -- test \
  Build and test - Slave2 -- configure -- build -- test - deploy
                         \ Slave3 -- configure -- build -- test /



James Dumay

unread,
Dec 15, 2016, 4:39:47 PM12/15/16
to Jenkins Developers
Thats great info Alan. BTW you should watch and vote for this ticket https://issues.jenkins-ci.org/browse/JENKINS-38442 

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/msDK4In10QU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

James Dumay

unread,
Dec 15, 2016, 4:40:32 PM12/15/16
to Jenkins Developers
Alan how would you write the Jenkinsfile for that example?

Alan Wu

unread,
Dec 15, 2016, 5:09:38 PM12/15/16
to Jenkins Developers
Thanks, I have just signed up, watched and voted. ;)

Anyway, I am still learning the pipeline so please pardon me if I make any mistake in my script. I have also attached a screenshot of how it looks at this moment in BlueOcean.

stage("Build and test") {

    parallel 'Slave1':{
        node('TestSlave1') {
            stage ('configure') {
             ...
            }
            stage ('make') {
             ...
            }
            stage ('test') {
             ...
            }
        }
      
    }, 'Slave2':{
        node('TestSlave2') {
            stage ('configure') {
             ...
            }
            stage ('make') {
             ...
            }
            stage ('test') {
             ...
            }
        }
    }, 'Slave3':{
        node('TestSlave3') {
            stage ('configure') {
             ...
            }
            stage ('make') {
             ...
            }
            stage ('test') {
             ...
            }
        }
    }
}
stage('Deploy') {
    ...
deploy_stages.png

Jesse Glick

unread,
Dec 15, 2016, 6:52:47 PM12/15/16
to Jenkins Dev
On Thu, Dec 15, 2016 at 5:09 PM, Alan Wu <ala...@auckland.ac.nz> wrote:
> please pardon me if I make any
> mistake in my script.

There is nothing wrong with that script; its structure is just beyond
the “display resolution” of both Stage View and Blue Ocean at the
moment.

Timothy c

unread,
Jul 13, 2017, 8:43:00 AM7/13/17
to Jenkins Developers
Not trying to throw a spanner in the works, how deep would the nesting go
eg

stage("Build and test") {
    parallel 'Slave1':{
        node('TestSlave1') {
            stage ('configure') {
             parallel 'WebServer':{
               stage('template'){
                 ...
               }
               stage('next'){
                 ...
               }
              }, 'MailServer' :{
               stage('template'){
                 ...
               }
               stage('next'){
                 ...
Reply all
Reply to author
Forward
0 new messages