openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
148 stars 130 forks source link

How to implement SimpleUpdate HTTP Pull for D-Bus interface flow? #281

Closed jagpalgill closed 2 weeks ago

jagpalgill commented 2 weeks ago

Is this the right place to submit this?

Bug Description

The current flow for SimpleUpdate (using the TFTP protocol) is not suitable for the D-Bus interface because it involves multiple applications (BMCWeb -> DownloadManager -> CodeUpdater). In this flow, BMCWeb sends a message to DownloadManager, which downloads the image to /tmp/images. Then, BMCCodeUpdater watches this directory for new files and starts the update. At the same time, BMCWeb creates a task and sends it back to the client while watching for activation signals in the task handler. The current distributed flow works because it supports only one update at a time, and that too only for the BMC. Hence, the task handler watches for just single activation interface on D-Bus.

To implement HTTP pull along with the D-Bus interface, we need to perform the following actions in an appropriate daemon so that BMCWeb can match the task to the correct backend:

  1. Create a task and return it to the user.
  2. Asynchronously download the image.
  3. Invoke the StartUpdate action with the image file descriptor (imageFd) to CodeUpdater.
  4. Watch for activation status changes and update the task status.

So, possible points to discuss -

  1. Who will do the image download? Is it BMCWeb since BMCWeb needs to calls the StartUpdate with downloaded image.
  2. Also, BMCWeb needs to have task callback watch the activation status on the object path returned by StartUpdate D-Bus API, so need to make sure the flow supports this.

Related PR: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/72049

Version

This issue is for discussion.

Additional Information

No response

edtanous commented 2 weeks ago

This is not a bug in an OpenBMC fork or a bug in code still under code review.

You checked this box.... then the first line of the description is a pointer to code that's still under review.

jagpalgill commented 2 weeks ago

This is not a bug in an OpenBMC fork or a bug in code still under code review.

You checked this box.... then the first line of the description is a pointer to code that's still under review.

I have removed the checked and moved the related PR to end for reference.

edtanous commented 2 weeks ago

The point is really that the bug tracker is for bugs. the mailing list and/or gerrit are for discussion topics.

jagpalgill commented 2 weeks ago

Sure, then let's discuss this in the original gerrit PR itself. I will close this issue.

edtanous commented 2 weeks ago

Or the mailing list, or discord would be fine.