Can I add multiple services in parallel to my enclave via composition? #1276
-
Can I add multiple services in parallel to my enclave via composition? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @guisellaDes! Adding services in parallel is a great way to speed up how quickly your distributed system gets instantiated inside your enclave. By default, the add_services instruction adds services in parallel with a default parallelism of 4 (which can be increased with the However, when it comes to adding multiple services from different packages, you must do so within the As an example, if you have a service_a.star file that looks like this: def run()...
def get_config()... Then you can add services from service_a.star in parallel into your main.star package with: a = import_module("./service_a.star")
def run():
a_config = a.get_config()
plan.add_services({"a": a_config}) |
Beta Was this translation helpful? Give feedback.
Hey @guisellaDes!
Adding services in parallel is a great way to speed up how quickly your distributed system gets instantiated inside your enclave. By default, the add_services instruction adds services in parallel with a default parallelism of 4 (which can be increased with the
--parallelism
flag).However, when it comes to adding multiple services from different packages, you must do so within the
plan.add_services
instruction with the configuration for each service in a dictionary. You cannot currently import multiple packages (using locators) and run them in parallel without using theplan.add_services
instruction because the call to run each of those imported packages starts the serv…