-
Notifications
You must be signed in to change notification settings - Fork 61
ostree update on IP secondary (reworked) #1518
ostree update on IP secondary (reworked) #1518
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1518 +/- ##
==========================================
+ Coverage 80.74% 80.86% +0.12%
==========================================
Files 184 184
Lines 11181 11196 +15
==========================================
+ Hits 9028 9054 +26
+ Misses 2153 2142 -11
Continue to review full report at Codecov.
|
27db9c8
to
770e25d
Compare
This pull request fixes 1 alert when merging de61528 into 21c8595 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 6baf1c2 into 635962f - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging e10b080 into 635962f - view on LGTM.com fixed alerts:
|
e10b080
to
088edc9
Compare
This pull request fixes 1 alert when merging 088edc9 into 635962f - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging dd01c3a into 635962f - view on LGTM.com fixed alerts:
|
- Each target listed in Director's target file should have corresponding match in ImageRepo's one - Test for the use-case if IP Secondary Director's target file and ImageRepo's one have different number of targets Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
dd01c3a
to
3373d03
Compare
This pull request fixes 1 alert when merging 3373d03 into 635962f - view on LGTM.com fixed alerts:
|
11681c2
to
d660f55
Compare
This pull request fixes 1 alert when merging d660f55 into 635962f - view on LGTM.com fixed alerts:
|
d660f55
to
7c2fa9e
Compare
This pull request fixes 1 alert when merging 7c2fa9e into 635962f - view on LGTM.com fixed alerts:
|
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.
Just some small stuff. This looks quite good, though.
I did a diff with the last version and only noticed one thing missing that seems like it should be here: in src/aktualizr_secondary/aktualizr_secondary_config_test.cc
, you previously had a change with #ifdef BUILD_OSTREE
to control whether the default pacman was kOstree
or kNone
.
storage_->loadInstalledVersions(ecu_serial_.ToString(), nullptr, &pending_target); | ||
data::InstallationResult install_res = | ||
data::InstallationResult(data::ResultCode::Numeric::kUnknown, "Unknown installation error"); | ||
LOG_INFO << "There is a pending update, try to apply it, update hash: " << pending_target_.sha256Hash(); |
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.
Might be worth making this just a bit clearer. "Try to apply it" sounds like the user should take action. Maybe rephrase to "Pending update found; attempting to apply it. Target hash: ".
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.
ok
using Ptr = std::shared_ptr<AktualizrSecondary>; | ||
|
||
public: | ||
// TODO: free AktualizrSecondary from dependencies as much as possible, e.g. bootloader |
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.
It has now been freed of the bootloader, at least from the perspective of the constructor here. :)
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.
yes
storage->saveInstalledVersion(f.first.serial.ToString(), f.first.update, | ||
fut_result == data::ResultCode::Numeric::kOk | ||
? InstalledVersionUpdateMode::kCurrent | ||
: InstalledVersionUpdateMode::kPending); |
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.
Not a big deal or blocker here, but I'd probably prefer to have the three-line logic for calculating the result on its own line outside of the function call.
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.
ok
@@ -171,6 +173,7 @@ class SotaUptaneClient { | |||
// ecu_serial => secondary* | |||
std::map<Uptane::EcuSerial, std::shared_ptr<Uptane::SecondaryInterface>> secondaries; | |||
std::mutex download_mutex; | |||
mutable Uptane::EcuSerial primary_ecu_serial_; |
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.
Why does this need to be mutable
?
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.
does not have to be such anymore, leftover of one the previous versions.
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.
Can you still remove the mutable
modifier, or did it turn out it was necessary?
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.
sure, just missed it in the first time.
|
||
private: | ||
IsoTpSendRecv conn; | ||
mutable IsoTpSendRecv conn; |
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.
Why is this mutable
too?
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.
because most of methods in the secondary interface are 'const' now and isotpsecondary uses IsoTpSendRecv non-const methods from within these const methods implementation.
|
||
extern "C" const char* ostree_deployment_get_csum(OstreeDeployment* ostree_deployment) { | ||
return OstreeSecondaryUptaneVerificationTest::curOstreeRootfsRev(ostree_deployment); | ||
} |
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.
What happened to this test suite? In the old version there were a bunch of non-OSTree-specific Uptane tests. Those still seem useful to me.
Update: oh wait, I think you just renamed this, right?
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.
yes, the total number of tests has actually increased, I just split the initial test file into two, one with all non-ostree tests and another with ostree specific.
bool AktualizrSecondary::sendFirmware(const std::string& firmware) { | ||
// TODO: how to handle the case when secondary is rebooted after metadata are received | ||
if (!pending_target_.IsValid()) { | ||
LOG_ERROR << "No any pending target to receive update data/image for"; |
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.
This message is also a bit confusing. Maybe change to "Aborting image download; no valid target found."
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.
ok
This pull request fixes 1 alert when merging 9223c90 into 6112216 - view on LGTM.com fixed alerts:
|
… for IP Secondary Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
- Decouple the secondary interface implementation (aktualizr_secondary) from the TCP server - Remove redundant wrappers over the aktualizr secondary class/interface Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
- improve the TCP server implementation - add tests for the TCP server and the RPC (serialization/deserialization) Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
9223c90
to
19527bc
Compare
@patrickvacek updated according to the comments |
Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
…on both Primary and Secondary Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
…xygen happy Signed-off-by: Mike Sul <ext-mykhaylo.sul@here.com>
Also include the serial to make it somewhat more useful. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
19527bc
to
ed9a0e3
Compare
This pull request fixes 1 alert when merging ed9a0e3 into 462fc83 - view on LGTM.com fixed alerts:
|
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.
Looks great, thanks for fixing all of these things!
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 didn't have time to review thoroughly so far but it looks much better than the previous PR and should it be easy now to revisit some parts later. Great job!
No description provided.