Skip to content

Commit b964238

Browse files
committed
Updated Agentic project with new features and playbooks
1 parent bbcd6df commit b964238

30 files changed

+5008
-3
lines changed

agentic/dashboard.html

Lines changed: 1056 additions & 0 deletions
Large diffs are not rendered by default.

agentic/dashboard.js

Lines changed: 1173 additions & 0 deletions
Large diffs are not rendered by default.

agentic/main_new.py

Lines changed: 2161 additions & 0 deletions
Large diffs are not rendered by default.

agentic/playbooks/.ipynb_checkpoints/adjust_upf_load_balancing-checkpoint.yml

Whitespace-only changes.

agentic/playbooks/.ipynb_checkpoints/ansible-checkpoint.cfg

Whitespace-only changes.

agentic/playbooks/.ipynb_checkpoints/inventory-checkpoint.ini

Whitespace-only changes.

agentic/playbooks/.ipynb_checkpoints/resource_optimization-checkpoint.yml

Whitespace-only changes.

agentic/playbooks/.ipynb_checkpoints/restart_smf_service-checkpoint.yml

Whitespace-only changes.

agentic/playbooks/.ipynb_checkpoints/scale_amf_resources-checkpoint.yml

Whitespace-only changes.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
- name: Adjust UPF Load Balancing
3+
hosts: localhost
4+
gather_facts: no
5+
vars:
6+
load_threshold: "{{ threshold | default(80) }}"
7+
component: "{{ component | default('upf') }}"
8+
anomaly_id: "{{ anomaly_id | default('unknown') }}"
9+
severity: "{{ severity | default('MEDIUM') }}"
10+
optimization_level: "{{ 'aggressive' if severity == 'CRITICAL' else 'standard' }}"
11+
12+
tasks:
13+
- name: Log load balancing action start
14+
debug:
15+
msg: |
16+
=================================================
17+
ANSIBLE PLAYBOOK EXECUTION STARTED
18+
=================================================
19+
Playbook: Adjust UPF Load Balancing
20+
Anomaly ID: {{ anomaly_id }}
21+
Component: {{ component }}
22+
Severity: {{ severity }}
23+
Load Threshold: {{ load_threshold }}%
24+
Optimization: {{ optimization_level }}
25+
Timestamp: {{ ansible_date_time.iso8601 }}
26+
=================================================
27+
28+
- name: Analyze current UPF load distribution
29+
debug:
30+
msg: |
31+
DEMO: Current load analysis:
32+
- Primary UPF: 95% utilization (HIGH)
33+
- Secondary UPF: 45% utilization (NORMAL)
34+
- Backup UPF: 20% utilization (LOW)
35+
- Latency impact: +30ms average
36+
37+
- name: Calculate optimal load distribution
38+
debug:
39+
msg: |
40+
DEMO: Calculating optimal distribution:
41+
- Target threshold: {{ load_threshold }}%
42+
- New distribution: 70% / 65% / 40%
43+
- Expected latency reduction: -25ms
44+
45+
- name: Backup current load balancer configuration
46+
debug:
47+
msg: "DEMO: Creating backup of current load balancer rules"
48+
49+
- name: Update UPF load balancer weights
50+
debug:
51+
msg: |
52+
DEMO: Updating load balancer configuration:
53+
54+
upstream upf_backend {
55+
server upf-primary:8080 weight=3;
56+
server upf-secondary:8080 weight=3;
57+
server upf-backup:8080 weight=2;
58+
least_conn;
59+
keepalive 32;
60+
}
61+
62+
- name: Apply traffic routing optimizations
63+
debug:
64+
msg: |
65+
DEMO: Applying traffic routing rules:
66+
- High priority traffic: Direct to least loaded UPF
67+
- Normal traffic: Round-robin distribution
68+
- Background traffic: Route to backup UPF
69+
70+
- name: Configure connection pooling
71+
debug:
72+
msg: |
73+
DEMO: Optimizing connection pools:
74+
- Max connections per UPF: 1000
75+
- Connection timeout: 5s
76+
- Keep-alive: 300s
77+
- Health check interval: 10s
78+
79+
- name: Update quality of service rules
80+
debug:
81+
msg: |
82+
DEMO: QoS configuration updated:
83+
- Voice calls: Priority queue
84+
- Video streaming: Guaranteed bandwidth
85+
- Data transfer: Best effort
86+
87+
- name: Apply configuration changes
88+
debug:
89+
msg: "DEMO: Reloading load balancer with new configuration (graceful reload)"
90+
91+
- name: Wait for configuration propagation
92+
debug:
93+
msg: "DEMO: Waiting for configuration to propagate across all UPF instances"
94+
95+
- name: Verify load distribution
96+
debug:
97+
msg: |
98+
DEMO: Post-adjustment verification:
99+
- Primary UPF: 72% utilization (OPTIMAL)
100+
- Secondary UPF: 68% utilization (OPTIMAL)
101+
- Backup UPF: 42% utilization (OPTIMAL)
102+
- Average latency: 38ms (-27ms improvement)
103+
104+
- name: Run performance tests
105+
debug:
106+
msg: |
107+
DEMO: Performance test results:
108+
- Throughput: 1.2 Gbps (+200 Mbps)
109+
- Packet loss: 0.001% (-0.004%)
110+
- Jitter: 2ms (-6ms)
111+
- Connection success rate: 99.98%
112+
113+
- name: Log load balancing completion
114+
debug:
115+
msg: |
116+
=================================================
117+
ANSIBLE PLAYBOOK EXECUTION COMPLETED
118+
=================================================
119+
Result: SUCCESS
120+
Action: UPF load balancing optimized
121+
Latency improvement: -27ms
122+
Throughput increase: +200 Mbps
123+
Load distribution: BALANCED
124+
Duration: ~60 seconds
125+
=================================================
126+
127+
- name: Create execution report
128+
debug:
129+
msg: |
130+
Execution Summary:
131+
- Anomaly {{ anomaly_id }} addressed
132+
- UPF load balancing optimized
133+
- Latency reduced by 27ms
134+
- Throughput increased by 200 Mbps
135+
- All UPF instances within optimal range
136+
- Monitor for 20 minutes to ensure stability

agentic/playbooks/ansible.cfg

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[defaults]
2+
inventory = inventory.ini
3+
host_key_checking = False
4+
timeout = 30
5+
gathering = explicit
6+
display_skipped_hosts = False
7+
display_ok_hosts = True
8+
stdout_callback = yaml
9+
bin_ansible_callbacks = True
10+
11+
[inventory]
12+
enable_plugins = ini
13+
14+
[ssh_connection]
15+
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
16+
pipelining = True

agentic/playbooks/group_vars/.ipynb_checkpoints/all-checkpoint.yml

Whitespace-only changes.

agentic/playbooks/group_vars/all.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# Global variables for all playbooks
3+
demo_mode: true
4+
environment: "development"
5+
monitoring_enabled: true
6+
notification_webhook: "http://localhost:30080/webhook"
7+
8+
# Default resource limits
9+
default_cpu_limit: "2000m"
10+
default_memory_limit: "4Gi"
11+
12+
# Network optimization defaults
13+
default_load_threshold: 80
14+
default_timeout: 30
15+
16+
# Kubernetes namespace
17+
k8s_namespace: "5g-core"
18+
19+
# Logging configuration
20+
log_level: "INFO"
21+
log_retention_days: 7
22+
23+
# Health check settings
24+
health_check_interval: 30
25+
health_check_timeout: 10

agentic/playbooks/inventory.ini

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[5g_core]
2+
localhost ansible_connection=local
3+
4+
[amf_nodes]
5+
localhost ansible_connection=local
6+
7+
[smf_nodes]
8+
localhost ansible_connection=local
9+
10+
[upf_nodes]
11+
localhost ansible_connection=local
12+
13+
[all_5g_nodes:children]
14+
amf_nodes
15+
smf_nodes
16+
upf_nodes
17+
18+
[all_5g_nodes:vars]
19+
ansible_python_interpreter=/usr/bin/python3
20+
demo_mode=true
21+
environment=development
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
---
2+
- name: Optimize Network Resources
3+
hosts: localhost
4+
gather_facts: yes
5+
vars:
6+
component: "{{ component | default('all') }}"
7+
anomaly_id: "{{ anomaly_id | default('unknown') }}"
8+
severity: "{{ severity | default('MEDIUM') }}"
9+
optimization_scope: "{{ 'full' if severity == 'CRITICAL' else 'targeted' }}"
10+
11+
tasks:
12+
- name: Log optimization action start
13+
debug:
14+
msg: |
15+
=================================================
16+
ANSIBLE PLAYBOOK EXECUTION STARTED
17+
=================================================
18+
Playbook: Optimize Network Resources
19+
Anomaly ID: {{ anomaly_id }}
20+
Component: {{ component }}
21+
Severity: {{ severity }}
22+
Scope: {{ optimization_scope }}
23+
Target: All 5G Core components
24+
Timestamp: {{ ansible_date_time.iso8601 }}
25+
=================================================
26+
27+
- name: Perform system health assessment
28+
debug:
29+
msg: |
30+
DEMO: System health assessment:
31+
- CPU utilization: 78% (HIGH)
32+
- Memory usage: 85% (HIGH)
33+
- Network I/O: 92% (CRITICAL)
34+
- Disk I/O: 45% (NORMAL)
35+
- Cache hit ratio: 67% (SUBOPTIMAL)
36+
37+
- name: Clear system caches
38+
debug:
39+
msg: |
40+
DEMO: Executing cache optimization:
41+
echo 3 > /proc/sys/vm/drop_caches
42+
43+
Cache statistics:
44+
- Page cache freed: 2.1 GB
45+
- Buffer cache freed: 512 MB
46+
- Inode cache freed: 256 MB
47+
- Total memory reclaimed: 2.9 GB
48+
49+
- name: Optimize network buffer sizes
50+
debug:
51+
msg: |
52+
DEMO: Updating network buffer configurations:
53+
54+
/etc/sysctl.conf updates:
55+
net.core.rmem_max = 268435456 # 256MB receive buffer
56+
net.core.wmem_max = 268435456 # 256MB send buffer
57+
net.ipv4.tcp_rmem = 4096 87380 268435456
58+
net.ipv4.tcp_wmem = 4096 65536 268435456
59+
net.core.netdev_max_backlog = 30000
60+
net.ipv4.tcp_congestion_control = bbr
61+
62+
- name: Optimize database connections
63+
debug:
64+
msg: |
65+
DEMO: Database optimization:
66+
- Connection pool size: Increased to 200
67+
- Query cache: Cleared and optimized
68+
- Index analysis: Completed
69+
- Slow queries: Identified and optimized
70+
71+
- name: Clean up temporary files
72+
debug:
73+
msg: |
74+
DEMO: Cleanup operations:
75+
- Temporary files removed: 1.2 GB
76+
- Log rotation applied: 800 MB freed
77+
- Core dumps cleaned: 2.1 GB
78+
- Old container images: 5.2 GB
79+
80+
- name: Optimize container resource limits
81+
debug:
82+
msg: |
83+
DEMO: Container resource optimization:
84+
85+
AMF containers:
86+
- CPU limit: 2000m → 2500m
87+
- Memory limit: 4Gi → 5Gi
88+
89+
SMF containers:
90+
- CPU limit: 1500m → 2000m
91+
- Memory limit: 3Gi → 4Gi
92+
93+
UPF containers:
94+
- CPU limit: 3000m → 3500m
95+
- Memory limit: 6Gi → 7Gi
96+
97+
- name: Apply CPU governor optimizations
98+
debug:
99+
msg: |
100+
DEMO: CPU performance optimization:
101+
- Governor: ondemand → performance
102+
- CPU frequency scaling: Disabled
103+
- Turbo boost: Enabled
104+
- CPU affinity: Optimized for network workloads
105+
106+
- name: Optimize network interface parameters
107+
debug:
108+
msg: |
109+
DEMO: Network interface optimization:
110+
- Ring buffer size: Increased
111+
- Interrupt coalescing: Optimized
112+
- RSS (Receive Side Scaling): Enabled
113+
- GRO (Generic Receive Offload): Enabled
114+
115+
- name: Update monitoring thresholds
116+
debug:
117+
msg: |
118+
DEMO: Monitoring threshold updates:
119+
- CPU alert threshold: 80% → 85%
120+
- Memory alert threshold: 85% → 90%
121+
- Network utilization: 90% → 95%
122+
- Response time SLA: Adjusted for new baseline
123+
124+
- name: Restart affected services with optimization
125+
debug:
126+
msg: |
127+
DEMO: Service restart sequence:
128+
1. AMF services: Rolling restart (0 downtime)
129+
2. SMF services: Rolling restart (0 downtime)
130+
3. UPF services: Blue-green deployment
131+
4. Load balancers: Configuration reload
132+
133+
- name: Verify system performance
134+
debug:
135+
msg: |
136+
DEMO: Post-optimization verification:
137+
- CPU utilization: 78% → 62% (-16%)
138+
- Memory usage: 85% → 68% (-17%)
139+
- Network I/O: 92% → 74% (-18%)
140+
- Response time: 45ms → 32ms (-29%)
141+
- Throughput: +35% improvement
142+
143+
- name: Run comprehensive health check
144+
debug:
145+
msg: |
146+
DEMO: System health check results:
147+
✅ All 5G core services: HEALTHY
148+
✅ Database connectivity: OPTIMAL
149+
✅ Network performance: IMPROVED
150+
✅ Resource utilization: BALANCED
151+
✅ SLA compliance: 99.9%
152+
153+
- name: Log optimization completion
154+
debug:
155+
msg: |
156+
=================================================
157+
ANSIBLE PLAYBOOK EXECUTION COMPLETED
158+
=================================================
159+
Result: SUCCESS
160+
Action: Comprehensive resource optimization
161+
Performance improvement: +35%
162+
Memory freed: 2.9 GB
163+
Response time: -29%
164+
Status: All systems optimal
165+
Duration: ~120 seconds
166+
=================================================
167+
168+
- name: Create execution report
169+
debug:
170+
msg: |
171+
Execution Summary:
172+
- Anomaly {{ anomaly_id }} addressed
173+
- System-wide optimization completed
174+
- Performance improved by 35%
175+
- Memory usage reduced by 17%
176+
- Network efficiency increased by 18%
177+
- All SLA targets met
178+
- Extended monitoring for 30 minutes recommended
179+
180+
Optimization Actions Taken:
181+
1. System cache clearing
182+
2. Network buffer optimization
183+
3. Database connection tuning
184+
4. Container resource scaling
185+
5. CPU performance optimization
186+
6. Network interface tuning
187+
7. Service restart with zero downtime

0 commit comments

Comments
 (0)