Replies: 17 comments
-
Guessing you mean for a given task here? There is a |
Beta Was this translation helpful? Give feedback.
-
I know there's a
|
Beta Was this translation helpful? Give feedback.
-
same here. our use case is tests that mess with a database and unfortunately have to run serially atm |
Beta Was this translation helpful? Give feedback.
-
Similarly to @scamden , I'm trying to express that a couple workspaces' I have another idea for how it could work. Maybe something like this?: "mutuallyExclusive": ["foo#test", "bar#test"] I'd still like to crank up concurrency globally, and have a bunch of other test suites running simultaneously. I just need to carve out specific exceptions. |
Beta Was this translation helpful? Give feedback.
-
These are both good suggestions! I will bring it up with the team. Thank you for the use case! |
Beta Was this translation helpful? Give feedback.
-
Hey @osdiab we talked about this at our team meeting today and the general thought is that it's an interesting feature and we may consider this at some point, but it's not a high priority right now. Some workarounds you may consider to make this work for you:
|
Beta Was this translation helpful? Give feedback.
-
I was hoping to use turbo as the top level cli but without this feature we are forced to run some tasks via turbo and some via pnpm (since running something with root package.json produces unreadable multiply nested output without colors). Really feels like turbo.json should be a declarative source of truth for the tasks across the monorepo. Really disappointing to hear this isn't a priority. |
Beta Was this translation helpful? Give feedback.
-
@scamden thanks for flagging the need, we're definitely tracking this and are taking it into consideration.
We're also looking at this in #219, for what it's worth. It may not solve the underlying problem of task running that this Issue is about, but if it helps your use case, it's closer on our roadmap (currently scheduled for 1.10 release) |
Beta Was this translation helpful? Give feedback.
-
It would also be great to use indirect measures for concurrency, like available resources (cpu, memory, custom resources). For example, we have tasks that are very lightweight, but others that need Gigabytes of memory. Running all these tasks with the same concurrency level would either lead to idling runner instances or to memory issues. Just looking at the concurrency limit per task is not enough then, because there is a mixture of different tasks running at the same time, and while the next heavyweight task might not be able to run at a point in time, a smaller task of another workspace might do it. One possible solution could be specifying resource usage per task and something like selectable resource profiles for the different environments. |
Beta Was this translation helpful? Give feedback.
-
I just had a chat with Carsten. Not sure if this would be possible. But what would be really advanced and great if turbo would over the time measure the resources of all tasks (and save the information in the remote cache?!). With this information turbo could optimize the execution of all the tasks and e.g. not execute very resource heavy tasks in parallel ;-) |
Beta Was this translation helpful? Give feedback.
-
+1 for one of the last two options. Now we cannot use TurboRepo optimally i.e. run everything in 1 command. This is really a shame... |
Beta Was this translation helpful? Give feedback.
-
Even a global key in a root config (same level as globalEnv) would do for us. trubo.json {
... pipeline, globalEnv ...
"concurrency": 12
} |
Beta Was this translation helpful? Give feedback.
-
With monorepos with 3x tasks as available CPUs, turbo running "lint" across said monorepo can cause a laptop to get a smidge sluggish for a few seconds I only have 8 cores on this laptop 😅 this ends up leaving 0 available cores for the operating system |
Beta Was this translation helpful? Give feedback.
-
At @hokify we solved this by creating a wrapper for the turbo CLI which we use everywhere, this is quite easy to do in a pnpm monorepo. The most important part is the wrapper .mjs file itself: #!/usr/bin/env node
/**
* this module is a simple wrapper for "turbo" which
* - if no explicit "concurrency" is given, sets a default of 100% (to utilize all logical processors, see https://turbo.build/repo/docs/reference/command-line-reference/run#--concurrency)
* - and sets some default CLI arguments (e.g. "--env-mode=strict")
*/
import { spawn } from 'node:child_process';
import { argv } from 'node:process';
const [_execPath, _jsFilePath, ...commandLineArguments] = argv;
commandLineArguments.push(
'--no-update-notifier',
'--env-mode=strict',
'--framework-inference=false',
);
if (!commandLineArguments.some((arg) => arg.startsWith('--concurrency'))) {
commandLineArguments.push('--concurrency=100%');
}
spawn('turbo', commandLineArguments, {
cwd: process.cwd(),
stdio: 'inherit',
env: process.env,
// set shell to true for windows (https://stackoverflow.com/a/54515183)
shell: process.platform === 'win32',
}).on('exit', (code) => {
if (code !== null) {
process.exitCode = code;
}
}); |
Beta Was this translation helpful? Give feedback.
-
We would have a need for this to avoid running multiple build job in parallel because it sometimes leads to Node running out of memory. |
Beta Was this translation helpful? Give feedback.
-
+1 would love this feature |
Beta Was this translation helpful? Give feedback.
-
It's a couple years later and I'm setting up another project with multiple database-using test projects. Does anyone have a good way to prevent Turbo from running them simultaneously? Unless I'm missing something, it looks like I need to put |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
I have a single command that doesn't work if I run it in parallel, but I would like to still have other pipelines depend on it
Describe the solution you'd like
In
turbo.json
, allow me to set a default concurrency value for a given pipeline.Describe alternatives you've considered
I am just running the command manually for now in a
package.json
script, but that's not very elegant.TURBO-1139
Beta Was this translation helpful? Give feedback.
All reactions