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
ef7e1874
Commit
ef7e1874
authored
9 months ago
by
Aleksandr Kurbatov
Browse files
Options
Downloads
Patches
Plain Diff
add PE-P and PE-PE mesh functions to workflow_steps
parent
1e30ade7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/utils/workflow_steps.py
+331
-11
331 additions, 11 deletions
gso/utils/workflow_steps.py
with
331 additions
and
11 deletions
gso/utils/workflow_steps.py
+
331
−
11
View file @
ef7e1874
...
@@ -12,7 +12,6 @@ from pydantic_forms.core import FormPage
...
@@ -12,7 +12,6 @@ from pydantic_forms.core import FormPage
from
pydantic_forms.types
import
FormGenerator
from
pydantic_forms.types
import
FormGenerator
from
pydantic_forms.validators
import
Label
from
pydantic_forms.validators
import
Label
from
gso.products.product_blocks
import
router
from
gso.products.product_blocks.router
import
RouterRole
from
gso.products.product_blocks.router
import
RouterRole
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.services
import
lso_client
from
gso.services
import
lso_client
...
@@ -95,8 +94,10 @@ def _update_sdp_single_pe(
...
@@ -95,8 +94,10 @@ def _update_sdp_single_pe(
f
"
Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers
"
,
f
"
Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers
"
,
"
verb
"
:
"
update_sdp_mesh
"
,
"
verb
"
:
"
update_sdp_mesh
"
,
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
router
.
RouterRole
.
PE
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
router_role
=
RouterRole
.
PE
,
),
router_vendor
=
Vendor
.
NOKIA
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]],
)[
"
all
"
][
"
hosts
"
],
}
}
lso_client
.
execute_playbook
(
lso_client
.
execute_playbook
(
...
@@ -107,6 +108,267 @@ def _update_sdp_single_pe(
...
@@ -107,6 +108,267 @@ def _update_sdp_single_pe(
)
)
def
_add_pe_mesh_to_pe
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
*
,
dry_run
:
bool
,
)
->
None
:
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
subscription
"
:
subscription
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Add list of PE routers into iGEANT/iGEANT6 groups of the PE router
"
,
"
verb
"
:
"
add_pe_mesh_to_pe
"
,
"
pe_router_list
"
:
generate_inventory_for_active_routers
(
router_role
=
RouterRole
.
PE
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)[
"
all
"
][
"
hosts
"
],
}
lso_client
.
execute_playbook
(
playbook_name
=
"
update_ibgp_mesh.yaml
"
,
callback_route
=
callback_route
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
def
_add_pe_to_pe_mesh
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
*
,
dry_run
:
bool
,
)
->
None
:
inventory
=
generate_inventory_for_active_routers
(
router_role
=
RouterRole
.
PE
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
subscription
"
:
subscription
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Add the PE router to all PE routers in iGEANT/iGEANT6.
"
,
"
verb
"
:
"
add_pe_to_pe_mesh
"
,
}
lso_client
.
execute_playbook
(
playbook_name
=
"
update_ibgp_mesh.yaml
"
,
callback_route
=
callback_route
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
def
_add_all_p_to_pe
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
*
,
dry_run
:
bool
,
)
->
None
:
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
subscription
"
:
subscription
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Add all P-routers to this new PE
"
,
"
verb
"
:
"
add_all_p_to_pe
"
,
"
p_router_list
"
:
generate_inventory_for_active_routers
(
router_role
=
RouterRole
.
P
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)[
"
all
"
][
"
hosts
"
],
}
lso_client
.
execute_playbook
(
playbook_name
=
"
update_ibgp_mesh.yaml
"
,
callback_route
=
callback_route
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
def
_add_pe_to_all_p
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
*
,
dry_run
:
bool
,
)
->
None
:
inventory
=
generate_inventory_for_active_routers
(
router_role
=
RouterRole
.
P
,
exclude_routers
=
[
subscription
[
"
router
"
][
"
router_fqdn
"
]]
)
extra_vars
=
{
"
dry_run
"
:
dry_run
,
"
subscription
"
:
subscription
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
-
"
f
"
Add promoted router to all PE routers in iGEANT/iGEANT6
"
,
"
verb
"
:
"
add_pe_to_all_p
"
,
}
lso_client
.
execute_playbook
(
playbook_name
=
"
update_ibgp_mesh.yaml
"
,
callback_route
=
callback_route
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
@step
(
"
[DRY RUN] Add the PE to all P routers
"
)
def
add_pe_to_all_p_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a dry run of adding the PE router to all P routers.
"""
_add_pe_to_all_p
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
True
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Add the PE to all P routers
"
)
def
add_pe_to_all_p_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a real run of adding the PE router to all P routers.
"""
_add_pe_to_all_p
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
False
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[DRY RUN] Add all P routers to the PE
"
)
def
add_all_p_to_pe_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a dry run of adding all P routers to the PE router.
"""
_add_all_p_to_pe
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
True
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Add all P routers to the PE
"
)
def
add_all_p_to_pe_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a real run of adding all P routers to the PE router.
"""
_add_all_p_to_pe
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
False
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[DRY RUN] Add the PE to PE mesh
"
)
def
add_pe_to_pe_mesh_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a dry run of adding the PE router to all PE routers in iGEANT/iGEANT6.
"""
_add_pe_to_pe_mesh
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
True
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Add the PE to PE mesh
"
)
def
add_pe_to_pe_mesh_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a dry run of adding the PE router to all PE routers in iGEANT/iGEANT6.
"""
_add_pe_to_pe_mesh
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
False
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[DRY RUN] Add PE mesh to the PE
"
)
def
add_pe_mesh_to_pe_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a dry run of adding list of PE routers into iGEANT/iGEANT6 of the router.
"""
_add_pe_mesh_to_pe
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
True
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Add PE mesh to the PE
"
)
def
add_pe_mesh_to_pe_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a real run of adding list of PE routers into iGEANT/iGEANT6 of the router.
"""
_add_pe_mesh_to_pe
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
False
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[DRY RUN] Deploy base config
"
)
@step
(
"
[DRY RUN] Deploy base config
"
)
def
deploy_base_config_dry
(
def
deploy_base_config_dry
(
subscription
:
dict
[
str
,
Any
],
subscription
:
dict
[
str
,
Any
],
...
@@ -133,42 +395,66 @@ def deploy_base_config_real(
...
@@ -133,42 +395,66 @@ def deploy_base_config_real(
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
@step
(
"
[DRY RUN] Include
new
PE into SDP mesh on other Nokia PEs
"
)
@step
(
"
[DRY RUN] Include
the
PE into SDP mesh on other Nokia PEs
"
)
def
update_sdp_mesh_dry
(
def
update_sdp_mesh_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
State
:
"""
Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers.
"""
"""
Perform a dry run of including new PE router in SDP mesh on other NOKIA PE routers.
"""
_update_sdp_mesh
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
True
)
_update_sdp_mesh
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
True
,
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Include
new
PE into SDP mesh on other Nokia PEs
"
)
@step
(
"
[FOR REAL] Include
the
PE into SDP mesh on other Nokia PEs
"
)
def
update_sdp_mesh_real
(
def
update_sdp_mesh_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
State
:
"""
Include new PE router in SDP mesh on other NOKIA PE routers.
"""
"""
Include new PE router in SDP mesh on other NOKIA PE routers.
"""
_update_sdp_mesh
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
False
)
_update_sdp_mesh
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
False
,
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
@step
(
"
[DRY RUN] Configure SDP on
a new
PE to all other Nokia PEs
"
)
@step
(
"
[DRY RUN] Configure SDP on
the
PE to all other Nokia PEs
"
)
def
update_sdp_single_pe_dry
(
def
update_sdp_single_pe_dry
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
State
:
"""
Perform a dry run of configuring SDP on a new PE router to all other NOKIA PE routers.
"""
"""
Perform a dry run of configuring SDP on a new PE router to all other NOKIA PE routers.
"""
_update_sdp_single_pe
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
True
)
_update_sdp_single_pe
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
True
,
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Configure SDP on
a new
PE to all other Nokia PEs
"
)
@step
(
"
[FOR REAL] Configure SDP on
the
PE to all other Nokia PEs
"
)
def
update_sdp_single_pe_real
(
def
update_sdp_single_pe_real
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
,
tt_number
:
str
,
process_id
:
UUIDstr
)
->
State
:
)
->
State
:
"""
Configure SDP on a new PE router to all other NOKIA PE routers.
"""
"""
Configure SDP on a new PE router to all other NOKIA PE routers.
"""
_update_sdp_single_pe
(
subscription
,
tt_number
,
callback_route
,
process_id
,
dry_run
=
False
)
_update_sdp_single_pe
(
subscription
=
subscription
,
tt_number
=
tt_number
,
callback_route
=
callback_route
,
process_id
=
process_id
,
dry_run
=
False
,
)
return
{
"
subscription
"
:
subscription
}
return
{
"
subscription
"
:
subscription
}
...
@@ -213,6 +499,40 @@ def run_checks_after_base_config(subscription: dict[str, Any], callback_route: s
...
@@ -213,6 +499,40 @@ def run_checks_after_base_config(subscription: dict[str, Any], callback_route: s
)
)
@step
(
"
Check PE iBGP sessions
"
)
def
check_pe_ibgp
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
)
->
None
:
"""
Check the iBGP session.
"""
extra_vars
=
{
"
dry_run
"
:
False
,
"
subscription
"
:
subscription
,
"
verb
"
:
"
check_pe_ibgp
"
,
}
lso_client
.
execute_playbook
(
playbook_name
=
"
check_ibgp.yaml
"
,
callback_route
=
callback_route
,
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
],
extra_vars
=
extra_vars
,
)
@step
(
"
Check L3 VPRN services
"
)
def
check_l3_services
(
subscription
:
dict
[
str
,
Any
],
callback_route
:
str
)
->
None
:
"""
Check L3 services.
"""
extra_vars
=
{
"
dry_run
"
:
False
,
"
subscription
"
:
subscription
,
"
verb
"
:
"
check_base_ris
"
,
}
lso_client
.
execute_playbook
(
playbook_name
=
"
check_l3_services.yaml
"
,
callback_route
=
callback_route
,
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
],
extra_vars
=
extra_vars
,
)
@inputstep
(
"
Prompt for new SharePoint checklist
"
,
assignee
=
Assignee
.
SYSTEM
)
@inputstep
(
"
Prompt for new SharePoint checklist
"
,
assignee
=
Assignee
.
SYSTEM
)
def
prompt_sharepoint_checklist_url
(
checklist_url
:
str
)
->
FormGenerator
:
def
prompt_sharepoint_checklist_url
(
checklist_url
:
str
)
->
FormGenerator
:
"""
Prompt the operator with the checklist in SharePoint for approving a new subscription.
"""
"""
Prompt the operator with the checklist in SharePoint for approving a new subscription.
"""
...
...
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