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

Bugfix/download only response #160

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

UVV-gh
Copy link
Contributor

@UVV-gh UVV-gh commented Jul 10, 2023

Modify unit test and response status for downloadonly deployments

Fixes #159

According the the Hawkbit unit-tests, download-only deployment expects
the status "retrieved"

Signed-off-by: Vyacheslav Yurkov <[email protected]>
Copy link
Member

@Bastian-Krause Bastian-Krause left a comment

Choose a reason for hiding this comment

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

How do you use downloadonly? If you use the downloaded RAUC bundle outside of rauc-hawkbit-updater, how can you be sure that it the download is complete and that it won't be replaced by another download while you're using it?

src/hawkbit-client.c Outdated Show resolved Hide resolved
// skip installation if hawkBit asked us to do so
if (!artifact->do_install &&
(!artifact->do_maintenance || g_strcmp0(artifact->do_maintenance, "available") == 0)) {
active_action->state = ACTION_STATE_SUCCESS;
Copy link
Member

Choose a reason for hiding this comment

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

Does this change anything, really?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. You mean that feedback alone would suffice?

Copy link
Member

Choose a reason for hiding this comment

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

The active_action->state is for the rauc-hawkbit-updater internal state machine only. I think it's correct to set it to ACTION_STATE_SUCCESS here.

While looking at this, I think we should revisit the code paths setting it back to the initial ACTION_STATE_NONE (effectively sending acknowledgements on cancel requests). This does not look correct for all the cases.

src/hawkbit-client.c Show resolved Hide resolved
src/hawkbit-client.c Outdated Show resolved Hide resolved
include/hawkbit-client.h Outdated Show resolved Hide resolved
@UVV-gh
Copy link
Contributor Author

UVV-gh commented Jul 11, 2023

How do you use downloadonly? If you use the downloaded RAUC bundle outside of rauc-hawkbit-updater, how can you be sure that it the download is complete and that it won't be replaced by another download while you're using it?

The backend implementation decides (with the user interaction) when to do the actual update after the bundle is already on the device. The next step is the implementation of confirmationBase end-point so a user could confirm the download+install step beforehand.

@Bastian-Krause
Copy link
Member

How do you use downloadonly? If you use the downloaded RAUC bundle outside of rauc-hawkbit-updater, how can you be sure that it the download is complete and that it won't be replaced by another download while you're using it?

The backend implementation decides (with the user interaction) when to do the actual update after the bundle is already on the device. The next step is the implementation of confirmationBase end-point so a user could confirm the download+install step beforehand.

That's not clear to me, how is downloadonly involved here?

@UVV-gh
Copy link
Contributor Author

UVV-gh commented Jul 11, 2023

That's not clear to me, how is downloadonly involved here?

How would I put the bundle on the device without it? :)
This patch makes sure that download is complete.

But I think I understand your concern. What if another download is started while the bundle is installed outside of rauc-hawkbit-updater? I guess this falls a bit out of scope of this particular fix, but I do have a few thoughts on it:

  • Make sure the rauc-hawkbit-updater is stopped when the bundle is installed.
  • Enhance rauc-hawkbit-updater to use file name from the URL and not from config file (this might not resolve your original concern though)

@UVV-gh UVV-gh force-pushed the bugfix/download-only-response branch from 3678e77 to d39146c Compare July 12, 2023 05:08
@Bastian-Krause
Copy link
Member

That's not clear to me, how is downloadonly involved here?

How would I put the bundle on the device without it? :) This patch makes sure that download is complete.

But I think I understand your concern. What if another download is started while the bundle is installed outside of rauc-hawkbit-updater?

Exactly.

I guess this falls a bit out of scope of this particular fix, but I do have a few thoughts on it:

  • Make sure the rauc-hawkbit-updater is stopped when the bundle is installed.

Instead of letting rauc-hawkbit-updater run as a daemon, you could probably call rauc-hawkbit-updater --run-once every once in a while and check if a bundle appeared at the download location after it terminated.

  • Enhance rauc-hawkbit-updater to use file name from the URL and not from config file (this might not resolve your original concern though)

Copy link
Member

@Bastian-Krause Bastian-Krause left a comment

Choose a reason for hiding this comment

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

Everything else looks good.

include/hawkbit-client.h Outdated Show resolved Hide resolved
SUCCESS would translate from DDI state to action state "Downloaded",
which is exactly what hawkbit expects in case of download-only
deployemnt.

Ref rauc#159

Signed-off-by: Vyacheslav Yurkov <[email protected]>
@UVV-gh UVV-gh force-pushed the bugfix/download-only-response branch from d39146c to ad332dc Compare July 12, 2023 17:43
Copy link
Member

@Bastian-Krause Bastian-Krause left a comment

Choose a reason for hiding this comment

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

Thanks!

@Bastian-Krause Bastian-Krause merged commit 191bd51 into rauc:master Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

downloadonly deployment is never finished
2 participants