diff --git a/README.md b/README.md index 541dfbd54c..c3a385a246 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ bundle install 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` @@ -81,10 +81,10 @@ Rebuild the stemcell when you are making and testing BOSH-specific changes such export short_name="noble" 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. @@ -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: ```shell cd /opt/bosh/bosh-stemcell; \ diff --git a/Rakefile b/Rakefile index ac59a00fa2..287b1ae269 100644 --- a/Rakefile +++ b/Rakefile @@ -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| begin require 'bosh/stemcell/build_environment' require 'bosh/stemcell/definition' diff --git a/bosh-stemcell/image-metalinks/ubuntu_noble_poc/ubuntu-noble.meta4 b/bosh-stemcell/image-metalinks/ubuntu_noble_poc/ubuntu-noble.meta4 deleted file mode 100644 index 8db4724a1b..0000000000 --- a/bosh-stemcell/image-metalinks/ubuntu_noble_poc/ubuntu-noble.meta4 +++ /dev/null @@ -1,21 +0,0 @@ - - - 3696c6d14e8a9e5034266fa48e63e9fcf3f41d5fe171d89b33a1dec285d23dd50d88732c2b6e634f03a2763907bab308026fcfe4222512dedd20f40f7f995ba1 - b1d212d106171ca9e731d720b9f2a3c9949ad02efbeb35b1307072433c3a8551 - 0d491d6a64dd44cfe822e097bf152b8a56fc65a7 - b0058032614f6a828b3dca999ff06d85 - 450553899 - https://storage.googleapis.com/bosh-os-images/ubuntu_noble_poc/ubuntu-noble.tgz - 115.0.0 - - - cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - da39a3ee5e6b4b0d3255bfef95601890afd80709 - d41d8cd98f00b204e9800998ecf8427e - https://storage.googleapis.com/bosh-os-images/ubuntu_noble_poc/usn-log.json - 115.0.0 - - metalink-repository-resource/0.0.0 - 2024-10-31T16:04:24.1056664Z - diff --git a/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt b/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt index 562277d032..826f382eb1 100644 --- a/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt +++ b/bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt @@ -4,7 +4,6 @@ linux-cloud-tools-6.8 linux-cloud-tools-6.8-generic linux-cloud-tools-common linux-cloud-tools-generic -netplan-generator netplan.io python-is-python3 python3-attr @@ -12,7 +11,6 @@ python3-certifi python3-chardet python3-configobj python3-debconf -python3-netplan python3-idna python3-jinja2 python3-json-pointer diff --git a/ci/pipelines/builder.yml b/ci/pipelines/builder.yml index ca090a2a06..035cf1f9b4 100644 --- a/ci/pipelines/builder.yml +++ b/ci/pipelines/builder.yml @@ -492,7 +492,7 @@ jobs: params: files: - stemcell/*.tgz - rename: "{{.Version}}/(@= IAAS @)-(@= HYPERVISOR @)(@= FIPS @).meta4" + rename: "{{.Version}}/(@= IAAS @)-(@= HYPERVISOR @)(@= FIPS @)(@= data.values.stemcell_details.agent_suffix @).meta4" options: author_email: *ci_bot_email author_name: *ci_bot_name @@ -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 @) url_handlers: - include: - (s3|https)://.* @@ -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 diff --git a/ci/tasks/build-release-metadata.sh b/ci/tasks/build-release-metadata.sh index 5ef9a4049d..8311ec71e3 100755 --- a/ci/tasks/build-release-metadata.sh +++ b/ci/tasks/build-release-metadata.sh @@ -47,7 +47,7 @@ if [[ "${OS_NAME}" == "ubuntu" ]]; then # Ensure URL for usn-log from metalink exists before attempting to download. usn_log_json_file="${REPO_PARENT}/bosh-linux-stemcell-builder/usn-log.json" touch "${usn_log_json_file}" - usn_metalink_path="${REPO_PARENT}/bosh-linux-stemcell-builder/bosh-stemcell/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4" + usn_metalink_path="${REPO_PARENT}/bosh-linux-stemcell-builder/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4" if [[ -n "$(meta4 file-urls --metalink "${usn_metalink_path}" --file usn-log.json)" ]]; then meta4 file-download \ --skip-hash-verification \ diff --git a/ci/tasks/build.sh b/ci/tasks/build.sh index 0b169ee9bd..d69d2b5cdc 100755 --- a/ci/tasks/build.sh +++ b/ci/tasks/build.sh @@ -24,6 +24,8 @@ check_param HYPERVISOR check_param OS_NAME check_param OS_VERSION +OS_IMAGE="$(readlink -f "${REPO_PARENT}/os-image-tarball"/*.tgz)" + export CANDIDATE_BUILD_NUMBER=$( cat "${REPO_PARENT}/version/number" | sed 's/\.0$//;s/\.0$//' ) git clone "${REPO_PARENT}/stemcells-index" "${REPO_PARENT}/stemcells-index-output" @@ -73,26 +75,15 @@ done chown -R ubuntu:ubuntu "${REPO_ROOT}" # ci resource chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder" chown -R ubuntu:ubuntu /mnt - -OS_IMAGE="" -mkdir -p "${REPO_PARENT}/os-image-tarball" -if [[ -n "$(ls -A "${REPO_PARENT}/os-image-tarball/")" ]]; then - OS_IMAGE="$(readlink -f "${REPO_PARENT}/os-image-tarball"/*.tgz)" -fi - sudo chmod u+s "$(which sudo)" + sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i < + + 4d63eb6d8d7eba07628372c969bfdf3a778a66ef77e85616a84f900c603dc53c63c314bb2ded2e073f81e5243507fb3d58ad8f9d84fde0e16bc01f6d2221c616 + 8bf6a4b8a98d71b4c26f41ce4b8622c939de05d82dabdd0ea8e03d44de843db6 + d21ab0b19c1a3f52bb7e348b69b28663ee676503 + f0210c187eb07d66f8ea31f796a4aa76 + 434793371 + https://storage.googleapis.com/bosh-os-images/ubuntu-jammy/ubuntu-jammy.tgz + 1043.0.0 + + + ca3e99837fae81c10f5522a623fab715b1e430f7895b1f202bae32ccfe3a6f80ad79cffcbd789adcf099de7b00f7cc8c31ebbb3aeb5c0e13aa7decea88bc1559 + d12b345d3cf6c8127c05e8f702efd18966bf59378830efc14cef784a5248a88e + ade2522e3d639fff8df5117dea1870b605ed52a6 + 6c72c53f5bb8d8d05dd9b377f3beb937 + 869 + https://storage.googleapis.com/bosh-os-images/ubuntu-jammy/usn-log.json + 1043.0.0 + + metalink-repository-resource/0.0.0 + 2026-04-24T23:46:02.968990444Z + diff --git a/bosh-stemcell/image-metalinks/ubuntu-noble/ubuntu-noble.meta4 b/image-metalinks/ubuntu-noble/ubuntu-noble.meta4 similarity index 100% rename from bosh-stemcell/image-metalinks/ubuntu-noble/ubuntu-noble.meta4 rename to image-metalinks/ubuntu-noble/ubuntu-noble.meta4