Skip to content

Long build times - possibly because build images are not platform-specific #1339

Open

Description

@krisbitney

Describe the bug
Build times are quite long using the vm build strategy. Building a small AssemblyScript wrapper can take 5-6 minutes. I am also unable to build Rust wrappers using vm and local strategies, but I don't know if the issues are related.

Please provide the steps to reproduce and if possible a minimal demo of the problem.

Build a wrapper on a machine with an arm processor (e.g. Apple processors)

Expected behavior
I expect build times to be much faster for VM strategy

Screenshots / logs

It may be related to this message:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

I built the Hello World wrappers in the demos repo multiple times to compare build times. I cleared the docker cache (containers, images, and volumes) and deleted .polywrap folders before each build.

AssemblyScript wrapper build times:

  • Image strategy: Done in 74.09s
  • VM strategy: Done in 522.97s
  • Local strategy: Done in 16.97s

Rust wrapper build times:

  • Image strategy: Done in 77.34s
  • VM strategy -> build fails
  • Local strategy: -> build fails

Relevant environment details:

  • OS: MacOS
  • arm64 cpu

Activity

  1. dOrgJelli commented on Oct 17, 2022

    @dOrgJelli
    Contributor

    @krisbitney when building using the vm strategy, it uses a pre-built docker image as the "vm" and runs a build script within it. This means that, in order for build times to be quick, you need to have the vm image downloaded first. If you are "clearing docker cache before each build" then you are removing the >1GB base image from your system, which requires a new download to take place when you run build again.

    Can you please try building a wrapper multiple times w/o clearing the docker cache? The build times should be very quick (close to native).

  2. krisbitney commented on Oct 17, 2022

    @krisbitney
    ContributorAuthor

    @krisbitney when building using the vm strategy, it uses a pre-built docker image as the "vm" and runs a build script within it. This means that, in order for build times to be quick, you need to have the vm image downloaded first. If you are "clearing docker cache before each build" then you are removing the >1GB base image from your system, which requires a new download to take place when you run build again.

    Can you please try building a wrapper multiple times w/o clearing the docker cache? The build times should be very quick (close to native).

    The VM strategy build time improves on the second and third build, but it's still much slower for me

    AS Hello World build using VM strategy
    First build: Done in 297.63s
    Second build: Done in 121.05s
    Third build: Done in 121.63s

    AS Hello World build using Image strategy
    First build: Done in 12.25s
    Second build: Done in 11.04s
    Third build: Done in 9.07s

    AS Hello World build using Local strategy
    First build: Done in 16.40s
    Second build: Done in 14.35s
    Third build: Done in 13.59s

    Rust Hello World build using Image strategy
    First build: Done in 35.34s
    Second build: Done in 36.11s
    Third build: Done in 33.00s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions