Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3592393
feat: Add ARM64 (arm64) stemcell build support
vighes Sep 16, 2026
fa18269
ci: Add arm64 os-image build job and arch-aware builder image
vighes Sep 24, 2026
4c54388
fix(ci): Build arm64 os-image in an arm64 builder image
vighes Sep 24, 2026
38bf380
feat: Make the stemcell build stage arm64-capable
vighes Oct 1, 2026
6be1c8a
fix: Fail on an unmapped stemcell architecture in the manifest
vighes Oct 12, 2026
a3d30fb
Merge remote-tracking branch 'upstream/ubuntu-noble' into arm64-support
vighes Oct 30, 2026
aff698b
fix: Use the AWS architecture value in arm64 stemcell manifests
vighes Oct 30, 2026
b5e9dff
fix(ci): Run amd64-only resource steps off the arm64 workers
vighes Oct 30, 2026
93b1b86
fix(ci): Find and name the raw stemcell archive with the arch suffix
vighes Oct 30, 2026
067ddc2
refactor(spec): Share one apt sources regex across architectures
vighes Oct 30, 2026
0c7c028
chore: Trim status narration from comments in the arm64 changes
vighes Oct 30, 2026
f683baa
refactor(ci): Require STEMCELL_ARCH in the stemcell build tasks
vighes Oct 30, 2026
a7ecfab
fix(spec): Skip the /lib64 ownership check on arm64 with an rspec tag
vighes Oct 30, 2026
7d1b1e7
refactor(bosh_go_agent): use meta4 from the builder image
vighes Nov 2, 2026
43946d5
refactor: add gnu_arch helpers for multiarch triplets
vighes Nov 2, 2026
9e80843
refactor(static_libraries_config): select static library list per arc…
vighes Nov 2, 2026
64d6836
test(stemcell): add arm64 package list for the Ubuntu base packages c…
vighes Nov 2, 2026
084c162
Merge remote-tracking branch 'upstream/ubuntu-noble' into arm64-support
vighes Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ require "standard/rake"

namespace :stemcell do
desc "Build a base OS image for use in stemcells"
task :build_os_image, [:operating_system_name, :operating_system_version, :os_image_path] do |_, args|
task :build_os_image, [:operating_system_name, :operating_system_version, :os_image_path, :architecture] do |_, args|
require "bosh/stemcell/archive_handler"
require "bosh/stemcell/build_environment"
require "bosh/stemcell/definition"
require "bosh/stemcell/os_image_builder"
require "bosh/stemcell/stage_collection"
require "bosh/stemcell/stage_runner"

definition = Bosh::Stemcell::Definition.for("null", "null", args.operating_system_name, args.operating_system_version)
args.with_defaults(architecture: Bosh::Stemcell::Definition::DEFAULT_ARCHITECTURE)

definition = Bosh::Stemcell::Definition.for("null", "null", args.operating_system_name, args.operating_system_version, args.architecture)
environment = Bosh::Stemcell::BuildEnvironment.new(
ENV.to_hash,
definition,
Expand Down Expand Up @@ -42,17 +44,17 @@ namespace :stemcell do
end

desc "Build a stemcell, requires `os_image_path` pointing at an image created via `stemcell:build_os_image`"
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number, :architecture] do |_, args|
require "bosh/stemcell/build_environment"
require "bosh/stemcell/definition"
require "bosh/stemcell/stage_collection"
require "bosh/stemcell/stage_runner"
require "bosh/stemcell/stemcell_packager"
require "bosh/stemcell/stemcell_builder"

args.with_defaults(build_number: "0000")
args.with_defaults(build_number: "0000", architecture: Bosh::Stemcell::Definition::DEFAULT_ARCHITECTURE)

definition = Bosh::Stemcell::Definition.for(args.infrastructure_name, args.hypervisor_name, args.operating_system_name, args.operating_system_version)
definition = Bosh::Stemcell::Definition.for(args.infrastructure_name, args.hypervisor_name, args.operating_system_name, args.operating_system_version, args.architecture)
environment = Bosh::Stemcell::BuildEnvironment.new(
ENV.to_hash,
definition,
Expand Down
5 changes: 5 additions & 0 deletions bosh-stemcell/lib/bosh/stemcell/arch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ def self.arch
def self.x86_64?
arch == "x86_64"
end

# GNU triplet prefix used for multiarch library paths, e.g. x86_64-linux-gnu
def self.gnu_arch
x86_64? ? "x86_64" : "aarch64"
end
end
end
3 changes: 2 additions & 1 deletion bosh-stemcell/lib/bosh/stemcell/build_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,11 @@ def exclude_exclusions
when Infrastructure::Gdch::NAME
" --tag ~exclude_on_gdch"
end,
" --tag ~exclude_on_#{definition.architecture}",
if operating_system.variant?
" --tag ~exclude_on_#{operating_system.variant}"
end
].compact.join(" ").rstrip
].compact.join(" ").squeeze(" ").rstrip
end

def image_file_path
Expand Down
1 change: 1 addition & 0 deletions bosh-stemcell/lib/bosh/stemcell/builder_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def default
"stemcell_operating_system" => operating_system.name,
"stemcell_operating_system_version" => operating_system.version,
"stemcell_operating_system_variant" => operating_system.variant,
"stemcell_arch" => definition.architecture,
"ruby_bin" => ruby_bin,
"image_create_disk_size" => image_create_disk_size,
"os_image_tgz" => os_image_tgz_path
Expand Down
17 changes: 12 additions & 5 deletions bosh-stemcell/lib/bosh/stemcell/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@

module Bosh::Stemcell
class Definition
attr_reader :infrastructure, :hypervisor_name, :operating_system
DEFAULT_ARCHITECTURE = "amd64".freeze

def self.for(infrastructure_name, hypervisor_name, operating_system_name, operating_system_version)
attr_reader :infrastructure, :hypervisor_name, :operating_system, :architecture

def self.for(infrastructure_name, hypervisor_name, operating_system_name, operating_system_version, architecture = DEFAULT_ARCHITECTURE)
new(
Bosh::Stemcell::Infrastructure.for(infrastructure_name),
hypervisor_name,
Bosh::Stemcell::OperatingSystem.for(operating_system_name, operating_system_version)
Bosh::Stemcell::OperatingSystem.for(operating_system_name, operating_system_version),
architecture
)
end

def initialize(infrastructure, hypervisor_name, operating_system)
def initialize(infrastructure, hypervisor_name, operating_system, architecture = DEFAULT_ARCHITECTURE)
@infrastructure = infrastructure
@hypervisor_name = hypervisor_name
@operating_system = operating_system
@architecture = architecture || DEFAULT_ARCHITECTURE
end

def stemcell_name(disk_format)
Expand All @@ -28,6 +32,8 @@ def stemcell_name(disk_format)
stemcell_name_parts << operating_system.version if operating_system.version
stemcell_name_parts << operating_system.variant if operating_system.variant
stemcell_name_parts << disk_format unless disk_format == infrastructure.default_disk_format
# amd64 stemcell names carry no architecture suffix; other architectures do.
stemcell_name_parts << architecture unless architecture == DEFAULT_ARCHITECTURE

stemcell_name_parts.join("-")
end
Expand All @@ -38,7 +44,8 @@ def disk_formats

def ==(other)
infrastructure == other.infrastructure &&
operating_system == other.operating_system
operating_system == other.operating_system &&
architecture == other.architecture
end
end
end
15 changes: 15 additions & 0 deletions bosh-stemcell/lib/bosh/stemcell/infrastructure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ def additional_cloud_properties
{}
end

# Maps the BOSH/Debian architecture to the value recorded as
# cloud_properties.architecture in stemcell.MF, which CPIs consume unchanged.
# Raises for an unmapped architecture; override where a CPI expects another spelling.
def architecture_name(architecture)
{"amd64" => "x86_64", "arm64" => "aarch64"}.fetch(architecture) do
raise ArgumentError, "Unsupported stemcell architecture: #{architecture}"
end
end

def ==(other)
name == other.name &&
hypervisor == other.hypervisor &&
Expand Down Expand Up @@ -129,6 +138,12 @@ def additional_cloud_properties
"boot_mode" => "uefi-preferred"
}
end

# The AWS CPI passes the architecture to EC2 RegisterImage unchanged, which
# accepts "arm64" but not "aarch64".
def architecture_name(architecture)
(architecture == "arm64") ? "arm64" : super
end
end

class Alicloud < Base
Expand Down
2 changes: 1 addition & 1 deletion bosh-stemcell/lib/bosh/stemcell/stemcell_packager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def manifest(disk_format)
end

def manifest_cloud_properties(disk_format, infrastructure, stemcell_name)
architecture = "x86_64"
architecture = infrastructure.architecture_name(definition.architecture)

{
"name" => stemcell_name,
Expand Down
Loading
Loading