Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
0eb62fe2
Verified
Commit
0eb62fe2
authored
5 months ago
by
Aleksandr Kurbatov
Committed by
Karel van Klink
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Patch to `create_nren_l3_core_service` from `update-nren-l3-lso-interaction`
parent
54a33604
No related branches found
No related tags found
1 merge request
!298
Add BFD configuration to Service binding ports
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/nren_l3_core_service/create_nren_l3_core_service.py
+47
-41
47 additions, 41 deletions
...flows/nren_l3_core_service/create_nren_l3_core_service.py
with
47 additions
and
41 deletions
gso/workflows/nren_l3_core_service/create_nren_l3_core_service.py
+
47
−
41
View file @
0eb62fe2
...
...
@@ -19,6 +19,7 @@ from gso.products.product_blocks.service_binding_port import ServiceBindingPortI
from
gso.products.product_types.edge_port
import
EdgePort
from
gso.products.product_types.nren_l3_core_service
import
NRENL3CoreService
,
NRENL3CoreServiceInactive
from
gso.services.lso_client
import
LSOState
,
lso_interaction
from
gso.services.partners
import
get_partner_by_id
from
gso.utils.helpers
import
(
active_edge_port_selector
,
partner_choice
,
...
...
@@ -148,60 +149,56 @@ def create_subscription(product: UUIDstr, partner: str) -> State:
@step
(
"
Initialize subscription
"
)
def
initialize_subscription
(
subscription
:
NRENL3CoreServiceInactive
,
edge_port
s
:
list
[
dict
]
,
binding_port_input
s
:
list
[
dict
]
,
product_name
:
str
subscription
:
NRENL3CoreServiceInactive
,
edge_port
:
dict
,
binding_port_input
:
dict
,
product_name
:
str
)
->
State
:
"""
Take all user inputs and use them to populate the subscription model.
"""
edge_port_fqdn_list
=
[]
for
edge_port_input
,
sbp_input
in
zip
(
edge_ports
,
binding_port_inputs
,
strict
=
False
):
edge_port_subscription
=
EdgePort
.
from_subscription
(
edge_port_input
[
"
edge_port
"
])
sbp_bgp_session_list
=
[]
for
session
in
sbp_input
[
"
bgp_peers
"
]:
bfd_settings
=
BFDSettings
.
new
(
subscription_id
=
uuid4
(),
**
session
.
pop
(
"
bfd_settings
"
))
sbp_bgp_session_list
.
append
(
BGPSession
.
new
(
subscription_id
=
uuid4
(),
**
session
,
bfd_settings
=
bfd_settings
,
rtbh_enabled
=
True
,
is_multi_hop
=
True
)
)
v4_bfd_settings
=
BFDSettings
.
new
(
subscription_id
=
uuid4
(),
**
sbp_input
.
pop
(
"
v4_bfd_settings
"
))
v6_bfd_settings
=
BFDSettings
.
new
(
subscription_id
=
uuid4
(),
**
sbp_input
.
pop
(
"
v6_bfd_settings
"
))
service_binding_port
=
ServiceBindingPortInactive
.
new
(
edge_port_subscription
=
EdgePort
.
from_subscription
(
edge_port
[
"
edge_port
"
])
sbp_bgp_session_list
=
[
BGPSession
.
new
(
subscription_id
=
uuid4
(),
**
session
,
rtbh_enabled
=
True
,
is_multi_hop
=
True
)
for
session
in
binding_port_input
[
"
bgp_peers
"
]
]
service_binding_port
=
ServiceBindingPortInactive
.
new
(
subscription_id
=
uuid4
(),
**
binding_port_input
,
bgp_session_list
=
sbp_bgp_session_list
,
sbp_type
=
SBPType
.
L3
,
edge_port
=
edge_port_subscription
.
edge_port
,
)
subscription
.
nren_l3_core_service
.
nren_ap_list
.
append
(
NRENAccessPortInactive
.
new
(
subscription_id
=
uuid4
(),
**
sbp_input
,
v4_bfd_settings
=
v4_bfd_settings
,
v6_bfd_settings
=
v6_bfd_settings
,
bgp_session_list
=
sbp_bgp_session_list
,
sbp_type
=
SBPType
.
L3
,
edge_port
=
edge_port_subscription
.
edge_port
,
ap_type
=
edge_port
[
"
ap_type
"
],
sbp
=
service_binding_port
,
)
subscription
.
nren_l3_core_service
.
nren_ap_list
.
append
(
NRENAccessPortInactive
.
new
(
subscription_id
=
uuid4
(),
ap_type
=
edge_port_input
[
"
ap_type
"
],
sbp
=
service_binding_port
,
)
)
edge_port_fqdn_list
.
append
(
edge_port_subscription
.
edge_port
.
node
.
router_fqdn
)
)
edge_port_fqdn_list
.
append
(
edge_port_subscription
.
edge_port
.
node
.
router_fqdn
)
subscription
.
description
=
f
"
{
product_name
}
service
"
partner_name
=
get_partner_by_id
(
subscription
.
customer_id
).
name
return
{
"
subscription
"
:
subscription
,
"
edge_port_fqdn_list
"
:
edge_port_fqdn_list
}
return
{
"
subscription
"
:
subscription
,
"
edge_port_fqdn_list
"
:
edge_port_fqdn_list
,
"
partner_name
"
:
partner_name
}
@step
(
"
[DRY RUN] Deploy service binding port
"
)
def
provision_sbp_dry
(
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
edge_port_fqdn_list
:
list
[
str
]
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
edge_port_fqdn_list
:
list
[
str
],
partner_name
:
str
)
->
LSOState
:
"""
Perform a dry run of deploying Service Binding Ports.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
dry_run
"
:
True
,
"
verb
"
:
"
deploy
"
,
"
object
"
:
"
sbp
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Deploy config for
{
subscription
[
"
description
"
]
}
"
,
}
return
{
"
playbook_name
"
:
"
manage_sbp
.yaml
"
,
"
playbook_name
"
:
"
gap_ansible/playbooks/nren_l3_core_service
.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
dict
.
fromkeys
(
edge_port_fqdn_list
)}},
"
extra_vars
"
:
extra_vars
,
}
...
...
@@ -209,19 +206,22 @@ def provision_sbp_dry(
@step
(
"
[FOR REAL] Deploy service binding port
"
)
def
provision_sbp_real
(
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
edge_port_fqdn_list
:
list
[
str
]
subscription
:
dict
[
str
,
Any
],
process_id
:
UUIDstr
,
tt_number
:
str
,
edge_port_fqdn_list
:
list
[
str
],
partner_name
:
str
)
->
LSOState
:
"""
Deploy Service Binding Ports.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
dry_run
"
:
False
,
"
verb
"
:
"
deploy
"
,
"
object
"
:
"
sbp
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Deploy config for
{
subscription
[
"
description
"
]
}
"
,
}
return
{
"
playbook_name
"
:
"
manage_sbp
.yaml
"
,
"
playbook_name
"
:
"
gap_ansible/playbooks/nren_l3_core_service
.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
dict
.
fromkeys
(
edge_port_fqdn_list
)}},
"
extra_vars
"
:
extra_vars
,
}
...
...
@@ -230,10 +230,10 @@ def provision_sbp_real(
@step
(
"
Check service binding port functionality
"
)
def
check_sbp_functionality
(
subscription
:
dict
[
str
,
Any
],
edge_port_fqdn_list
:
list
[
str
])
->
LSOState
:
"""
Check functionality of deployed Service Binding Ports.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
verb
"
:
"
check
"
}
extra_vars
=
{
"
subscription
"
:
subscription
,
"
verb
"
:
"
check
"
,
"
object
"
:
"
sbp
"
}
return
{
"
playbook_name
"
:
"
manage_sbp
.yaml
"
,
"
playbook_name
"
:
"
gap_ansible/playbooks/nren_l3_core_service
.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
dict
.
fromkeys
(
edge_port_fqdn_list
)}},
"
extra_vars
"
:
extra_vars
,
}
...
...
@@ -241,19 +241,22 @@ def check_sbp_functionality(subscription: dict[str, Any], edge_port_fqdn_list: l
@step
(
"
[DRY RUN] Deploy BGP peers
"
)
def
deploy_bgp_peers_dry
(
subscription
:
dict
[
str
,
Any
],
edge_port_fqdn_list
:
list
[
str
],
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
edge_port_fqdn_list
:
list
[
str
],
tt_number
:
str
,
process_id
:
UUIDstr
,
partner_name
:
str
)
->
LSOState
:
"""
Perform a dry run of deploying :term:`BGP` peers.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
verb
"
:
"
deploy
"
,
"
object
"
:
"
bgp
"
,
"
dry_run
"
:
True
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Deploying BGP peers for
{
subscription
[
"
description
"
]
}
"
,
}
return
{
"
playbook_name
"
:
"
manage_sbp
.yaml
"
,
"
playbook_name
"
:
"
gap_ansible/playbooks/nren_l3_core_service
.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
dict
.
fromkeys
(
edge_port_fqdn_list
)}},
"
extra_vars
"
:
extra_vars
,
}
...
...
@@ -261,19 +264,22 @@ def deploy_bgp_peers_dry(
@step
(
"
[FOR REAL] Deploy BGP peers
"
)
def
deploy_bgp_peers_real
(
subscription
:
dict
[
str
,
Any
],
edge_port_fqdn_list
:
list
[
str
],
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
edge_port_fqdn_list
:
list
[
str
],
tt_number
:
str
,
process_id
:
UUIDstr
,
partner_name
:
str
)
->
LSOState
:
"""
Deploy :term:`BGP` peers.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
partner_name
"
:
partner_name
,
"
verb
"
:
"
deploy
"
,
"
object
"
:
"
bgp
"
,
"
dry_run
"
:
False
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Deploying BGP peers for
{
subscription
[
"
description
"
]
}
"
,
}
return
{
"
playbook_name
"
:
"
manage_sbp
.yaml
"
,
"
playbook_name
"
:
"
gap_ansible/playbooks/nren_l3_core_service
.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
dict
.
fromkeys
(
edge_port_fqdn_list
)}},
"
extra_vars
"
:
extra_vars
,
}
...
...
@@ -282,10 +288,10 @@ def deploy_bgp_peers_real(
@step
(
"
Check BGP peers
"
)
def
check_bgp_peers
(
subscription
:
dict
[
str
,
Any
],
edge_port_fqdn_list
:
list
[
str
])
->
LSOState
:
"""
Check correct deployment of :term:`BGP` peers.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
verb
"
:
"
check
"
}
extra_vars
=
{
"
subscription
"
:
subscription
,
"
verb
"
:
"
check
"
,
"
object
"
:
"
bgp
"
}
return
{
"
playbook_name
"
:
"
manage_sbp
.yaml
"
,
"
playbook_name
"
:
"
gap_ansible/playbooks/nren_l3_core_service
.yaml
"
,
"
inventory
"
:
{
"
all
"
:
{
"
hosts
"
:
dict
.
fromkeys
(
edge_port_fqdn_list
)}},
"
extra_vars
"
:
extra_vars
,
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment