~sircmpwn/sr.ht-discuss

2 2

Optimizing SourceHut build for Docker

Details
Message ID
<20230126112430.48551235@works>
DKIM signature
missing
Download raw message
Hey there!
I got this small Docker build for my website engine that uses the
SourceHut CI but it is highly inefficient as it takes around 15
minutes (yes, 15 minutes) to build it.
Most of the time was added when starting to support multiarch using
buildx (and it has some problems with node by default so I had to add
the qemu line which adds even more complexity).
Anybody here has ideas on how to improve that?

Here is the build.yml:
https://git.sr.ht/~jae/Overengine/tree/beep/item/.build.yml

And a build example:
https://builds.sr.ht/~jae/job/928647

Nice day,
// Jae

-- 
j. Developer, Sysadmin; AS211696; https://777.tf
Details
Message ID
<CQ3N43B0C34O.3O7PU2KO1E8VQ@Abiolas-Mac-mini.local>
In-Reply-To
<20230126112430.48551235@works> (view parent)
DKIM signature
missing
Download raw message
Looking at your `.build.yml` file, the only thing I can pick on is that
you can do without creating a new builder instance.

i.e. you can remove the `sudo docker buildx create --use` line.

Running the binfmt container should suffice for buildx to recognize it
as a builder.

I personal have experience with tonistiigi/binfmt docker image,
but I believe multiarch/qemu-user-static does the same thing.

> Most of the time was added when starting to support multiarch using
> buildx (and it has some problems with node by default so I had to add

This is not very accurate according to the build logs. Most of the time
is spent between https://builds.sr.ht/~jae/job/928647#task-build-475 and
https://builds.sr.ht/~jae/job/928647#task-build-484, with the former
inclusive of about 4 minutes of network issues. They both took a
whopping 11 minutes.

This is very normal IMO. Emulation is generally expected to be
exponentially slower and 74% of your build time is spent running `yarn`
in an emulated architecture.

I do not think you have many options until native aarch64/arm64 builds
are supported.
Details
Message ID
<20230128101153.091c35ee@works>
In-Reply-To
<CQ3N43B0C34O.3O7PU2KO1E8VQ@Abiolas-Mac-mini.local> (view parent)
DKIM signature
missing
Download raw message
Alright, thanks a lot for the pointers!

> I do not think you have many options until native aarch64/arm64
> builds are supported.

Hopefully that will be the case in the future.

-- 
j. Developer, Sysadmin; AS211696; https://777.tf
Reply to thread Export thread (mbox)