Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a growing list of stories to screenshot and we've had trouble scaling vertically on the one computer. Splitting the work up via multiple storybook servers has become hard to handle at scale. Instead we've added a feature to storycap to allow for 'sharding' on the screenshot end.
By adding
--shard <shardNumber>/<totalShards>
and running storycap on multiple computers, we can horizontally scale the screenshot process.Stories are sorted by their IDs then distributed across shards in a round-robin style. We have some stories that rely on WebGL which are much slower than other simple components, since they're named similarly, this method reasonably distributes them across our workers.
For example, to run across two computers:
Merging the resultant screenshot artifacts is left to user, our CI solution makes that pretty easy and it seems out of the scope of storycap.
I hope this is helpful!