GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Psake for now based on Powershell 2.0 and does not support parallel tasks at all.
Parallel tasks is very desired feature, making psake really first-class build system.
The only feature in PowerShell that support parallelism is workflows.
Workflows available since PowerShell 3.0.
So there only way I see to support parallel tasks is to migrating to PowerShell 3.0 and using workflows as back-end abstraction for parallel tasks.
What would the output of those parallel tasks looks like in the console / stdout? Pretty certain this would mess up tools that process stdout (i.e. TeamCity) and the build log. From http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx
In which order do you think the data will be returned?
You can’t tell! You can run this workflow a number of times and the data may be returned in a different order each time you run it!
If you are running workflow activities in parallel there are no guarantees as to the order in which data will be returned. You cannot assume that one piece of data will be returned before another."
Yeah I'm against this from a build script perspective... @whut , thoughts?
That seems like an easy to address objection, just use a message queue to pass logging back to the master/controller and prefix any log events with the child process name+ID or something...
With the "depends" logic it's fairly easy to multi-thread if it makes sense, still not sure when it would make sense though, use case needs more refining.
I could use parallel task. Say I need to run grunt/gulp and upload files, those could be done in parallel to build/deploy.
I like this idea a lot.
Output could be:
Task A: whatever output
Task B: whatever output
Could really use this can think of many instances that we can use it
Well does someone want to try implementing it so? 😉
Workflows can be overkill.
Maybe can be achieved with https://github.com/RamblingCookieMonster/Invoke-Parallel
are there any thoughts on how one would build and/or compose parallel tasks? Task Default -parallelDepends t1, t2, t3?
Task Default -parallelDepends t1, t2, t3
i just had a thought about this. without proper testing, i don't believe that the $psake global and anything bolted onto it (e.g. $psake.context) is safe for concurrency. One might need to copy the variable and pass into an invocation of Invoke-Task.
Maybe the easiest thing to do is to created nested calls to Invoke-psake inside of a Start-Job. i added a PR #152 to show what an example might look like at a Task level.
@sweeneyrobb this seems like a sensible approach to me, and fits in with the existing infrastructure.
@gep13 thanks! I'll put together another PR. Thanks for the response.
@gep13 thanks, I think your solution is well enough/
Start-Job\Wait-Job\Receive-Job combination allows to run tasks as parallel.
I close my issue, I think it is already resolved.
@maximpashuk glad to hear that you were able to make progress and thanks for following up by closing the issue.