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

HC optimization finalization - phase 3 #723

Merged
merged 96 commits into from
Jun 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
8e368e0
Initial implementation of building and minimizing fw-rules directly f…
tanyaveksler Feb 25, 2024
8240404
Fixed lint errors.
tanyaveksler Mar 3, 2024
5ad1ee9
Merge branch 'master' into opt-finalize
tanyaveksler Mar 3, 2024
6466889
Updating (some of) expected results for explainability queries, accor…
tanyaveksler Mar 3, 2024
a615f5c
Fixed converting fw-rules to connectivity properties, while taking in…
tanyaveksler Mar 3, 2024
9c5e89a
Optimized handling IpBlocks in optimized fw-rules minimization
tanyaveksler Mar 10, 2024
81ac68f
Optimized initial namespace grouping (by grouping few namespaces toge…
tanyaveksler Mar 17, 2024
06f5250
Optimized initial namespace grouping (by grouping few namespaces toge…
tanyaveksler Mar 17, 2024
898f222
More optimization in calculation partial ns grouping.
tanyaveksler Mar 19, 2024
ae2ff0a
Fixed lint error
tanyaveksler Mar 19, 2024
06b2905
Refining basic namespace grouping by finding more opportunities to us…
tanyaveksler Mar 24, 2024
6b22688
One more refinemenet of basic namespace grouping
tanyaveksler Mar 24, 2024
368f1b0
One more refinemenet of basic namespace grouping
tanyaveksler Mar 24, 2024
d027631
More refinemenets of peer grouping from properties
tanyaveksler Mar 26, 2024
8b343d6
More refinemenets of peer grouping from properties
tanyaveksler Mar 26, 2024
0bb3094
More refinements of peer grouping from properties
tanyaveksler Mar 26, 2024
0df3938
Added outputEndpoints option handling to PeerSetElement.
tanyaveksler Mar 31, 2024
4db0e43
Fixing lint errors.
tanyaveksler Mar 31, 2024
757a684
Fixing handling txt-no_fw_rules format in the optimized solution
tanyaveksler Apr 2, 2024
1efde22
Fixing lint error
tanyaveksler Apr 2, 2024
86af435
Fix: taking into account connectivity restriction (TCP/non-TCP) in ge…
tanyaveksler Apr 2, 2024
8bd2944
Small fixes in txt_no_fw_rules_format
tanyaveksler Apr 2, 2024
0bd08c3
Small fixes in txt_no_fw_rules_format
tanyaveksler Apr 2, 2024
b01e93d
Added grouping by dns entries to the optimized algorithm.
tanyaveksler Apr 7, 2024
316dee1
Changed expected results of connectivity map query tests according to…
tanyaveksler Apr 9, 2024
e5eb701
Changed optimized semantic diff query implementation according to the…
tanyaveksler Apr 9, 2024
5c0cc0c
Keeping every dns entry separate in minimization of fw rules.
tanyaveksler Apr 9, 2024
f8f1d67
Updated containment, permits, forbids expected results.
tanyaveksler Apr 14, 2024
eaf561d
Cleaning up unused code and refactoring accordingly.
tanyaveksler Apr 14, 2024
d6633e4
Merge branch 'master' into opt-finalize
tanyaveksler Apr 14, 2024
100df6a
Fixed lint error.
tanyaveksler Apr 14, 2024
6fc8221
Merge branch 'opt-finalize' into opt-finalize2
tanyaveksler Apr 14, 2024
b578147
Changed default to be the optimized run.
tanyaveksler Apr 14, 2024
3d35da6
In opt='debug' the result explanation should ne according to the opti…
tanyaveksler Apr 14, 2024
4a70d30
Restoring resource in scheme, changed by mistake.
tanyaveksler Apr 14, 2024
f382c5e
Updating more expected results.
tanyaveksler Apr 14, 2024
d4956a0
Small optimizations.
tanyaveksler Apr 16, 2024
d3dafb1
Merge branch 'master' into opt-finalize2
tanyaveksler Apr 16, 2024
c0b2ed1
Initial implementation of building and minimizing fw-rules directly f…
tanyaveksler Feb 25, 2024
bf949ff
Fixed lint errors.
tanyaveksler Mar 3, 2024
5532e4d
Updating (some of) expected results for explainability queries, accor…
tanyaveksler Mar 3, 2024
6e05b88
Fixed converting fw-rules to connectivity properties, while taking in…
tanyaveksler Mar 3, 2024
7a6f409
Optimized handling IpBlocks in optimized fw-rules minimization
tanyaveksler Mar 10, 2024
51eb02b
Optimized initial namespace grouping (by grouping few namespaces toge…
tanyaveksler Mar 17, 2024
fedb46f
Optimized initial namespace grouping (by grouping few namespaces toge…
tanyaveksler Mar 17, 2024
79454db
More optimization in calculation partial ns grouping.
tanyaveksler Mar 19, 2024
1d411e4
Fixed lint error
tanyaveksler Mar 19, 2024
11c15ff
Refining basic namespace grouping by finding more opportunities to us…
tanyaveksler Mar 24, 2024
e541498
One more refinemenet of basic namespace grouping
tanyaveksler Mar 24, 2024
63c2eca
One more refinemenet of basic namespace grouping
tanyaveksler Mar 24, 2024
6fb48d3
More refinemenets of peer grouping from properties
tanyaveksler Mar 26, 2024
4203525
More refinemenets of peer grouping from properties
tanyaveksler Mar 26, 2024
62aa803
More refinements of peer grouping from properties
tanyaveksler Mar 26, 2024
70d2aaf
Added outputEndpoints option handling to PeerSetElement.
tanyaveksler Mar 31, 2024
a98798f
Fixing lint errors.
tanyaveksler Mar 31, 2024
a5c9808
Fixing handling txt-no_fw_rules format in the optimized solution
tanyaveksler Apr 2, 2024
43d2e5b
Fixing lint error
tanyaveksler Apr 2, 2024
36edddf
Fix: taking into account connectivity restriction (TCP/non-TCP) in ge…
tanyaveksler Apr 2, 2024
91f13ff
Small fixes in txt_no_fw_rules_format
tanyaveksler Apr 2, 2024
55b2786
Small fixes in txt_no_fw_rules_format
tanyaveksler Apr 2, 2024
05de16f
Added grouping by dns entries to the optimized algorithm.
tanyaveksler Apr 7, 2024
9ad18b1
Changed expected results of connectivity map query tests according to…
tanyaveksler Apr 9, 2024
c11a3ae
Changed optimized semantic diff query implementation according to the…
tanyaveksler Apr 9, 2024
f591e4f
Keeping every dns entry separate in minimization of fw rules.
tanyaveksler Apr 9, 2024
5e5b1a4
Updated containment, permits, forbids expected results.
tanyaveksler Apr 14, 2024
5817b22
Cleaning up unused code and refactoring accordingly.
tanyaveksler Apr 14, 2024
1379379
Fixed lint error.
tanyaveksler Apr 14, 2024
8a0d7f2
Changed default to be the optimized run.
tanyaveksler Apr 14, 2024
91a6298
In opt='debug' the result explanation should ne according to the opti…
tanyaveksler Apr 14, 2024
7aaa0ba
Restoring resource in scheme, changed by mistake.
tanyaveksler Apr 14, 2024
f7cc420
Updating more expected results.
tanyaveksler Apr 14, 2024
43bb6f4
Small optimizations.
tanyaveksler Apr 16, 2024
0334ec1
Merge remote-tracking branch 'origin/opt-finalize2' into opt-finalize2
tanyaveksler Apr 16, 2024
d71e51f
Small optimizations.
tanyaveksler Apr 16, 2024
cb54265
Merge branch 'master' of https://github.com/IBM/network-config-analyz…
tanyaveksler Apr 16, 2024
e788779
Removed disjoint_ip_blocks from optimized solution
tanyaveksler Apr 16, 2024
15d2c65
Optimization: adding auto-connections to covered_peer_props (in fw-ru…
tanyaveksler Apr 30, 2024
a26b179
Optimization: adding resources to global resource/namespace/pod list …
tanyaveksler May 5, 2024
ef2596b
Merge branch 'master' into opt-finalize3
tanyaveksler May 5, 2024
cc432e3
Deleted unused original implementation code.
tanyaveksler May 7, 2024
e9b1e7f
Further refining code by deleting unused original implementatation code.
tanyaveksler May 7, 2024
511a634
Removed usage of ConnectionSet.
tanyaveksler May 19, 2024
8a443e8
Fixed lint errors.
tanyaveksler May 19, 2024
340d755
Fixed sorting ConnectivityProperties (making stable sort)
tanyaveksler May 19, 2024
204cea8
Fixed handling TCP / non-TCP connections output.
tanyaveksler May 21, 2024
7bb7132
More fixed expected results.
tanyaveksler May 21, 2024
3b30228
More fixed expected results.
tanyaveksler May 21, 2024
b769096
Added some doc
tanyaveksler May 21, 2024
c1dc05b
Removed no longer used named_ports and excluded_named_ports in Connec…
tanyaveksler May 21, 2024
4926dd9
Small fixes
tanyaveksler May 21, 2024
16869e8
Updates of some more expected results.
tanyaveksler Jun 2, 2024
e7cd7ae
Fixed lint errors.
tanyaveksler Jun 2, 2024
1d3ffe1
Small fix.
tanyaveksler Jun 2, 2024
1d9b1be
Small fix.
tanyaveksler Jun 2, 2024
13affc8
Some more refactoring of FWRule minimization code.
tanyaveksler Jun 4, 2024
019cf3e
Fixed lint error.
tanyaveksler Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixing handling txt-no_fw_rules format in the optimized solution
Signed-off-by: Tanya <tatyana@il.ibm.com>
tanyaveksler committed Apr 16, 2024
commit a5c980895b0e95c3da236dbd7990f799fdf641f2
13 changes: 13 additions & 0 deletions nca/CoreDS/Peer.py
Original file line number Diff line number Diff line change
@@ -575,6 +575,19 @@ def canonical_form(self):
# TODO: after moving to optimized HC implementation PeerSet may be always maintained in the canonical form
return PeerSet(self.get_set_without_ip_block()) | self.get_ip_block_canonical_form().get_peer_set()

def split(self):
"""
Splits self's IpBlocks into multiple IpBlock objects, each containing a single range
Return the resulting PeerSet
"""
res = PeerSet()
for peer in self:
if isinstance(peer, IpBlock):
res |= peer.split()
else:
res.add(peer)
return res

def __eq__(self, other):
# set comparison
if self.get_set_without_ip_block() != other.get_set_without_ip_block():
8 changes: 5 additions & 3 deletions nca/FWRules/ConnectivityGraph.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import itertools
from collections import defaultdict
import networkx
from nca.CoreDS.Peer import IpBlock, ClusterEP, Pod
from nca.CoreDS.Peer import IpBlock, ClusterEP, Pod, PeerSet
from .DotGraph import DotGraph
from .MinimizeFWRules import MinimizeBasic, MinimizeFWRules
from .ClusterInfo import ClusterInfo
@@ -60,8 +60,10 @@ def add_edges_from_cube_dict(self, conn_cube, peer_container):
"""
conns, src_peers, dst_peers = \
MinimizeBasic.get_connection_set_and_peers_from_cube(conn_cube, peer_container)
for src_peer in src_peers:
for dst_peer in dst_peers:
split_src_peers = src_peers.split()
split_dst_peers = dst_peers.split()
for src_peer in split_src_peers:
for dst_peer in split_dst_peers:
self.connections_to_peers[conns].append((src_peer, dst_peer))

def add_props_to_graph(self, props, peer_container):