org-formation-cli icon indicating copy to clipboard operation
org-formation-cli copied to clipboard

Creating types sequentially takes a long time

Open dbaynard opened this issue 2 years ago • 3 comments
trafficstars

https://github.com/org-formation/org-formation-cli/blob/416dbaaf6f531a76278d8226850336a4398eec58/src/plugin/impl/rp-build-task-plugin.ts#L127-L130

Is there a way to execute this for multiple types in parallel, so the total wait time is roughly a minute, the time it appears to take for the type to register, as opposed to n minutes for n types — this feels unnecessarily painful when setting up new accounts, in an existing organization (if it only happened when setting up the org then I'd be ok with it, though it would not be ideal)?

Naively, I might expect that rewriting the plugin to handle multiple types would then work… but I don't know whether there are AWS limits. If there is no such limit, would such a change — or an equivalent — be welcome? (I'd add a new plugin, to avoid breaking changes.)

dbaynard avatar Jul 24 '23 23:07 dbaynard

What typically is done to run type-registration in parallel is to increase the MaxConcurrentTasks (see here.)

this will ensure the types gets registered to different accounts & regions in parallel. if you have a lot of different types, you can set the MaxConcurrentTasks on the Type: include-task that imports the type registrations.

hope that helps

OlafConijn avatar Sep 20 '23 08:09 OlafConijn

Thanks — I have MaxConcurrentTasks set to 100 as in your example, but I'm hitting the issue for a single account/region.

I don't have it on for the Type: include block, so I'll do that.

 Types:
   Type: include
+  MacConcurrentTasks: 100
   DependsOn: OrganizationBuild
   Path: ./templates/005-types/_tasks.yml

Where would be the best place to document this (so I can close the issue — assuming it does in fact work)?

dbaynard avatar Sep 20 '23 14:09 dbaynard

for documentation on this attribute I would refer to the documentation on the include-task. It already mentions the attribute. If you would have expected it somewhere else: feel free to add it!

also happy to close the issue as-is. thanks

OlafConijn avatar Sep 22 '23 12:09 OlafConijn