karpenter_build_native_arch_enabled

Description

The karpenter_build_native_arch_enabled parameter builds each image architecture on a Karpenter build node of that architecture. With the parameter off, Builds run in one build NodePool whose architecture comes from build_node_type, and any other architecture is built there under emulation, which is several times slower for compile-heavy Builds.

The parameter takes effect only with karpenter_enabled=true and build_node_enabled=true.

With the parameter on, the build NodePool allows the architectures the Rack's Karpenter pools run, plus the build_node_type architecture. The Karpenter pool architectures are karpenter_arch, or the node_type architecture when it is unset, and the arch of each additional_karpenter_nodepools_config pool. A Rack where all of these are one architecture is not changed by the parameter.

The parameter changes where each architecture is built, not which architectures a Build produces. See Build Output for that.

Default Value

The default value is false. Builds run as they did before Rack version 3.26.1.

Build Placement

Build Parameter off Parameter on
One target architecture, build pool of the other (for example karpenter_arch=arm64 with an amd64 build_node_type) Built under emulation Built on a build node of the target architecture
Two target architectures (karpenter_arch=amd64,arm64, or a pool whose arch differs) One architecture native, the other emulated Each architecture built on its own build node, at the same time
BuildArch names an architecture a Karpenter pool runs and the build pool lacks The build pod stays Pending until convox builds cancel Built on a build node of that architecture
Development Build on a Rack that targets both architectures Built for the build_node_type architecture Same
App with BuildLabels Placed by its labels Same. The parameter does not apply to it
Two target architectures, Service whose Dockerfile has an ONBUILD instruction One architecture native, the other emulated Same
Service with image: instead of build: No emulation involved Same

BuildArch still needs a Karpenter pool of the architecture it names. On a Rack whose Karpenter pools are all amd64, with arm64 nodes only in an additional_node_groups_config group, BuildArch=arm64 leaves the build pod Pending with the parameter on as well.

BuildLabels Apps are excluded because their labels can select nodes of one architecture only, so pinning them to another architecture could leave the Build Pending.

Two-Architecture Builds

A Build that targets both architectures runs its build pod on a build node of the build_node_type architecture and a second pod on a build node of the other architecture for the length of the Build. The second pod requests the same CPU and memory as the build pod.

  • Build log lines of the two architectures are prefixed [amd64] and [arm64].

  • The second pod is not a Process. convox ps does not list it and convox logs does not show it. Its output reaches the Build log through the build pod.

  • When no node of the other architecture answers within 5 minutes of the Build starting, or the node stops answering during the Build, that architecture is built on the build pod under emulation. The Build does not fail for that reason, and the Build log shows:

    WARNING: no arm64 build node is reachable, building arm64 on this node under emulation
    
  • A RUN step that fails on the second node fails the Build, as it would on the build pod.

  • Both build nodes are reclaimed karpenter_build_consolidate_after after they are empty.

Capacity and Cost

  • A two-architecture Build uses two build nodes.
  • karpenter_build_cpu_limit and karpenter_build_memory_limit_gb cover the build nodes of both architectures together. A limit that fits only one build node makes every two-architecture Build wait 5 minutes and then emulate the second architecture.
  • When karpenter_build_instance_families is set, it must include a family for each architecture the Rack's Karpenter pools run.
  • For small Builds, waiting for a second build node can take longer than emulating the architecture would.

Setting the Parameter

$ convox rack params set karpenter_build_native_arch_enabled=true -r rackName
Updating parameters... OK

To return to emulated Builds:

$ convox rack params set karpenter_build_native_arch_enabled=false -r rackName
Updating parameters... OK

Turning the parameter on or off updates the build NodePool in place. Images already built keep running.

Viewing Current Configuration

$ convox rack params -r rackName

Additional Information

  • Requirements: convox rack params set refuses true on a Rack without karpenter_enabled=true and build_node_enabled=true:

    karpenter_build_native_arch_enabled=true requires karpenter_enabled=true and build_node_enabled=true
    

    Set from the Console, or left on after karpenter_enabled or build_node_enabled is turned off, the parameter has no effect. A Rack update applied by CLI version 3.26.1 or later then ends with:

    WARNING: karpenter_build_native_arch_enabled is set but has no effect. It requires karpenter_enabled=true and build_node_enabled=true.
    
  • Build instance families: while the parameter is on, and in the call that turns it on, convox rack params set and the Console refuse a karpenter_build_instance_families list with no family for one of the architectures the Rack's Karpenter pools run:

    karpenter_build_instance_families (c5,m5) has no arm64 family; with karpenter_build_native_arch_enabled=true the build pool needs a family for each architecture the rack runs
    
  • Validation: must be true or false. The parameter is a boolean and is not cleared; set false to turn it off.

  • Version: requires Rack version 3.26.1 or later and CLI version 3.26.1 or later. An older CLI rejects the name as an unknown parameter, so run sudo convox update first.

  • Downgrade: turning the parameter off, or downgrading the Rack below 3.26.1, returns to emulated Builds. Images built with the parameter on keep running.

  • Providers: AWS only. The CLI rejects it on other providers with karpenter parameters are only supported for AWS racks.

See Also