You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

<Please fill out the Overview, Design and User Experience sections for an initial review of the proposed feature.>

Overview

<Briefly describe the problem being solved, not how the problem is solved, just focus on the problem. Think about why the feature is needed, and what is the relevant context to understand the problem.>

Each time an agent starts running a newer service version or a new service, another container image is downloaded to the edge device. Currently anax agents never remove the images that are no longer in use. This will eventually take up an unacceptable amount of storage on the edge device.

Design

<Describe how the problem is fixed. Include all affected components. Include diagrams for clarity. This should be the longest section in the document. Use the sections below to call out specifics related to each aspect of the overall system, and refer back to this section for context. Provide links to any relevant external information.>

Since agreements can be cancelled and remade for the same service by certain changes (like userinput), the image clean-up should not be a part of the agreement lifecycle. By making image-removal behavior configurable through node management policy, users can decide how aggressive they want the cleaning to be or disable entirely if they don't want images ever removed.

To make this more useful, the agent behavior will change to only download images that are not already on the device.

The policy will specify which image it applies to or * for all, and how long to wait before deleting the specified image. To determine when to delete the image, the agent will iterate over canceled agreements and if the image used by the agreement is on the node but has not been needed since more than deleteAfterHours, it will remove the image from the device.

There will not be any explicit resolution of conflicting removal policies, whichever is most aggressive will delete the image first in practice.

"imageRemovalPolicy":

{

    [{“imageName”: “dockeruser/image1”,

      “deleteAfterHours”: 2

       },

    {“imageName”: “*”,

    “deleteAfterHours”: 4

    }]

}

User Experience

<Describe which user roles are related to the problem AND the solution, e.g. admin, deployer, node owner, etc. If you need to define a new role in your design, make that very clear. Remember this is about what a user is thinking when interacting with the system before and after this design change. This section is not about a UI, it's more abstract than that. This section should explain all the aspects of the proposed feature that will surface to users.>

To use this feature, users will create a node management policy with an "imageRemovePolicy" section that specifies the images and time to delete them. After publishing it to the exchange, agents will check if it applies to them and if so save it to the local db and a subworker will begin checking if it is time to delete any images.

Command Line Interface

<Describe any changes to the hzn CLI, including before and after command examples for clarity. Include which users will use the changed CLI. This section should flow very naturally from the User Experience section.>


External Components

<Describe any new or changed interactions with components that are not the agent or the management hub.>


Affected Components

<List all of the internal components (agent, MMS, Exchange, etc) which need to be updated to support the proposed feature. Include a link to the github epic for this feature (and the epic should contain the github issues for each component).>


Security

<Describe any related security aspects of the solution. Think about security of components interacting with each other, users interacting with the system, components interacting with external systems, permissions of users or components>


APIs

<Describe and new/changed/deprecated APIs, including before and after snippets for clarity. Include which components or users will use the APIs.>


Build, Install, Packaging

<Describe any changes to the way any component of the system is built (e.g. agent packages, containers, etc), installed (operators, manual install, batch install, SDO), configured, and deployed (consider the hub and edge nodes).>


Documentation Notes

<Describe the aspects of documentation that will be new/changed/updated. Be sure to indicate if this is new or changed doc, the impacted artifacts (e.g. technical doc, website, etc) and links to the related doc issue(s) in github.>


Test

<Summarize new automated tests that need to be added in support of this feature, and describe any special test requirements that you can foresee.>

  • No labels