fresh-mechanic-68429
02/22/2024, 3:06 AMexecution_slot_variable
and I guess I could calculate an “offset” in the exposed ports. This may work but isn’t particularly other people, and doesn’t guarantee the port will be available. Is there any api available to act as a mutex? (so I could take/wait on a lock on the requested port)
Alternatively, is there a way to limit pants concurrency at the rule level? I saw Process.concurrency_available
but its missing a doc string how it should be used or what effect it has. I don’t really want to set the global concurrency to 1 using the global process_execution_local_parallelism
flagcareful-address-89803
02/22/2024, 3:26 AMversion: "3"
services:
web:
ports:
- "8000"
you can then get the host port with docker-compose port web 8000
or the api.
docker-compose delegates to the OS to get an available port.careful-address-89803
02/22/2024, 3:29 AMfresh-mechanic-68429
02/22/2024, 1:51 PMhappy-kitchen-89482
02/23/2024, 2:25 AMexecution_slot_variable
is for, but yeah, you'd have to have a range of ports that you know are availablehappy-kitchen-89482
02/23/2024, 2:26 AMfresh-mechanic-68429
02/23/2024, 2:31 AMconcurrency_available
directly correspond to the number of threads I’m asking pants to acquire for this process run?happy-kitchen-89482
02/23/2024, 2:35 AMhappy-kitchen-89482
02/23/2024, 2:36 AMhappy-kitchen-89482
02/23/2024, 2:39 AMconcurrency_available
is a way to tell pants how many cores the process itself (which is otherwise opaque to Pants) is capable of utilizing. It influences the number of cores available to the process, but it doesn't directly set it, because there may be other competing consumers of cores.happy-kitchen-89482
02/23/2024, 2:39 AMhappy-kitchen-89482
02/23/2024, 2:40 AMfresh-mechanic-68429
02/23/2024, 2:43 AMprocess_execution_local_parallelism
does that mean no other process will be allowed to execute at that time? Effectively making my rule a “singleton”
Or is it more of a “suggestion” rather than an enforced valuehappy-kitchen-89482
02/23/2024, 2:54 AMhappy-kitchen-89482
02/23/2024, 2:55 AMprocess_execution_local_parallelism=1
so you can get parallelism on other processes, but you want just pytest to not parallelize at all?happy-kitchen-89482
02/23/2024, 2:55 AMfresh-mechanic-68429
02/23/2024, 2:55 AMfresh-mechanic-68429
02/23/2024, 2:57 AMhappy-kitchen-89482
02/23/2024, 3:29 AMprocess_execution_local_parallelism
would work but is too strict because it would apply to all processes, not just the test processes. Yeah, makes sense.happy-kitchen-89482
02/23/2024, 3:51 AMgorgeous-winter-99296
02/28/2024, 12:09 PMfresh-mechanic-68429
05/14/2024, 1:49 PMhappy-kitchen-89482
05/15/2024, 4:02 AMgorgeous-winter-99296
05/15/2024, 7:22 AM