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

add support for UEFI HTTP Boot #216

Merged
merged 1 commit into from
Nov 16, 2021
Merged

Conversation

rgl
Copy link
Contributor

@rgl rgl commented Oct 9, 2021

Description

This adds supports for UEFI HTTP Boot.

Why is this needed

Fixes: #210

How Has This Been Tested?

Tested with:

How are existing users impacted? What migration steps/scripts do we need?

Should have no impact.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@jacobweinstock
Copy link
Member

/ok-to-test

@codecov
Copy link

codecov bot commented Oct 13, 2021

Codecov Report

Merging #216 (3c4f89b) into main (f42cbcc) will decrease coverage by 0.05%.
The diff coverage is 36.36%.

❗ Current head 3c4f89b differs from pull request most recent head ceb470a. Consider uploading reports for the commit ceb470a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
- Coverage   38.90%   38.84%   -0.06%     
==========================================
  Files          41       41              
  Lines        2763     2762       -1     
==========================================
- Hits         1075     1073       -2     
- Misses       1602     1603       +1     
  Partials       86       86              
Impacted Files Coverage Δ
job/http.go 0.00% <0.00%> (ø)
job/job.go 33.33% <0.00%> (-1.72%) ⬇️
job/logging.go 50.00% <ø> (+16.66%) ⬆️
job/dhcp.go 56.97% <80.00%> (-0.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f42cbcc...ceb470a. Read the comment docs.

@rgl
Copy link
Contributor Author

rgl commented Oct 13, 2021

@jacobweinstock, there were changes in the main branch that now conflict with this MR.

Its is safe to rebase over main? Or is there still some pending work that I should wait for?

@jacobweinstock
Copy link
Member

@jacobweinstock, there were changes in the main branch that now conflict with this MR.

Its is safe to rebase over main? Or is there still some pending work that I should wait for?

Hey @rgl, should be safe. I don't foresee any big changes in the very immediate future.

@rgl rgl force-pushed the rgl-http-boot branch 4 times, most recently from c4b3ea0 to cf29795 Compare October 17, 2021 15:57
@rgl
Copy link
Contributor Author

rgl commented Oct 17, 2021

@jacobweinstock, this is now ready, try2 :-)

Copy link
Member

@jacobweinstock jacobweinstock left a comment

Choose a reason for hiding this comment

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

This is a really great addition. thank you very much for your time and effort on it! I added a few discussion points around func init(). Interested in your thoughts.

dhcp/pxe.go Outdated Show resolved Hide resolved
job/http.go Outdated Show resolved Hide resolved
tftp/tftp.go Outdated

type tftpTransfer struct {
log.Logger
unread []byte
start time.Time
}

func init() {
Copy link
Member

Choose a reason for hiding this comment

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

would you be open to not using func init()? Boots' design philosophy is to avoid func init() when possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was an attempt to prevent the creation of fs.Sub(files, "ipxe") each time there is a file request.

I can re-implement GetIpxeFiles() to always call that instead. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now moot, as the DHCP server now includes the directory name in the requested file like ipxe/ipxe.pxe.

tftp/tftp.go Outdated Show resolved Hide resolved
@jacobweinstock jacobweinstock added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 19, 2021
job/http.go Outdated Show resolved Hide resolved
job/dhcp.go Show resolved Hide resolved
tftp/tftp.go Outdated Show resolved Hide resolved
@rgl
Copy link
Contributor Author

rgl commented Nov 4, 2021

@mmlb, @jacobweinstock, I think I've addressed all comments. Can you please review this again?

job/dhcp.go Show resolved Hide resolved
ipxe/files.go Outdated Show resolved Hide resolved
ipxe/files.go Outdated Show resolved Hide resolved
dhcp/pxe.go Outdated Show resolved Hide resolved
@rgl rgl force-pushed the rgl-http-boot branch 2 times, most recently from 59fce77 to 0096aa6 Compare November 5, 2021 20:04
@rgl
Copy link
Contributor Author

rgl commented Nov 5, 2021

@mmlb, I think I've addressed all the comments (except adding the pxeClient boolean like commented above). Please check it out :-)

@mmlb
Copy link
Contributor

mmlb commented Nov 5, 2021

@mmlb, I think I've addressed all the comments (except adding the pxeClient boolean like commented above). Please check it out :-)

Yep, looks good to me. I'll just want to fire it up through a sandbox run to make sure all is good ;)

this closes tinkerbell#210

Signed-off-by: Rui Lopes <rgl@ruilopes.com>
@rgl
Copy link
Contributor Author

rgl commented Nov 5, 2021

@mmlb with the latest push, the test should now pass.

@tstromberg tstromberg merged commit a580a44 into tinkerbell:main Nov 16, 2021
mmlb added a commit to mmlb/tinkerbell-boots that referenced this pull request Dec 1, 2021
This reverts commit ceb470a.

Something in tinkerbell#216 broke our c2.large.arm provisions. Reverting
this to unblock things that came after while I look into debugging.

Some more info in [tinkerbell#225].

[tinkerbell#225]: tinkerbell#225.

Signed-off-by: Manuel Mendez <mmendez@equinix.com>
mmlb added a commit to mmlb/tinkerbell-boots that referenced this pull request Dec 1, 2021
This reverts commit ceb470a.

Something in tinkerbell#216 broke our c2.large.arm provisions. Reverting
this to unblock things that came after while I look into debugging.

Some more info in [tinkerbell#225].

[tinkerbell#225]: tinkerbell#225

Signed-off-by: Manuel Mendez <mmendez@equinix.com>
mergify bot added a commit that referenced this pull request Dec 1, 2021
## Description

This reverts commit ceb470a.

## Why is this needed

Something in #216 broke our c2.large.arm provisions. Reverting
this to unblock things that came after while I look into debugging.

Some more info in [#225].

[#225]: #225

## How Has This Been Tested?

Tested via sandbox against EM c2.large.arm
mergify bot added a commit that referenced this pull request Dec 9, 2021
## Description

This is a revert of the revert that occurred in #217 + fix that caused the original revert.
There's also removal of what is effectively useless/dead code (isPXEClient/pxeClient var/handling).
I also removed the leading `/` from `/nonexistent` because a `/` is already prefixed and `//nonexistent` has bothered me for years.

## Why is this needed

#216 was a great contribution from @rgl, unfortunately we ran into issues on some of our Ampere eMAG systems (#225).
Turns out that the eMAG boot firmware just straight up ignores filename values if the response packet is marked as `PXEClient`.
#216 changed the logic subtly by setting the response packet's class as `HTTPClient` if http was supported by the booting machine, and otherwise setting `PXEClient`. Before #216 we would set `PXEClient` only for the dhcp responses that were going out to our tftp'd build of iPXE, the initial filename: response was `PXEClient`-less.

Once I put back the only `PXEClient` for our iPXE everything worked out fine again (tested using sandbox), but then I realized that now pxeClient was likely useless because I suspected iPXE did not care/require it. I tested this too and found that iPXE is happy to tftp a file provided by a `PXEClient`-less DHCP response. So why keep code around that is effectively useless? Less code is better than any code so that caused me to write up d1878bd.

Fixes #210
Fixes #225

This debugging also opens up the way to bring back #149 as that had to be reverted due to the same "always set `PXEClient`" issue that I was not equipped to debug easily/quickly then.

## How Has This Been Tested?

Lots of testing on EM machines using github.com/tinkerbell/sandbox's terraform support (I plan to clean up and PR https://github.com/mmlb/sandbox/tree/fix-terraform-and-add-arm64-support at some point).

## How are existing users impacted? What migration steps/scripts do we need?

Back to faster/better iPXE binary downloads by utilizing TCP/HTTP instead of UDP/TFTP.
@rgl rgl deleted the rgl-http-boot branch December 9, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for UEFI HTTP Boot
4 participants