I'm looking for a way to get a count of the number...
# plugins
p
I'm looking for a way to get a count of the number of execution_slots / concurrency_slots pants can use in a session. I need this to setup (or validate the setup of) a system service (to make sure it is configured to accept connections for each of the slots; in this case, I need to create a RabbitMQ vhost for each slot). I don't see a goal that would let me query this from a shell. I'm grepping through the sources, but I don't see a way for a plugin to get that either. Any pointers?
if yes, that's available in a plugin from the
GlobalOptions
, and a console script if you're ok parsing the help output šŸ˜‰
p
Oh. I assumed that option wouldn't have a value unless explicitly set. Your screenshot clearly shows "current value: 12". Do you have that set in a pants.toml file? Or is that the calculated value?
c
the default states
#cores
which is determined at runtime.
i.e. the calculated one
p
Nice!
c
oh, right, and from a console script using
help-all
should get it in json format... along with 1MB scruff..
p
True. Very good. That should help for local execution.
šŸ‘ 1
Now I wonder about remote execution... Does execution_slot_var get exposed to remote executors? This is theoretical for me since I don't use remote execution. But, I wonder how a shared service would be able to safely handle concurrent execution across multiple remote executors.
Oh. I see a remote parallelism opt as well
Is there an env var or something that tells a process which runner is running it (and therefore which pool of slots the slot var is in)? • slots/local_parallelism bound pool: ā—¦ local_sandbox_command_runner ā—¦ local_workspace_command_runner ā—¦ nailgun_runner ā—¦ docker_runner • slots/remote_parallelism bound pool: ā—¦ remote_execution_runner https://github.com/pantsbuild/pants/blob/main/src/rust/engine/src/context.rs#L200-L342 None of the runners seem to inject vars other than the slot var.