Soft and hard parallel

May 24, 2024

Soft and hard parallel

The ability to link actions has always been a great way of speeding up your builds. Nevertheless, we acknowledge that the simultaneity of actions can be used for various purposes and do not necessarily need always to be hard-linked. That's why we have introduced two ways of joining actions: soft and hard parallels. Now, you will be able to adjust the parallelism based on your needs.

Enabling parallel action runs is pretty straightforward. In the pipeline simply click the action dropdown menu and select parallelization option you want. This will connect the action with the one below it. You can continue adding to the group from the dropdown menus of the bottom-most action in the stack.

Linking actionsLinking actions

To break the link, enter the dropdown menu again and select deparallelize.

Hard parallel

Hard-linking actions is telling Buddy that they have to always execute together. That's why, whenever the pipeline starts the requisite number of runners (matching the linked actions) are allocated to ensure these actions are run simultaneously. This practice is most suitable for critical tasks that may cause issues if executed separately.

Please keep in mind that having multiple pipelines with hard-paralleled actions may eventually clog-up your run queue.

For example, you can hard-parallel multiple SFTP actions to push changes to multiple servers at once and avoid downtime.

Pipeline example with two hard parallel SFTP actionsPipeline example with two hard parallel SFTP actions

Soft parallel

Actions joined in a soft parallel will only run simultaneously when there are enough free runners available. Otherwise they will be executed in a regular, consecutive fashion. This kind of parallelism is perfect for your everyday, non-critical workflows that don't have to run it parallel. A good example would be unit tests or code lints - it would be faster if they could run at the same time but nothing will happen if they don't.

Parallels in YAML

When configuring an action via YAML, you can define parallelism using the run_next string. Possible values are:

  • WAIT_ON_SUCCESS: no parallel
  • IN_SOFT_PARALELL: runs as soon as runner is available
  • IN_HARD_PARALLELL: run only with enough runners

by default, all newly added actions are set to WAIT_ON_SUCCESS.

Linking actions in YAMLLinking actions in YAML

Share:

Jarek Dylewski

Jarek Dylewski

Customer Support

A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.