-
Notifications
You must be signed in to change notification settings - Fork 112
Inital Resolute Raccoon stemcell changes #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mkocher
wants to merge
1
commit into
ubuntu-noble
Choose a base branch
from
feat/mk/ubuntu-resolute
base: ubuntu-noble
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,3 +14,5 @@ acceptance-tests/os-conf-release | |
|
|
||
| ci/docker/VMware-ovftool-*.bundle | ||
| ci/docker/*/VMware-ovftool-*.bundle | ||
|
|
||
| tmp/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,60 +3,64 @@ | |
| This repo contains tools for creating BOSH stemcells. A stemcell is a bootable | ||
| disk image that is used as a template by a BOSH Director to create VMs. | ||
|
|
||
| This branch (`ubuntu-resolute`) builds stemcells for **Ubuntu 26.04 LTS (Resolute)**. | ||
| For other Ubuntu releases, switch to the appropriate branch (e.g. `ubuntu-noble` | ||
| for 24.04). | ||
|
|
||
| ## Quick Start: Building a Stemcell Locally | ||
|
|
||
| ```bash | ||
| git clone git@github.com:cloudfoundry/bosh-linux-stemcell-builder.git | ||
| cd bosh-linux-stemcell-builder | ||
| git checkout ubuntu-noble/master | ||
| git checkout ubuntu-resolute/1.x | ||
| mkdir -p tmp | ||
| docker build -t bosh/os-image-stemcell-builder:noble \ | ||
| ci/docker/os-image-stemcell-builder-noble/ | ||
| docker build -t bosh/os-image-stemcell-builder:resolute \ | ||
| ci/docker/os-image-stemcell-builder-resolute/ | ||
| docker run \ | ||
| --privileged \ | ||
| -v "$(pwd):/opt/bosh" \ | ||
| --workdir /opt/bosh \ | ||
| --user=1000:1000 \ | ||
| -it \ | ||
| bosh/os-image-stemcell-builder:noble | ||
| bosh/os-image-stemcell-builder:resolute | ||
| # You're now in the the Docker container | ||
| ulimit -n 16384 # only necessary if your host is Fedora | ||
| gem install bundler | ||
| bundle | ||
| # build OS image | ||
| bundle exec rake stemcell:build_os_image[ubuntu,noble,$PWD/tmp/ubuntu_base_image.tgz] # build OS image | ||
| bundle exec rake stemcell:build_os_image[ubuntu,resolute,$PWD/tmp/ubuntu_base_image.tgz] | ||
| # build vSphere stemcell | ||
| bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,noble,$PWD/tmp/ubuntu_base_image.tgz] | ||
| bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,resolute,$PWD/tmp/ubuntu_base_image.tgz] | ||
| ``` | ||
|
|
||
| When building a vSphere stemcell, you must download `VMware-ovftool-*.bundle` | ||
| and place it in the `ci/docker/os-image-stemcell-builder-noble/` directory. See | ||
| and place it in the `ci/docker/os-image-stemcell-builder-resolute/` directory. See | ||
| [External Assets](#external-assets) for download instructions. | ||
|
|
||
| ### OS image | ||
|
|
||
| An OS image is a tarball that contains a snapshot of an OS filesystem, | ||
| including the libraries and system utilities needed by the BOSH agent; however, | ||
| it does not contain the BOSH agent nor the virtualization tools: [a subsequent | ||
| Rake task](#with-local-os-image) adds the BOSH agent and a set of | ||
| Rake task](#building-a-stemcell) adds the BOSH agent and a set of | ||
| virtualization tools to the base OS image to produce a stemcell. | ||
|
|
||
| The OS Image should be rebuilt when you are making changes to the packages | ||
| installed in the operating system or when making changes to the configuration | ||
| of those packages. | ||
|
|
||
| ```bash | ||
| bundle exec rake stemcell:build_os_image[ubuntu,noble,$PWD/tmp/ubuntu_base_image.tgz] | ||
| bundle exec rake stemcell:build_os_image[ubuntu,resolute,$PWD/tmp/ubuntu_base_image.tgz] | ||
| ``` | ||
|
|
||
| The arguments to the `stemcell:build_os_image` rake task follow: | ||
|
|
||
| 0. *`operating_system_name`* (`ubuntu`): identifies which type of OS to fetch. | ||
| Determines which package repository and packaging tool will be used to | ||
| download and assemble the files. Currently, only `ubuntu` is recognized. | ||
| 0. *`operating_system_version`* (`noble`): an identifier that the system may use | ||
| to decide which release of the OS to download. Acceptable values depend on | ||
| the operating system. For `ubuntu`, use `noble`. | ||
| 0. *`operating_system_version`* (`resolute`): an identifier that the system | ||
| uses to decide which release of the OS to download. For this branch, use | ||
| `resolute` (Ubuntu 26.04 LTS). | ||
| 0. *`os_image_path`* (`$PWD/tmp/ubuntu_base_image.tgz`): the path to write the | ||
| finished OS image tarball to. If a file exists at this path already, it will | ||
| be overwritten without warning. | ||
|
|
@@ -67,7 +71,7 @@ Rebuild the stemcell when you are making and testing BOSH-specific | |
| changes such as a new BOSH agent. | ||
|
|
||
| ```bash | ||
| bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,noble,$PWD/tmp/ubuntu_base_image.tgz,"0.0.8"] | ||
| bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,resolute,$PWD/tmp/ubuntu_base_image.tgz,"0.0.8"] | ||
| ``` | ||
|
|
||
| The arguments to `stemcell:build_with_local_os_image` are: | ||
|
|
@@ -76,10 +80,11 @@ The arguments to `stemcell:build_with_local_os_image` are: | |
| Determines which virtualization tools to package on top of the stemcell. | ||
| 0. `hypervisor_name`: Depending on what the IAAS supports, which hypervisor to | ||
| target: `aws` → `xen-hvm`, `azure` → `hyperv`, `google` → `kvm`, `openstack` → | ||
| `kvm`, `vsphere` → `esxi` | ||
| `kvm`, `vsphere` → `esxi`, `warden` → `warden` | ||
| 0. `operating_system_name` (`ubuntu`): Type of OS. Same as | ||
| 0. `stemcell:build_os_image`. Can optionally include a variant suffix (`noble-fips`) | ||
| 0. `operating_system_version` (`noble`): OS release. Same as | ||
| `stemcell:build_os_image`. Can optionally include a variant suffix (e.g. `resolute-fips`) | ||
| 0. `operating_system_version` (`resolute`): OS release. Same as | ||
| `stemcell:build_os_image`. | ||
| 0. `os_image_path` (`$PWD/tmp/ubuntu_base_image.tgz`): Path to base OS image | ||
| produced in `stemcell:build_os_image` | ||
| 0. `build_number` (`0.0.8`): Stemcell version. Pro-tip: take the version number | ||
|
|
@@ -91,17 +96,15 @@ The arguments to `stemcell:build_with_local_os_image` are: | |
| You can find the resulting stemcell in the `tmp/` directory of the host, or in | ||
| the `/opt/bosh/tmp` directory in the Docker container. Using the above example, | ||
| the stemcell would be at | ||
| `tmp/bosh-stemcell-0.0.8-vsphere-esxi-ubuntu-noble-go_agent.tgz`. You can | ||
| upload the stemcell to a vSphere BOSH Director: | ||
| `tmp/bosh-stemcell-0.0.8-vsphere-esxi-ubuntu-resolute-go_agent.tgz`. You can | ||
| upload the stemcell to a BOSH Director: | ||
|
|
||
| ```bash | ||
| bosh upload-stemcell tmp/bosh-stemcell-0.0.8-vsphere-esxi-ubuntu-noble-go_agent.tgz | ||
| bosh upload-stemcell tmp/bosh-stemcell-0.0.8-vsphere-esxi-ubuntu-resolute-go_agent.tgz | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| _[Fixme: update Testing section to noble]_ | ||
|
|
||
| ### How to run tests for OS Images | ||
|
|
||
| The OS tests are meant to be run against the OS environment to which they | ||
|
|
@@ -111,12 +114,12 @@ 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. | ||
|
|
||
| To run the `ubuntu_noble_spec.rb` tests (**assuming you've already built the OS | ||
| To run the OS image tests (**assuming you've already built the OS | ||
| image** at the `tmp/ubuntu_base_image.tgz` and you're within the Docker | ||
| container): | ||
|
|
||
| cd /opt/bosh/bosh-stemcell | ||
| OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rspec -fd spec/os_image/ubuntu_noble_spec.rb | ||
| OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rspec -fd spec/os_image/ubuntu_spec.rb | ||
|
|
||
| ### How to Run Tests for Stemcell | ||
|
|
||
|
|
@@ -163,7 +166,7 @@ OSX=true OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rspec spec/ -- | |
|
|
||
| ### How to run tests for BOSH Linux Stemcell Builder | ||
|
|
||
| The BOSH Linux Stemcell Builder code itself can be tested with the following command's: | ||
| The BOSH Linux Stemcell Builder code itself can be tested with the following commands: | ||
|
|
||
| ```shell | ||
| bundle install --local | ||
|
|
@@ -189,7 +192,7 @@ If you find yourself debugging any of the above processes, here is what you need | |
| Example usage: | ||
|
|
||
| ```shell | ||
| bundle exec rake stemcell:build_os_image[ubuntu,noble,$PWD/tmp/ubuntu_base_image.tgz] resume_from=rsyslog_config | ||
| bundle exec rake stemcell:build_os_image[ubuntu,resolute,$PWD/tmp/ubuntu_base_image.tgz] resume_from=rsyslog_config | ||
| ``` | ||
|
|
||
| ## Pro Tips | ||
|
|
@@ -199,32 +202,35 @@ If you find yourself debugging any of the above processes, here is what you need | |
| in section `How to run tests for OS Images` | ||
| * If the Stemcell has been built and you are only updating tests, you do not | ||
| need to re-build the stemcell. You can simply rerun the tests (without | ||
| rebuilding Stemcell. Details in section `How to run tests for Stemcell` | ||
| rebuilding Stemcell). Details in section `How to run tests for Stemcell` | ||
| * It's possible to verify OS/Stemcell changes without making a deployment using | ||
| the stemcell. For a vSphere-specific Ubuntu stemcell, the filesytem is | ||
| the stemcell. For a vSphere-specific Ubuntu stemcell, the filesystem is | ||
| available at `/mnt/stemcells/vsphere/esxi/ubuntu/work/work/chroot` | ||
|
|
||
| ## External Assets | ||
|
|
||
| The ovftool installer from VMWare can be found at | ||
| [my.vmware.com](https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL410&productId=489). | ||
|
|
||
| The ovftool installer must be copied into the [ci/docker/os-image-stemcell-builder-noble](https://github.com/cloudfoundry/bosh-linux-stemcell-builder/tree/master/ci/docker/os-image-stemcell-builder) next to the Dockerfile or you will receive the error | ||
| The OVF Tool is only required for building **vSphere** stemcells. Download | ||
| "OVF Tool for Linux Zip" from | ||
| [Broadcom's developer portal](https://developer.broadcom.com/tools/open-virtualization-format-ovf-tool/latest). | ||
|
|
||
| Step 24/30 : ADD ${OVF_TOOL_INSTALLER} /tmp/ovftool_installer.bundle | ||
| ADD failed: stat /var/lib/docker/tmp/docker-builder389354746/VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle: no such file or directory | ||
|
|
||
| ## Rebuilding the Docker Image | ||
| Extract the zip and place the resulting `ovftool/` directory inside the Docker | ||
| build context so that the Dockerfile's `COPY ovftool/ /usr/lib/vmware-ovftool/` | ||
| can find it: | ||
|
|
||
| The Docker image is published to | ||
| [`bosh/os-image-stemcell-builder`](https://hub.docker.com/r/bosh/os-image-stemcell-builder/). | ||
| You will need the ovftool installer present on your filesystem. | ||
| ```bash | ||
| cd ci/docker/os-image-stemcell-builder-resolute/ | ||
| unzip ~/Downloads/VMware-ovftool-*.zip # creates ovftool/ in the current directory | ||
| ``` | ||
|
|
||
| Rebuild the container with the `build` script... | ||
| The `ovftool/` directory is already in `.gitignore` and will not be committed. | ||
|
|
||
| ./build os-image-stemcell-builder | ||
| ## Rebuilding the Docker Image | ||
|
|
||
| When ready, `push` to DockerHub and use the credentials from LastPass... | ||
| You will need the `ovftool/` directory present in | ||
| `ci/docker/os-image-stemcell-builder-resolute/` (see [External Assets](#external-assets) | ||
| above). Then build the image: | ||
|
|
||
| cd os-image-stemcell-builder | ||
| ./push | ||
| ```bash | ||
| docker build -t bosh/os-image-stemcell-builder:resolute \ | ||
| ci/docker/os-image-stemcell-builder-resolute/ | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <metalink xmlns="urn:ietf:params:xml:ns:metalink"> | ||
| <file name="ubuntu-resolute.tgz"> | ||
| <hash type="sha-512">placeholder-update-when-resolute-os-image-is-published</hash> | ||
| <hash type="sha-256">placeholder</hash> | ||
| <hash type="sha-1">placeholder</hash> | ||
| <size>0</size> | ||
| <url>https://storage.googleapis.com/bosh-os-images/ubuntu-resolute/ubuntu-resolute.tgz</url> | ||
| <version>0.0.0</version> | ||
| </file> | ||
| <file name="usn-log.json"> | ||
| <hash type="sha-512">placeholder</hash> | ||
| <hash type="sha-256">placeholder</hash> | ||
| <size>1</size> | ||
| <url>https://storage.googleapis.com/bosh-os-images/ubuntu-resolute/usn-log.json</url> | ||
| <version>0.0.0</version> | ||
| </file> | ||
| <generator>metalink-repository-resource/0.0.0</generator> | ||
| <published>1970-01-01T00:00:00Z</published> | ||
| </metalink> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| linux-generic | ||
| linux-headers-6.8 | ||
| linux-headers-6.8-generic | ||
| linux-headers-7.0 | ||
| linux-headers-7.0-generic | ||
| linux-headers-generic | ||
| linux-image-6.8-generic | ||
| linux-image-7.0-generic | ||
| linux-image-generic | ||
| linux-modules-6.8-generic | ||
| linux-modules-extra-6.8-generic | ||
| linux-main-modules-zfs-7.0-generic | ||
| linux-modules-7.0-generic |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think the branch here should be
ubuntu-resoluteNit: Consider using
git switch <branch>