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

Update Campaigns Execution #299

Merged

Conversation

rbino
Copy link
Collaborator

@rbino rbino commented Jun 16, 2023

This PR implements the actual rollout of the Update Campaigns. This makes them functional, with the exception of some corner cases that will be handled in subsequent iterations.

@rbino rbino force-pushed the update-campaigns-execution branch 2 times, most recently from 6c47f26 to 1d30f79 Compare June 16, 2023 17:31
@coveralls
Copy link

coveralls commented Jun 16, 2023

Pull Request Test Coverage Report for Build 44d0e6f468499a5304e6633ec7b4abb31983d249-PR-299

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+1.1%) to 83.363%

Files with Coverage Reduction New Missed Lines %
lib/edgehog/application.ex 1 80.0%
lib/edgehog/update_campaigns/target.ex 1 50.0%
lib/edgehog/update_campaigns.ex 7 90.12%
Totals Coverage Status
Change from base Build 1777f7126bde0c936802c6f1da5f1fa6cbda6d05: 1.1%
Covered Lines: 1398
Relevant Lines: 1677

💛 - Coveralls

@rbino rbino force-pushed the update-campaigns-execution branch 2 times, most recently from b0d1b58 to a59388d Compare June 16, 2023 17:55
@bettio bettio added this to the v0.7 milestone Jun 22, 2023
@bettio bettio added the enhancement New feature or request label Jun 22, 2023
@rbino rbino force-pushed the update-campaigns-execution branch from a59388d to 16d16ae Compare July 3, 2023 09:57
@rbino rbino force-pushed the update-campaigns-execution branch 3 times, most recently from c40850a to 6725cc8 Compare July 5, 2023 17:23
@rbino rbino force-pushed the update-campaigns-execution branch from 6725cc8 to ab251cf Compare July 6, 2023 15:59
@rbino rbino force-pushed the update-campaigns-execution branch 3 times, most recently from 85b3903 to bad60f2 Compare July 10, 2023 17:15
@rbino rbino marked this pull request as ready for review July 10, 2023 17:16
@rbino rbino force-pushed the update-campaigns-execution branch from bad60f2 to a060aa8 Compare July 10, 2023 18:04
@rbino rbino force-pushed the update-campaigns-execution branch 6 times, most recently from b55d829 to ad6694e Compare July 12, 2023 09:33
@rbino rbino force-pushed the update-campaigns-execution branch 4 times, most recently from 1c125e5 to 6a6d7a5 Compare July 12, 2023 10:23
Allow passing device attributes

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Allow differentiating between a campaign that has already started its rollout
from one that has not

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
- retry_count: count the number of retries for the target
- latest_attempt: save the timestamp of the latest attempt
- ota_operation_id: saves the OTA operation associated with a target
- completion_timestamp: stores the moment where the target reached a final state

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
This is more coherent with the naming in the rollout mechanism, which is
max_in_progress_updates. Pending also was ambiguous since it had the same name
than the pending OTA Operation, while here we represent the whole range of
states between the start of the rollout and the completion.

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Allow to know when an update campaign effectively started and when it finished

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Helpful for future tests involving targets

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Allow subscribing and publishing events across the application.
Implement the first set of publish primitives for OTAOperation.

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Also add tests for this

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Allow the campaign executor to resend the request to the device

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
@rbino rbino force-pushed the update-campaigns-execution branch from 4914bfc to 44d0e6f Compare July 12, 2023 16:10
@rbino rbino requested review from szakhlypa and noaccOS July 12, 2023 16:10
Expose a functional core to be called by the PushRollout executor. Also add
relevant tests.

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Handy Elixir wrapper around gen_statem

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
@rbino rbino force-pushed the update-campaigns-execution branch from 44d0e6f to f70f634 Compare July 14, 2023 13:26
@rbino rbino requested a review from noaccOS July 14, 2023 13:26
This is the FSM that is responsible of actually rolling out the Update Campaign.
Also add its tests.

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Start a Registry and a DynamicSupervisor to allow spawning, supervising and
identifying the UpdateCampaign executor processes

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
Also add relevant tests

Signed-off-by: Riccardo Binetti <riccardo.binetti@secomind.com>
@rbino rbino force-pushed the update-campaigns-execution branch from f70f634 to eba076b Compare July 14, 2023 13:27
@szakhlypa szakhlypa merged commit c0ac295 into edgehog-device-manager:main Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

6 participants