Is the deploy sequential or parallel?

Let’s say we’ve 20 servers and we do this in our actual deploy (WebApp on IIS):

  • create files

Then foreach sever of the 20 servers:

  • put server outside of balancing
  • mirror copy files
  • do a basic automated test to see if it works
  • put server inside of balancing

Does octopus deploy do this in parallel, or sequentially?
In parallel it would remove like all machines of balancing.

Would it be possible with octupus create this scenario instead:

  • create package
  • copy all the packages to server in parallel

Then foreach sever of the 20 servers (sequential)

  • put server outside of balancing
  • update files with package
  • do a basic automated test to see if it works
  • put server inside of balancing

Even better it would be to have this scenario:

  • create package
  • unpack the content of the package in parallel to all servers in the octopus application directory (without switching IIS)

Then foreach sever of the 20 servers (sequential)

  • put server outside of balancing
  • switch IIS
  • do a basic automated test to see if it works
  • put server inside of balancing

Let me know if it’s possible :slight_smile:

Cheers,
Andrea

ps: Octopus seems very nice!

Hi Andrea,

We run each step in parallel. So if all of those tasks were in a single step, they would be run on all 20 servers at once.

However, you can set a special variable called OctopusMaxParallelism to a value of, say, 5. This way the step will only be executed on 5 machines at any given time. If one machine finishes, then the next will start, and so on, with only 5 ever running at once.

Hope that helps,

Paul

Sounds great! I will try this on monday :slight_smile:

I found this in the documentation:

A variable can be “scoped” to zero or one of each of the following:

An environment (most common)

A specific machine

A specific package

By package you mean “package as a step?” If yes: does this work with a powershell step too?

Can I set OctopusMaxParallelism only for one step?

Example:

  • step 1 must run in parallel (OctopusMaxParallelism = infinite)
  • step 2 must run sequentially (OctopusMaxParallelism = 1)
  • step 3 must run in parallel again (OctopusMaxParallelism = infinite)

Thanks for your answer btw.
Cheers,
Andrea

Hi Andrea,

Yes, in the variables tab, just set the value and choose the step to scope
it to - then it will only be used for that one step.

Regards,

Paul Stovell
Octopus Deploy
W: octopusdeploy.com | T: @octopusdeploy http://twitter.com/octopusdeploy

I’ve tried it, but it isn’t working. Probably i’m doing something wrong:

Here is what i tried to do:

Created a Step named “Sleep 10 seconds” with this powershell code:

Write-Host “OctopusMaxParallelism is $OctopusMaxParallelism”

Start-Sleep -s 10

I’ve set a variable like this:

Name: OctopusMaxParallelism

Value: 1

Environment: LocalEnvironment

All other variable set to nothing

Result:

Execute deployment steps
Step 1: Sleep 10 seconds
2013-03-11 11:34:54 DEBUG Finding LocalEnvironment machines in the following role(s): web-server
2013-03-11 11:34:54 DEBUG Found machines:
2013-03-11 11:34:54 DEBUG - DSKTEK258 (http://dsktek258:10933/)
2013-03-11 11:34:54 DEBUG - TommasoLocalMachine (http://userwin7-pc:10933/)
2013-03-11 11:34:54 INFO Execute step Sleep 10 seconds
2013-03-11 11:35:07 INFO Step completed
Execute step Sleep 10 seconds against machine DSKTEK258
2013-03-11 11:34:54 INFO Begin script run
2013-03-11 11:34:54 DEBUG Running script against tentacle http://dsktek258:10933/
2013-03-11 11:35:06 INFO Job successful. Tentacle output follows:
2013-03-11 11:34:55 INFO OctopusMaxParallelism is 1
2013-03-11 11:35:05 INFO ==============================================
2013-03-11 11:35:05 INFO PowerShell exit code: 0
2013-03-11 11:35:05 INFO ==============================================

Execute step Sleep 10 seconds against machine TommasoLocalMachine
2013-03-11 11:34:54 INFO Begin script run
2013-03-11 11:34:54 DEBUG Running script against tentacle http://userwin7-pc:10933/
2013-03-11 11:35:07 INFO Job successful. Tentacle output follows:
2013-03-11 11:34:58 INFO OctopusMaxParallelism is 1
2013-03-11 11:35:08 INFO ==============================================
2013-03-11 11:35:08 INFO PowerShell exit code: 0
2013-03-11 11:35:08 INFO ==============================================

If you see the lines in bold you can see it is not running in sequential mode.
What is wrong in your opinion?

Hi Andrea,

This is a bug - the max parallelism only works on NuGet package steps, not powershell steps. I’ll fix it in the next release.

Paul

Thanks Paul!