-
Notifications
You must be signed in to change notification settings - Fork 193
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
Prioritisation of assignments via Mgmt-API #895
Prioritisation of assignments via Mgmt-API #895
Conversation
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
TargetFilterQuery Signed-off-by: Stefan Klotz <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
weight Signed-off-by: Stefan Klotz <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
weight in multiassig mode Signed-off-by: Stefan Klotz <[email protected]>
Signed-off-by: Stefan Klotz <[email protected]>
Fixes #863 |
...y-core/src/main/java/org/eclipse/hawkbit/repository/builder/AbstractRolloutUpdateCreate.java
Show resolved
Hide resolved
...ository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaTargetFilterQuery.java
Show resolved
Hide resolved
.../main/java/org/eclipse/hawkbit/repository/builder/AbstractTargetFilterQueryUpdateCreate.java
Show resolved
Hide resolved
...ory-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaTargetFilterQueryManagement.java
Outdated
Show resolved
Hide resolved
...it-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaRolloutManagement.java
Outdated
Show resolved
Hide resolved
...itory-api/src/main/java/org/eclipse/hawkbit/repository/builder/TargetFilterQueryBuilder.java
Show resolved
Hide resolved
...repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaDeploymentManagement.java
Outdated
Show resolved
Hide resolved
...wkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/builder/RolloutCreate.java
Show resolved
Hide resolved
...itory-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignChecker.java
Outdated
Show resolved
Hide resolved
...itory-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/autoassign/AutoAssignChecker.java
Outdated
Show resolved
Hide resolved
...sitory-api/src/main/java/org/eclipse/hawkbit/repository/builder/TargetFilterQueryCreate.java
Show resolved
Hide resolved
...wkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/builder/RolloutUpdate.java
Show resolved
Hide resolved
Signed-off-by: Stefan Klotz <[email protected]>
...awkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaRollout.java
Outdated
Show resolved
Hide resolved
feature_prioritisation_of_campaigns Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
feature_expose_action_prioritisation_to_targets Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
feature_prioritisation_of_campaigns Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
'origin/feature_expose_action_prioritisation_to_targets' into feature_prioritisation_of_campaigns Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
<<<<<<< HEAD | ||
* Updates the auto assign settings of an {@link TargetFilterQuery}. | ||
======= | ||
* Updates the the auto assign settings of an {@link TargetFilterQuery}. |
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.
Missed these markers... they didnt hint me either :( will remove them
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
/** | ||
* Implements utility methods for managing {@link Action}s | ||
*/ | ||
public class JPAActionManagement { |
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 we rename it to JpaActionManagement (camel-case) to make it consistent with the other classes (e.g. JpaDeploymentManagement)?
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, will update it
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
docs/content/apis/dmf_api.md
Outdated
@@ -364,6 +364,8 @@ type=EVENT <br /> tenant=tenant123 <br /> thingId=abc <br /> topic=DOWNLOAD\_A | |||
|
|||
If `multi.assignments.enabled` is enabled, this message is sent instead of DOWNLOAD_AND_INSTALL, DOWNLOAD, or CANCEL_DOWNLOAD | |||
by hawkBit to initialize update, download, or cancel task(s). | |||
|
|||
With weight, one can set the priority to the action. Higher the weight, more is the priority of an action. |
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.
The higher the weight, the higher the priority of an action.
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.
corrected the sentence
|
||
**Minor** | ||
|
||
* While on DMF-API a MULTI_ACTION request is sent, DDI-API only exposes the oldest open action. | ||
* While on DMF-API a MULTI_ACTION request is sent, DDI-API only exposes the most urgent open action (according to the weight of the actions). |
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.
so far we only used the term "priority" ... we could use it here too: "... DDI-API only exposes the next action which has the highest priority in the list of open actions (according to their weight property)."
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, updated
* Simple addition of a new {@link ActionStatus} entry to the {@link Action} . | ||
* No state changes. | ||
* Simple addition of a new {@link ActionStatus} entry to the {@link Action} | ||
* . No state changes. |
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.
line break probably caused by some unintended whitespace
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.
formatted it correctly
/** | ||
* If an {@link Action} has a weight of null this value is used as weight. | ||
*/ | ||
private int actionWeightIfAbsent = 1000; |
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.
my assumption has been that we want to reduce this value to represent medium priority (e.g. 500) and even make it configurable in a next step...
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.
updated it to 500 and also updated relevant test
* @return the weight of the {@link Action}s created during an auto | ||
* assignment. | ||
*/ | ||
Integer getAutoAssignWeight(); |
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.
on Rollout, we have Optional<Integer> getWeight();
- would it make sense to align this?
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, changed the return type
* order | ||
* Retrieves the active {@link Action}s with the highest weights that refer | ||
* to the given {@link Target}. If {@link Action}s have the same weight they | ||
* are ordered ascending by ID (oldest ones first). |
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.
The "oldest ones first" does not make sense to me because the actions cannot have the same ID?
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.
removed it
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
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.
Thanks Shruthi! Looks good now.
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
feature_prioritisation_of_campaigns Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
* Updating the schema for targetfilterquery and rollout * Updating the weight validation logic and tests * Make weight optional * Fix existing multi assignment tests by adding weight, remove weight from TargetFilterQuery * Add weight validation tests, fix tests * Add mgmt api tests for assignment and getting action with weight * Add management layer validation and tests for creating rollouts with weight * Fix amqp test, add repo level validation to resource tests * Add weight to rollout mgmt-api and tests * Add weight to mgmt api target Filter create and update * Add target filter auto assign weight. disable enforcement of setting a weight in multiassign mode * Remove ignored tests, fix api doc * Fix minor findings * Fix findings * Remove hardcoded min weight * Add docu text, fix findings * Fix api documentation * Expose weight via DMF * Expose actions according to weight via ddi * Fix documentation * Add method to get actions ordered by weight to deploymentManagement * Updating the schema for targetfilterquery and rollout * Updated the indentation * Updated the helper class, fixed the randomUID in test factory * Updated the class name with prefix JPA * Adding the missing License for WeightValidationHelper class * Adding documentation to the dmf api on weight * Removed the merger markers * Updated the class name * Removed the redundant method * Addressed final PR comments * Updated the missing testcase with latest default weight value * Reverting the default value of weight back to 1000 and updated tests Signed-off-by: Shruthi Manavalli Ramanna <[email protected]> Signed-off-by: Stefan Klotz <[email protected]>
Prioritisation of assignments via mgmt-API (see eclipse-hawkbit/hawkbit#895) Signed-off-by: Dominic Schabel <[email protected]>
When Multi Assignments is enabled, it is possible to define multiple distribution sets that should all be installed to a device. In that case it should be possible to specify the importance of the different distribution sets. That way the installation of a security patch will not be blocked by an other less important update.
To achieve that every action (representing the assignment of a distribution set to a target) will get a weight property. This number between (0 to 1000) represents the importance of this action (where 0 means not important and 1000 means very important) can then be exposed to the device directly or used to determine the order the actions are exposed to the device.
These changes enable an operator to specify a weight via mgmt-api when crating an manual assignment, a rollout or a target filter with an auto assignment. In case of a rollout and a target filter this weight is applied to every action resulting from it.
For now it is not mandatory for the operator to specify the weight, since it is not jet possible to do it via mgmt-UI. This should be enforced after the UI is adapted as well.