Skip to content

Commit a3938ae

Browse files
authored
Merge branch 'ubuntu-resolute' into noble-to-resolute
2 parents 233b811 + a08221a commit a3938ae

57 files changed

Lines changed: 836 additions & 342 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ acceptance-tests/syslog-release
1313
acceptance-tests/os-conf-release
1414

1515
ci/docker/os-image-stemcell-builder/VMware-ovftool-*.bundle
16+
ci/docker/VMware-ovftool-*.bundle
17+
ci/docker/*/VMware-ovftool-*.bundle
1618

17-
tmp/
19+
tmp/

README.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,56 @@
33
This repo contains tools for creating BOSH stemcells. A stemcell is a bootable
44
disk image that is used as a template by a BOSH Director to create VMs.
55

6+
This branch builds stemcells for **Ubuntu 26.04 LTS (Resolute)**. For other
7+
Ubuntu releases, switch to the appropriate branch (for example `ubuntu-noble`
8+
for 24.04).
9+
610
## Quick Start: Building a Stemcell Locally
711

812
```bash
9-
export short_name="noble"
13+
export short_name="resolute"
1014

1115
git clone git@github.com:cloudfoundry/bosh-linux-stemcell-builder.git
1216
cd bosh-linux-stemcell-builder
1317
git checkout ubuntu-${short_name}
1418
mkdir -p tmp
1519
docker build \
1620
--platform linux/amd64 \
17-
--build-arg SYFT_VERSION=v1.42.3 \
21+
--build-arg BASE_IMAGE="ubuntu:${short_name}" \
22+
--build-arg META4_CLI_URL="https://github.com/dpb587/metalink/releases/download/v0.5.0/meta4-0.5.0-linux-amd64" \
23+
--build-arg SYFT_CLI_URL="https://github.com/anchore/syft/releases/download/v1.42.3/syft_1.42.3_linux_amd64.tar.gz" \
24+
--build-arg YQ_CLI_URL="https://github.com/mikefarah/yq/releases/download/v4.52.5/yq_linux_amd64" \
25+
--build-arg RUBY_INSTALL_URL="https://github.com/postmodern/ruby-install/releases/download/v0.10.2/ruby-install-0.10.2.tar.gz" \
26+
--build-arg RUBY_VERSION="$(cat .ruby-version)" \
27+
--build-arg GEM_HOME="/usr/local/bundle" \
28+
--build-arg OVF_TOOL_INSTALLER="VMware-ovftool-4.4.3-18663434-lin.x86_64.bundle" \
29+
--build-arg OVF_TOOL_INSTALLER_SHA1="6c24e473be49c961cfc3bb16774b52b48e822991" \
1830
-t bosh/os-image-stemcell-builder:${short_name} \
1931
ci/docker/os-image-stemcell-builder/
2032
docker run \
2133
--platform linux/amd64 \
2234
--privileged \
2335
-v "$(pwd):/opt/bosh" \
2436
--workdir /opt/bosh \
25-
--user=1000:1000 \
37+
--user="$(id -u):$(id -g)" \
2638
-it \
2739
bosh/os-image-stemcell-builder:${short_name}
2840

2941
# You're now in the Docker container
42+
export short_name="resolute"
43+
3044
ulimit -n 16384 # only necessary if your host is Fedora
3145
gem install bundler
3246
bundle install
3347

3448
# build OS image
35-
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
49+
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image_${short_name}.tgz]
3650

3751
# build vSphere stemcell
38-
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
52+
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image_${short_name}.tgz,9.000]
53+
54+
# build warden (BOSH Lite) stemcell
55+
bundle exec rake stemcell:build[warden,warden,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image_${short_name}.tgz,9.000]
3956
```
4057

4158
When building a vSphere stemcell, you must download `VMware-ovftool-*.bundle`
@@ -56,7 +73,7 @@ installed in the operating system or when making changes to the configuration
5673
of those packages.
5774

5875
```bash
59-
export short_name="noble"
76+
export short_name="resolute"
6077

6178
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
6279
```
@@ -78,7 +95,7 @@ The arguments to the `stemcell:build_os_image` rake task follow:
7895
Rebuild the stemcell when you are making and testing BOSH-specific changes such as a new BOSH agent.
7996

8097
```bash
81-
export short_name="noble"
98+
export short_name="resolute"
8299
export build_number="0.0.8"
83100

84101
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz,${build_number}]
@@ -95,6 +112,7 @@ The arguments to `stemcell:build` are:
95112
- `google``kvm`
96113
- `openstack``kvm`
97114
- `vsphere``esxi`
115+
- `warden``warden`
98116
3. `operating_system_name` (`ubuntu`): Type of OS. Same as
99117
`stemcell:build_os_image`.
100118
4. `operating_system_version` (`<short_name>`): OS release. Same as
@@ -114,7 +132,7 @@ the stemcell would be at
114132
upload the stemcell to a vSphere BOSH Director:
115133

116134
```bash
117-
export short_name="noble"
135+
export short_name="resolute"
118136

119137
bosh upload-stemcell tmp/bosh-stemcell-0.0.8-vsphere-esxi-ubuntu-${short_name}-go_agent.tgz
120138
```
@@ -135,7 +153,6 @@ the OS image** at the `tmp/ubuntu_base_image.tgz` and you're within the Docker
135153
container):
136154

137155
```shell
138-
export short_name="noble"
139156
cd /opt/bosh/bosh-stemcell
140157
bundle install
141158
OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rspec -fd spec/os_image/ubuntu_spec.rb
@@ -208,7 +225,7 @@ If you find yourself debugging any of the above processes, here is what you need
208225
Example usage:
209226

210227
```shell
211-
export short_name="noble"
228+
export short_name="resolute"
212229

213230
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz] resume_from=rsyslog_config
214231
```
@@ -219,8 +236,8 @@ If you find yourself debugging any of the above processes, here is what you need
219236
modifications you can rerun the tests (without rebuilding OS image). Details
220237
in section `How to run tests for OS Images`
221238
* If the Stemcell has been built, and you are only updating tests, you do not
222-
need to re-build the stemcell. You can simply rerun the tests - without
223-
rebuilding Stemcell. Details in section `How to run tests for Stemcell`
239+
need to re-build the stemcell. You can simply rerun the tests (without
240+
rebuilding Stemcell). Details in section `How to run tests for Stemcell`
224241
* It's possible to verify OS/Stemcell changes without making a deployment using
225242
the stemcell. For a vSphere-specific Ubuntu stemcell, the filesystem is
226243
available at `/mnt/stemcells/vsphere/esxi/ubuntu/work/work/chroot`
@@ -249,7 +266,7 @@ You will need the ovftool installer present in
249266
Rebuild the container with:
250267

251268
```shell
252-
export short_name="noble"
269+
export short_name="resolute"
253270

254271
docker build \
255272
--platform linux/amd64 \
@@ -280,7 +297,7 @@ gsutil cp MY_OVFTOOL_FILE gs://bosh-vmware-ovftool/MY_OS/
280297
Example:
281298

282299
```shell
283-
export short_name="noble"
300+
export short_name="resolute"
284301

285302
gsutil cp VMware-ovftool-4.4.3-18663434-lin.x86_64.bundle gs://bosh-vmware-ovftool/${short_name}/
286303
```
@@ -387,4 +404,3 @@ When switching from the old pipeline to the new one, don't forget to:
387404
whatever the public bucket should be
388405
* update the tasks YAML to point to tasks in the `os-images` directory
389406
* rename this directory from `new`
390-

Rakefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ namespace :stemcell do
1111
require "bosh/stemcell/stage_collection"
1212
require "bosh/stemcell/stage_runner"
1313

14+
os_image_path = File.expand_path(args.os_image_path)
15+
if args.operating_system_version.to_s.strip.empty?
16+
raise "stemcell:build_os_image: operating_system_version (2nd argument) is empty. " \
17+
"Set it to the Ubuntu release codename (for example export short_name=resolute per README), " \
18+
"or pass it literally: rake stemcell:build_os_image[ubuntu,resolute,tmp/os.tgz]"
19+
end
1420
definition = Bosh::Stemcell::Definition.for("null", "null", args.operating_system_name, args.operating_system_version)
1521
environment = Bosh::Stemcell::BuildEnvironment.new(
1622
ENV.to_hash,
1723
definition,
1824
"",
19-
args.os_image_path
25+
os_image_path
2026
)
2127
collection = Bosh::Stemcell::StageCollection.new(definition)
2228
runner = Bosh::Stemcell::StageRunner.new(
@@ -33,7 +39,7 @@ namespace :stemcell do
3339
runner: runner,
3440
archive_handler: archive_handler
3541
)
36-
builder.build(args.os_image_path)
42+
builder.build(os_image_path)
3743

3844
sh(environment.os_image_rspec_command)
3945
rescue RuntimeError => e
@@ -52,12 +58,13 @@ namespace :stemcell do
5258

5359
args.with_defaults(build_number: "0000")
5460

61+
os_image_path = File.expand_path(args.os_image_path)
5562
definition = Bosh::Stemcell::Definition.for(args.infrastructure_name, args.hypervisor_name, args.operating_system_name, args.operating_system_version)
5663
environment = Bosh::Stemcell::BuildEnvironment.new(
5764
ENV.to_hash,
5865
definition,
5966
args.build_number,
60-
args.os_image_path
67+
os_image_path
6168
)
6269

6370
sh(environment.os_image_rspec_command)

acceptance-tests/ipv4director/auditd/smoke_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var _ = Describe("Auditd", func() {
6060
Expect(err).ToNot(HaveOccurred())
6161
Expect(exitStatus).To(Equal(0))
6262

63-
auditLoginRegexp := `.*type=USER_LOGIN.*exe="/usr/sbin/sshd".*res=success`
63+
auditLoginRegexp := `.*type=USER_LOGIN.*exe="/usr/lib/openssh/sshd-session".*res=success`
6464
Expect(output).To(MatchRegexp(auditLoginRegexp))
6565
})
6666
})
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
2+
<file name="ubuntu-resolute.tgz">
3+
<hash type="sha-512">placeholder-update-when-resolute-os-image-is-published</hash>
4+
<hash type="sha-256">placeholder</hash>
5+
<hash type="sha-1">placeholder</hash>
6+
<size>0</size>
7+
<url>https://storage.googleapis.com/bosh-os-images/ubuntu-resolute/ubuntu-resolute.tgz</url>
8+
<version>0.0.0</version>
9+
</file>
10+
<file name="usn-log.json">
11+
<hash type="sha-512">placeholder</hash>
12+
<hash type="sha-256">placeholder</hash>
13+
<size>1</size>
14+
<url>https://storage.googleapis.com/bosh-os-images/ubuntu-resolute/usn-log.json</url>
15+
<version>0.0.0</version>
16+
</file>
17+
<generator>metalink-repository-resource/0.0.0</generator>
18+
<published>1970-01-01T00:00:00Z</published>
19+
</metalink>

bosh-stemcell/lib/bosh/stemcell/stage_collection.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def google_stages
198198
end
199199

200200
def warden_stages
201-
[
201+
stages = [
202202
:system_parameters,
203203
:base_warden,
204204
:bosh_clean,
@@ -211,6 +211,8 @@ def warden_stages
211211
:image_install_grub,
212212
:sbom_create
213213
]
214+
stages.insert(2, :base_ubuntu_warden_rosetta) if operating_system.variant == "rosetta"
215+
stages
214216
end
215217

216218
def azure_stages

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
azure-vm-utils
22
cloud-init
3-
linux-cloud-tools-6.8
4-
linux-cloud-tools-6.8-generic
3+
cloud-init-base
4+
libjs-sphinxdoc
5+
linux-cloud-tools-7.0
6+
linux-cloud-tools-7.0-generic
57
linux-cloud-tools-common
68
linux-cloud-tools-generic
79
netplan.io
@@ -16,10 +18,12 @@ python3-jinja2
1618
python3-json-pointer
1719
python3-jsonpatch
1820
python3-jsonschema
21+
python3-jsonschema-specifications
1922
python3-markupsafe
23+
python3-passlib
2024
python3-pyasn1
21-
python3-pyrsistent:amd64
25+
python3-referencing
2226
python3-requests
27+
python3-rpds-py
2328
python3-serial
24-
python3-setuptools
2529
python3-urllib3
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
linux-generic
2-
linux-headers-6.8
3-
linux-headers-6.8-generic
2+
linux-headers-7.0
3+
linux-headers-7.0-generic
44
linux-headers-generic
5-
linux-image-6.8-generic
5+
linux-image-7.0-generic
66
linux-image-generic
7-
linux-modules-6.8-generic
8-
linux-modules-extra-6.8-generic
7+
linux-main-modules-zfs-7.0-generic
8+
linux-modules-7.0-generic

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ libdrm-common
22
libdrm2:amd64
33
libmspack0t64:amd64
44
libpci3:amd64
5-
libxmlsec1t64:amd64
6-
libxmlsec1t64-openssl:amd64
5+
libxmlsec1-1:amd64
6+
libxmlsec1-openssl1:amd64
77
open-vm-tools
88
pciutils
99
pci.ids

0 commit comments

Comments
 (0)