Skip to content
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

Firmware download improvement #1616

Merged
merged 5 commits into from
May 24, 2024
Merged

Firmware download improvement #1616

merged 5 commits into from
May 24, 2024

Conversation

bsatzger
Copy link
Contributor

@bsatzger bsatzger commented May 18, 2024

With this PR, we add the ability to download firmware from https://github.com/ubicloud/build-edk2-firmware and store it on the host in /opt/fw as files named 'CLOUDHV-version.fd'. New hosts will start to download the firmware (in addition to legacy firmware) during prep_host. The PR also adds capabilities to download specified versions to hosts on demand. With this, new firmware versions can be deployed to and enabled for all hosts by performing these steps:

  1. Execute new method download_firmware on each host to download the new version
  2. Update the version in rhizome/host/lib/cloud_hypervisor.rb to the new version

In order to switch from legacy to new firmware, instead of step 2, we need to rename FIRMWARE to FIRMWARE_LEGACY and NEW_FIRMWARE to FIRMWARE, to enable the new firmware for VMs.

@bsatzger bsatzger requested review from fdr and a team May 18, 2024 17:48
model/vm_host.rb Outdated Show resolved Hide resolved
@fdr
Copy link
Collaborator

fdr commented May 20, 2024

It seems like the patches need some squashing or reordering or something, to make each work, or at least, the first two, right? If you adapted this from #1360, don't take anything in it too seriously...

It'd also be nice to have a second patch set showing an unwinding of the legacy stuff, to show how much net code we're adding for this. This particular change is more phasing-intensive than program-complexity-intensive.

rhizome/host/lib/cloud_hypervisor.rb Outdated Show resolved Hide resolved
rhizome/host/lib/cloud_hypervisor.rb Outdated Show resolved Hide resolved
@bsatzger
Copy link
Contributor Author

It'd also be nice to have a second patch set showing an unwinding of the legacy stuff, to show how much net code we're adding for this.

See https://github.com/ubicloud/ubicloud/commits/ben/firmware_remove_legacy/

@bsatzger bsatzger requested review from fdr and enescakir May 21, 2024 13:38
rhizome/common/lib/util.rb Outdated Show resolved Hide resolved
model/vm_host.rb Show resolved Hide resolved
spec/model/vm_host_spec.rb Outdated Show resolved Hide resolved
Extend `safe_write_to_file` to either take the content as string or
a block producing the content.
The new implementation downloads the firmware from
https://github.com/ubicloud/build-edk2-firmware and stores it
in `/opt/fw`. As an example, firmware with version 202402 would
be located at `/opt/fw/CLOUDHV-202402.fd`. The firmware's
SHA-256 digest is verified during the download.
Start to download new firmware in addition to legacy firmware during
host preparation. When the legacy firmware has become obsolete, we
will stop to download the legacy firmware.
`download-firmware` can be run independent of preparing an entire host
to download the new firmware.
Introduce a `download_firmware` Prog that allows to download new
firmware versions from the control plane. It depends on the
`host/bin/download-firmware` script.
A `download_firmware` method added to `VmHost` allows to download
new firmware versions to vm hosts, leveraging the newly added Prog.
Copy link
Collaborator

@fdr fdr left a comment

Choose a reason for hiding this comment

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

although you can finish hashing out things with @byucesoy, I think it's in pretty good shape. looking forward to closing this long overdue weakness.

@bsatzger bsatzger merged commit 0307f7f into main May 24, 2024
7 checks passed
@bsatzger bsatzger deleted the ben/firmware branch May 24, 2024 13:32
@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants