Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ popd
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]

# build vSphere stemcell
bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
```

When building a vSphere stemcell, you must download `VMware-ovftool-*.bundle`
Expand Down Expand Up @@ -81,10 +81,10 @@ Rebuild the stemcell when you are making and testing BOSH-specific changes such
export short_name="jammy"
export build_number="0.0.8"

bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz,${build_number}]
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz,${build_number}]
```

The arguments to `stemcell:build_with_local_os_image` are:
The arguments to `stemcell:build` are:

1. `infrastructure_name`: Which IaaS you are producing the stemcell for.
Determines which virtualization tools to package on top of the stemcell.
Expand Down Expand Up @@ -143,11 +143,11 @@ container):

### How to Run Tests for Stemcell

When you run the `stemcell:build_with_local_os_image` or `stemcell:build` rake
task, it will create a stemcell that it runs the stemcell specific tests
against. You will need to run the **rake task the first time you create your
docker container**, but everytime after, as long as you do not destroy the
container, you should be able to run the specific tests:
When you run the `stemcell:build` rake task, it will create a stemcell that it
runs the stemcell-specific tests against. You will need to run the **rake task
the first time you create your docker container**, but every time after, as
long as you do not destroy the container, you should be able to run the
specific tests:
Comment on lines +148 to +150
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar: “everytime” should be “every time”.

Copilot uses AI. Check for mistakes.

```shell
cd /opt/bosh/bosh-stemcell; \
Expand Down
54 changes: 2 additions & 52 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,58 +42,8 @@ namespace :stemcell do
end
end

desc 'Download a remote pre-built base OS image'
task :download_os_image, [:operating_system_name, :operating_system_version] do |_, args|
begin
puts "Using OS image #{args.operating_system_name}-#{args.operating_system_version}"

mkdir_p('tmp')

metalink_path = File.join(
Dir.pwd,
'bosh-stemcell',
'image-metalinks',
"#{args.operating_system_name}-#{args.operating_system_version}.meta4"
)

os_image_path = File.join(Dir.pwd, 'tmp', 'base_os_image.tgz')
`meta4 file-download --file #{args.operating_system_name}-#{args.operating_system_version}.tgz --metalink #{metalink_path} #{os_image_path}`
raise 'Failed to download metalink' if $?.exitstatus != 0

puts "Successfully downloaded OS image to #{os_image_path}"
rescue RuntimeError => e
print_help
raise e
end
end

desc 'Build a stemcell with a remote pre-built base OS image'
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :build_number] do |_, args|
begin
Rake::Task['stemcell:download_os_image'].invoke(
args.operating_system_name,
args.operating_system_version
)

os_image_path = File.join(Dir.pwd, 'tmp', 'base_os_image.tgz')
args.with_defaults(build_number: '0000')

Rake::Task['stemcell:build_with_local_os_image'].invoke(
args.infrastructure_name,
args.hypervisor_name,
args.operating_system_name,
args.operating_system_version,
os_image_path,
args.build_number
)
rescue RuntimeError => e
print_help
raise e
end
end

desc 'Build a stemcell using a local pre-built base OS image'
task :build_with_local_os_image, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
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|
Comment on lines +45 to +46
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stemcell:build now requires os_image_path, but the task doesn’t validate that this argument is present and points to an existing file. Adding an explicit check (and a clear error message) would make failures much easier to diagnose (especially in CI where a missing/empty os-image-tarball input would otherwise surface as less obvious downstream errors).

Copilot uses AI. Check for mistakes.
begin
require 'bosh/stemcell/build_environment'
require 'bosh/stemcell/definition'
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions bosh-stemcell/image-metalinks/ubuntu-bionic.meta4

This file was deleted.

22 changes: 0 additions & 22 deletions bosh-stemcell/image-metalinks/ubuntu-jammy.meta4

This file was deleted.

22 changes: 0 additions & 22 deletions bosh-stemcell/image-metalinks/ubuntu-xenial.meta4

This file was deleted.

22 changes: 0 additions & 22 deletions bosh-stemcell/image-metalinks/v1.0.0.meta4

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions ci/pipelines/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ resources:
private_key: ((github_deploy_key_bosh-linux-stemcell-builder.private_key))
filters:
- repositorypath: "(@= data.values.stemcell_details.branch @)/(@= data.values.stemcell_details.os_name @).meta4"
uri: git+ssh://git@github.com/cloudfoundry/bosh-linux-stemcell-builder.git//bosh-stemcell/image-metalinks/#(@= data.values.stemcell_details.branch @)
uri: git+ssh://git@github.com/cloudfoundry/bosh-linux-stemcell-builder.git//image-metalinks/#(@= data.values.stemcell_details.branch @)
Comment thread
selzoc marked this conversation as resolved.
url_handlers:
- include:
- (s3|https)://.*
Expand Down Expand Up @@ -981,7 +981,7 @@ resources:
branch: (@= data.values.stemcell_details.branch @)
ignore_paths:
- ci
- bosh-stemcell/image-metalinks/
- image-metalinks
- VERSION
uri: https://github.com/cloudfoundry/bosh-linux-stemcell-builder

Expand Down
Loading
Loading