-
Notifications
You must be signed in to change notification settings - Fork 6
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
worker: rework flash endpoint #728
Conversation
Change-type: patch Signed-off-by: Ryan Cooke <[email protected]>
@balena-ci rebase |
42b25aa
to
21146a4
Compare
this.logger.log(`Preparing to flash, attempt ${attempt}...`); | ||
// if qemu worker, image is already in volume | ||
let flashPath = imagePath; | ||
if(!this.url.includes(`worker`)){ |
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.
I really wish we had a better way to check this but nothing is coming to mind.
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.
I can only think of initialising the class with a flag that says if its for emulated or testbot tbh
await pipeline( | ||
fs.createReadStream(imagePath), | ||
createGzip({ level: 6 }), | ||
fs.createWriteStream(`/tmp/os.img`) |
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.
Don't we already gzip the image before providing it to the client?
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.
Also wouldn't we want to add a .gz extension if we are zipping it, just for clarity?
Expanding on our last sync (that I was present for), I think the hacks for detecting emulated workers are because of the asymmetry between the two approaches currently. For testbot, we have: For QEMU, we have: In English, the testbot has three separate hosts connected by the network (with no guaranteed direct route between the client and test device), whereas the emulated approach really only has two hosts, and the direct route is guaranteed. We can make these symmetrical by running the client/core on the testbot itself, which is easily doable over SSH. This has several advantages:
This also means we wouldn't need any bespoke code or APIs for managing artifacts, configuration, images, and the like. If I have a suite and an image on my local machine I want to run remotely on a Pi 4, I simply rsync or sftp them over before doing something like:
Same thing on my workstation, if I want to run tests on QEMU, I'd do something like:
|
No longer feasible as flashing endpoint needs to be reworked to accommodate #965 |
This PR modifies the flash endpoint.
What we were doing:
This was causing problems for the usbboot device types like the fin - where the http connection was closing while waiting for the fin to attach as a block device during the flashing procedure.
What this PR does:
other things to note:
Change-type: patch
Signed-off-by: Ryan Cooke [email protected]