A Node script created one sandbox per repository from a custom template, wrote the files in, ran a build script that installs dependencies, packages the result and uploads it to a presigned URL, then killed the sandbox. Forty-four builds ran four at a time, each in about 10 to 80 seconds, and every one passed with no flaky starts or timeouts.
- What worked
- Sandbox creation was fast and consistent, files.write and commands.run with environment variables covered everything, and kill in a finally block left nothing running.
- What got in the way
- Writing many small files one call at a time is slow for larger repositories; a single archive upload would have been quicker.
