Undoing actions and uninstalling applications in a computing environment
A computer-implemented method, computer program product, and/or computing system for preforming at least one of a performance group consisting of undoing an action in and uninstalling a software application from a computing environment. The computer-implemented method, computer program product, and/or computing system includes: building an initial resource dependency graph; building a second resource dependency graph; determining a resulting resource dependency graph to identify dangling resources; and removing the dangling resources. In an embodiment, building at least one of the initial resource dependency graph or the second resource dependency graph includes building a resource ownership graph and extending the resource ownership graph to include associations to form a resource dependency graph
1 . A computer implemented method for performing at least one of a performance group consisting of undoing an action in and uninstalling a software application from a computing environment, the method comprising:
building an initial resource dependency graph for the computing environment, wherein the initial resource dependency graph identifies resources owned and associated with at least one of an action group consisting of the action and the software application before performing the performance group;
building a second resource dependency graph for the computing environment, wherein the second resource dependency graph identifies resources owned and associated with the action group after performing the performance group;
determining a resulting resource dependency graph to identify dangling resources in the computing environment after performing the performance group, wherein the resulting resource dependency graph is a difference in the identified resources between the initial resource dependency graph and the second resource dependency graph; and
removing the dangling resources from the computing environment.
2 . The computer-implemented method of claim 1 , wherein removing the dangling resources is performed hierarchically where dependent dangling resources that are dependent upon other resources are removed before the other resources.
3 . The computer-implemented method of claim 1 , wherein building at least one of the initial resource dependency graph or the second resource dependency graph comprises:
building a resource ownership graph; and
extending the resource ownership graph to include associations to form a resource dependency graph.
4 . The computer-implemented method of claim 1 , further comprising grouping eligible resources as condensed resources in at least one of the initial resource dependency graph or the second resource dependency graph.
5 . The computer-implemented method of claim 4 , wherein grouping the eligible resources as condensed resources in at least one of the initial resource dependency graph or the second resource dependency graph comprises:
scanning the initial resource dependency graph or the second resource dependency graph to identify nodes eligible to be condensed; and
for each group of nodes identified as eligible to be condensed, create a new virtual node representing the group of nodes identified as eligible to be condensed and substitute the virtual node in the at least one of the initial resource dependency graph or the second resource dependency graph for the group of nodes identified as eligible to be condensed.
6 . The computer-implemented method of claim 3 , wherein building the resource ownership graph comprises:
scanning a target system in the computing environment for resource manifests stored in a resource datastore;
determining existing definitions that represent an explicit relationship between resources;
parsing resource explicit dependencies; and
building the resource ownership graph.
7 . The computer-implemented method of claim 6 , wherein the resource ownership graph is built iteratively.
8 . The computer-implemented method of claim 3 , wherein extending the resource ownership graph to include associations to form the resource dependency graph comprises:
scanning container logs to identify associations among resources for implicit dependencies;
tracking service to service communications to identify associations among resources for implicit dependencies; and
extending the resource ownership graph to include the identified associations to form the resource dependency graph.
9 . The computer-implemented method of claim 1 , wherein determining the resulting resource dependency graph to identify dangling resources comprises comparing the initial resource dependency graph to the second resource dependency graph.
10 . The computer-implemented method of claim 1 , wherein determining the resulting resource dependency graph to identify dangling resources further comprises:
for each node in the initial resource dependency graph determine whether the second resource dependency graph contains the same node;
for each node located in both the initial and second resource dependency graph, mark the node as visited;
for each node located only in the initial resource dependency graph, mark the node as ignored; and
for each node located only in the second resource graph, identify the node as a dangling resource, wherein the dangling resources form the resulting resource dependency graph.
11 . The computer-implemented method of claim 1 , wherein removing the dangling resources comprises:
identify a leaf node in the resulting resource dependency graph;
delete the identified leaf node in the resulting resource dependency graph;
in response to the identified leaf node being successfully deleted, mark the identified leaf node as deleted and in response to the identified leaf node not being successfully deleted, mark the identified leaf node as failed;
determine whether any more nodes remaining in the resulting resource dependency graph;
in response to being one or more nodes remaining in the resulting resource dependency graph, determine whether any of the one or more remaining nodes are leaf nodes;
in response to being remaining leaf nodes, delete a next available remaining leaf node;
in response to being no remaining leaf nodes, delete a next available non-leaf node; and
in response to being no remaining leaf nodes and no remaining non-leaf nodes, end the process of removing dangling resources.
12 . The computer-implemented method of claim 1 , wherein the resource dependency graphs are built without user interruption or code modification.
13 . The computer-implemented method of claim 1 , further comprising removing dangling resources by traversing the resulting resource dependency graph without a user specifying the order of deleting the dangling resources.
14 . The computer-implemented method of claim 1 , wherein the initial resource dependency graph comprises one or more nodes where each node identifies a resource and the initial resource dependency graph identifies resource dependencies;
the second resource dependency graph comprises one or more nodes where each node identifies a resource and the second resource dependency graph identifies resource dependencies; and
the resulting resource dependency graph is determined by comparing the one or more nodes within the initial resource dependency graph to the one or more nodes within the second resource dependency graph to identify the dangling resources.
15 . The computer-implemented method according to claim 14 , wherein building the initial resource dependency graph or the second resource dependency graph comprises:
forming an initial resource ownership graph or a second resource ownership graph by:
scanning a target system in the computing environment for resource manifests stored in a resource datastore;
determining existing ownerReference definitions among resources for explicit dependencies;
parsing resource explicit dependencies; and
forming the initial resource ownership graph or the second resource ownership graph; and
extending the initial resource ownership graph or the second resource ownership graph to include associations to form the initial resource dependency graph or the second resource dependency graph by:
scanning container logs to identify associations among resources for implicit dependencies;
tracking service to service communications to identify associations among resources for implicit dependencies; and
extending the initial resource ownership graph or the second resource ownership graph to include the identified associations.
16 . The computer-implemented method according to claim 14 , wherein determining the resulting resource dependency graph by comparing the one or more nodes within the initial resource dependency graph to the one or more nodes within the second resource dependency graph to identify the dangling resources, comprises:
for each node in the initial resource dependency graph determine the second resource dependency graph contains the same node;
for each node located in both the initial and second resource dependency graph, mark the node as visited;
for each node located only in the initial resource dependency graph, mark the node as ignored; and
for each node located only in the second resource graph, identify the node as a dangling resource, wherein the dangling resources form the resulting resource dependency graph.
17 . The computer-implemented method according to claim 14 wherein removing the dangling resources comprises:
identifying a leaf node in the resulting resource dependency graph;
deleting the identified leaf node in the resulting resource dependency graph;
in response to the identified leaf node being successfully deleted, marking the identified leaf node as deleted and in response to the identified leaf node not being successfully deleted, marking the identified leaf node as failed;
determining whether any more nodes remaining in the resulting resource dependency graph;
in response to being one or more nodes remaining in the resulting resource dependency graph, determining whether any of the one or more remaining nodes are leaf nodes;
in response to being remaining leaf nodes, deleting a next available remaining leaf node;
in response to being no remaining leaf nodes, deleting a next available non-leaf node; and
in response to being no remaining leaf nodes and no remaining non-leaf nodes, ending the process of removing dangling resources.
18 . The method of claim 1 , wherein building the initial resource dependency graph being triggered by a user or a program.
19 . The method of claim 1 , wherein the building of the second resource dependency graph being triggered by a user or a program.
20 . A computer-implemented method of uninstalling a software application, the method comprising:
forming an initial resource dependency graph before uninstalling the software application, wherein the initial resource dependency graph identifies resources in the computing environment owned and associated with the software application and comprises one or more nodes where each node identifies one of the resources and the initial resource dependency graph identifies resource dependencies;
forming a second resource dependency graph after uninstalling the software application, wherein the second resource dependency graph identifies resources in the computing environment owned and associated with the software application comprising one or more nodes where each node identifies one of the resources and the second resource dependency graph identifies resource dependencies;
form a resulting resource dependency graph by comparing the one or more nodes within the initial resource dependency graph to the one or more nodes within the second resource dependency graph to identify dangling resources; and
remove the dangling resources,
wherein forming the initial resource dependency graph or the second resource dependency graph comprises:
forming an initial resource ownership graph and a second resource ownership graph by:
scanning a target system in the computing environment for resource manifests stored in a resource datastore;
determining existing ownerReference definitions among resources for explicit dependencies;
parsing resource explicit dependencies; and
forming the initial resource ownership graph and the second resource ownership graph; and
extending the initial resource ownership graph and the second resource ownership graph to include associations to form the initial resource dependency graph and the second resource dependency graph by:
scanning container logs to identify associations among resources for implicit dependencies;
tracking service to service communications to identify associations among resources for implicit dependencies; and
extending the initial resource ownership graph and the second resource ownership graph to include the respective identified associations.