Skip to content

Commit afcdaf5

Browse files
authored
Merge pull request #583 from cloudfoundry/merge-jammy
Merge jammy
2 parents 0e68b6f + cd4d01f commit afcdaf5

11 files changed

Lines changed: 49 additions & 107 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bundle install
3535
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
3636

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

4141
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
8181
export short_name="noble"
8282
export build_number="0.0.8"
8383

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

87-
The arguments to `stemcell:build_with_local_os_image` are:
87+
The arguments to `stemcell:build` are:
8888

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

144144
### How to Run Tests for Stemcell
145145

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

152152
```shell
153153
cd /opt/bosh/bosh-stemcell; \

Rakefile

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -42,58 +42,8 @@ namespace :stemcell do
4242
end
4343
end
4444

45-
desc 'Download a remote pre-built base OS image'
46-
task :download_os_image, [:operating_system_name, :operating_system_version] do |_, args|
47-
begin
48-
puts "Using OS image #{args.operating_system_name}-#{args.operating_system_version}"
49-
50-
mkdir_p('tmp')
51-
52-
metalink_path = File.join(
53-
Dir.pwd,
54-
'bosh-stemcell',
55-
'image-metalinks',
56-
"#{args.operating_system_name}-#{args.operating_system_version}.meta4"
57-
)
58-
59-
os_image_path = File.join(Dir.pwd, 'tmp', 'base_os_image.tgz')
60-
`meta4 file-download --file #{args.operating_system_name}-#{args.operating_system_version}.tgz --metalink #{metalink_path} #{os_image_path}`
61-
raise 'Failed to download metalink' if $?.exitstatus != 0
62-
63-
puts "Successfully downloaded OS image to #{os_image_path}"
64-
rescue RuntimeError => e
65-
print_help
66-
raise e
67-
end
68-
end
69-
70-
desc 'Build a stemcell with a remote pre-built base OS image'
71-
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :build_number] do |_, args|
72-
begin
73-
Rake::Task['stemcell:download_os_image'].invoke(
74-
args.operating_system_name,
75-
args.operating_system_version
76-
)
77-
78-
os_image_path = File.join(Dir.pwd, 'tmp', 'base_os_image.tgz')
79-
args.with_defaults(build_number: '0000')
80-
81-
Rake::Task['stemcell:build_with_local_os_image'].invoke(
82-
args.infrastructure_name,
83-
args.hypervisor_name,
84-
args.operating_system_name,
85-
args.operating_system_version,
86-
os_image_path,
87-
args.build_number
88-
)
89-
rescue RuntimeError => e
90-
print_help
91-
raise e
92-
end
93-
end
94-
95-
desc 'Build a stemcell using a local pre-built base OS image'
96-
task :build_with_local_os_image, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
45+
desc 'Build a stemcell, requires `os_image_path` pointing at an image created via `stemcell:build_os_image`'
46+
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
9747
begin
9848
require 'bosh/stemcell/build_environment'
9949
require 'bosh/stemcell/definition'

bosh-stemcell/image-metalinks/ubuntu_noble_poc/ubuntu-noble.meta4

Lines changed: 0 additions & 21 deletions
This file was deleted.

bosh-stemcell/spec/assets/dpkg-list-ubuntu-azure-additions.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ linux-cloud-tools-6.8
44
linux-cloud-tools-6.8-generic
55
linux-cloud-tools-common
66
linux-cloud-tools-generic
7-
netplan-generator
87
netplan.io
98
python-is-python3
109
python3-attr
1110
python3-certifi
1211
python3-chardet
1312
python3-configobj
1413
python3-debconf
15-
python3-netplan
1614
python3-idna
1715
python3-jinja2
1816
python3-json-pointer

ci/pipelines/builder.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ jobs:
492492
params:
493493
files:
494494
- stemcell/*.tgz
495-
rename: "{{.Version}}/(@= IAAS @)-(@= HYPERVISOR @)(@= FIPS @).meta4"
495+
rename: "{{.Version}}/(@= IAAS @)-(@= HYPERVISOR @)(@= FIPS @)(@= data.values.stemcell_details.agent_suffix @).meta4"
496496
options:
497497
author_email: *ci_bot_email
498498
author_name: *ci_bot_name
@@ -943,7 +943,7 @@ resources:
943943
private_key: ((github_deploy_key_bosh-linux-stemcell-builder.private_key))
944944
filters:
945945
- repositorypath: "(@= data.values.stemcell_details.branch @)/(@= data.values.stemcell_details.os_name @).meta4"
946-
uri: git+ssh://git@github.com/cloudfoundry/bosh-linux-stemcell-builder.git//bosh-stemcell/image-metalinks/#(@= data.values.stemcell_details.branch @)
946+
uri: git+ssh://git@github.com/cloudfoundry/bosh-linux-stemcell-builder.git//image-metalinks/#(@= data.values.stemcell_details.branch @)
947947
url_handlers:
948948
- include:
949949
- (s3|https)://.*
@@ -981,7 +981,7 @@ resources:
981981
branch: (@= data.values.stemcell_details.branch @)
982982
ignore_paths:
983983
- ci
984-
- bosh-stemcell/image-metalinks/
984+
- image-metalinks
985985
- VERSION
986986
uri: https://github.com/cloudfoundry/bosh-linux-stemcell-builder
987987

ci/tasks/build-release-metadata.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if [[ "${OS_NAME}" == "ubuntu" ]]; then
4747
# Ensure URL for usn-log from metalink exists before attempting to download.
4848
usn_log_json_file="${REPO_PARENT}/bosh-linux-stemcell-builder/usn-log.json"
4949
touch "${usn_log_json_file}"
50-
usn_metalink_path="${REPO_PARENT}/bosh-linux-stemcell-builder/bosh-stemcell/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4"
50+
usn_metalink_path="${REPO_PARENT}/bosh-linux-stemcell-builder/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4"
5151
if [[ -n "$(meta4 file-urls --metalink "${usn_metalink_path}" --file usn-log.json)" ]]; then
5252
meta4 file-download \
5353
--skip-hash-verification \

ci/tasks/build.sh

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ check_param HYPERVISOR
2424
check_param OS_NAME
2525
check_param OS_VERSION
2626

27+
OS_IMAGE="$(readlink -f "${REPO_PARENT}/os-image-tarball"/*.tgz)"
28+
2729
export CANDIDATE_BUILD_NUMBER=$( cat "${REPO_PARENT}/version/number" | sed 's/\.0$//;s/\.0$//' )
2830

2931
git clone "${REPO_PARENT}/stemcells-index" "${REPO_PARENT}/stemcells-index-output"
@@ -73,26 +75,15 @@ done
7375
chown -R ubuntu:ubuntu "${REPO_ROOT}" # ci resource
7476
chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder"
7577
chown -R ubuntu:ubuntu /mnt
76-
77-
OS_IMAGE=""
78-
mkdir -p "${REPO_PARENT}/os-image-tarball"
79-
if [[ -n "$(ls -A "${REPO_PARENT}/os-image-tarball/")" ]]; then
80-
OS_IMAGE="$(readlink -f "${REPO_PARENT}/os-image-tarball"/*.tgz)"
81-
fi
82-
8378
sudo chmod u+s "$(which sudo)"
79+
8480
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
8581
set -e
8682
8783
cd "${REPO_PARENT}/bosh-linux-stemcell-builder"
8884
bundle install
8985
90-
if [[ -z "${OS_IMAGE}" ]]; then
91-
bundle exec rake stemcell:build[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${CANDIDATE_BUILD_NUMBER}]
92-
rm -f ./tmp/base_os_image.tgz
93-
else
94-
bundle exec rake stemcell:build_with_local_os_image[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${OS_IMAGE},${CANDIDATE_BUILD_NUMBER}]
95-
fi
86+
bundle exec rake stemcell:build[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${OS_IMAGE},${CANDIDATE_BUILD_NUMBER}]
9687
SUDO
9788

9889
#

ci/tasks/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ inputs:
88
- name: version
99
- name: stemcells-index
1010
- name: os-image-tarball
11-
optional: true
1211

1312
outputs:
1413
- name: stemcell

ci/tasks/os-images/build.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,28 @@ function check_param() {
1818
exit 1
1919
fi
2020
}
21+
2122
check_param OPERATING_SYSTEM_NAME
2223
check_param OPERATING_SYSTEM_VERSION
2324

2425
OS_IMAGE_NAME=${OPERATING_SYSTEM_NAME}-${OPERATING_SYSTEM_VERSION}
2526
OS_IMAGE=${REPO_PARENT}/os-image/${OS_IMAGE_NAME}.tgz
27+
2628
if [ -f "${REPO_PARENT}/build-time/timestamp" ]; then
2729
build_time="$(cat "${REPO_PARENT}/build-time/timestamp")"
2830
export BUILD_TIME="$(date --date "${build_time%.*}" +%Y%m%dT%H%M%SZ)"
2931
fi
3032

31-
sudo chown -R ubuntu .
32-
sudo chown -R ubuntu:ubuntu /mnt
33+
chown -R ubuntu:ubuntu "${REPO_ROOT}" # ci resource
34+
chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder"
35+
chown -R ubuntu:ubuntu /mnt
3336
sudo chmod u+s "$(which sudo)"
3437

3538
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
3639
set -e
3740
38-
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder"
39-
bundle install
40-
bundle exec rake stemcell:build_os_image[$OPERATING_SYSTEM_NAME,$OPERATING_SYSTEM_VERSION,$OS_IMAGE]
41-
popd
41+
cd "${REPO_PARENT}/bosh-linux-stemcell-builder"
42+
bundle install
43+
44+
bundle exec rake stemcell:build_os_image[$OPERATING_SYSTEM_NAME,$OPERATING_SYSTEM_VERSION,$OS_IMAGE]
4245
SUDO
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
2+
<file name="ubuntu-jammy.tgz">
3+
<hash type="sha-512">4d63eb6d8d7eba07628372c969bfdf3a778a66ef77e85616a84f900c603dc53c63c314bb2ded2e073f81e5243507fb3d58ad8f9d84fde0e16bc01f6d2221c616</hash>
4+
<hash type="sha-256">8bf6a4b8a98d71b4c26f41ce4b8622c939de05d82dabdd0ea8e03d44de843db6</hash>
5+
<hash type="sha-1">d21ab0b19c1a3f52bb7e348b69b28663ee676503</hash>
6+
<hash type="md5">f0210c187eb07d66f8ea31f796a4aa76</hash>
7+
<size>434793371</size>
8+
<url>https://storage.googleapis.com/bosh-os-images/ubuntu-jammy/ubuntu-jammy.tgz</url>
9+
<version>1043.0.0</version>
10+
</file>
11+
<file name="usn-log.json">
12+
<hash type="sha-512">ca3e99837fae81c10f5522a623fab715b1e430f7895b1f202bae32ccfe3a6f80ad79cffcbd789adcf099de7b00f7cc8c31ebbb3aeb5c0e13aa7decea88bc1559</hash>
13+
<hash type="sha-256">d12b345d3cf6c8127c05e8f702efd18966bf59378830efc14cef784a5248a88e</hash>
14+
<hash type="sha-1">ade2522e3d639fff8df5117dea1870b605ed52a6</hash>
15+
<hash type="md5">6c72c53f5bb8d8d05dd9b377f3beb937</hash>
16+
<size>869</size>
17+
<url>https://storage.googleapis.com/bosh-os-images/ubuntu-jammy/usn-log.json</url>
18+
<version>1043.0.0</version>
19+
</file>
20+
<generator>metalink-repository-resource/0.0.0</generator>
21+
<published>2026-04-24T23:46:02.968990444Z</published>
22+
</metalink>

0 commit comments

Comments
 (0)