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
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
78f91b3f
Verified
Commit
78f91b3f
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
add TWAMP deployment workflow
parent
a8f77fa7
No related branches found
No related tags found
1 merge request
!129
Add workflow for TWAMP deployment
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gso/translations/en-GB.json
+1
-0
1 addition, 0 deletions
gso/translations/en-GB.json
gso/workflows/__init__.py
+1
-0
1 addition, 0 deletions
gso/workflows/__init__.py
gso/workflows/iptrunk/deploy_twamp.py
+86
-0
86 additions, 0 deletions
gso/workflows/iptrunk/deploy_twamp.py
with
88 additions
and
0 deletions
gso/translations/en-GB.json
+
1
−
0
View file @
78f91b3f
...
...
@@ -37,6 +37,7 @@
},
"workflow"
:
{
"confirm_info"
:
"Please verify this form looks correct."
,
"deploy_twamp"
:
"Deploy TWAMP"
,
"migrate_iptrunk"
:
"Migrate IP Trunk"
,
"modify_isis_metric"
:
"Modify the ISIS metric"
,
"modify_trunk_interface"
:
"Modify IP Trunk interface"
,
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/__init__.py
+
1
−
0
View file @
78f91b3f
...
...
@@ -3,6 +3,7 @@
from
orchestrator.workflows
import
LazyWorkflowInstance
LazyWorkflowInstance
(
"
gso.workflows.iptrunk.create_iptrunk
"
,
"
create_iptrunk
"
)
LazyWorkflowInstance
(
"
gso.workflows.iptrunk.deploy_twamp
"
,
"
deploy_twamp
"
)
LazyWorkflowInstance
(
"
gso.workflows.iptrunk.modify_isis_metric
"
,
"
modify_isis_metric
"
)
LazyWorkflowInstance
(
"
gso.workflows.iptrunk.modify_trunk_interface
"
,
"
modify_trunk_interface
"
)
LazyWorkflowInstance
(
"
gso.workflows.iptrunk.migrate_iptrunk
"
,
"
migrate_iptrunk
"
)
...
...
This diff is collapsed.
Click to expand it.
gso/workflows/iptrunk/deploy_twamp.py
0 → 100644
+
86
−
0
View file @
78f91b3f
""""
Workflow for adding TWAMP to an existing IP trunk.
"""
from
orchestrator.forms
import
FormPage
from
orchestrator.forms.validators
import
Label
from
orchestrator.targets
import
Target
from
orchestrator.types
import
FormGenerator
,
State
,
UUIDstr
from
orchestrator.workflow
import
StepList
,
done
,
init
,
step
,
workflow
from
orchestrator.workflows.steps
import
resync
,
store_process_subscription
,
unsync
from
orchestrator.workflows.utils
import
wrap_modify_initial_input_form
from
gso.products.product_types.iptrunk
import
Iptrunk
from
gso.services.provisioning_proxy
import
execute_playbook
,
pp_interaction
def
_initial_input_form_generator
(
subscription_id
:
UUIDstr
)
->
FormGenerator
:
trunk
=
Iptrunk
.
from_subscription
(
subscription_id
)
class
DeployTWAMPForm
(
FormPage
):
info_label
:
Label
=
(
"
Please confirm deployment of TWAMP on IP trunk from
"
f
"
{
trunk
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
to
"
f
"
{
trunk
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
"
# type: ignore[assignment]
)
yield
DeployTWAMPForm
return
{
"
subscription
"
:
trunk
}
@step
(
"
[DRY RUN] Deploy TWAMP on both sides
"
)
def
deploy_twamp_dry
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
)
->
State
:
"""
Perform a dry run of deploying the TWAMP session.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
process_id
"
:
process_id
,
"
dry_run
"
:
True
,
}
inventory
=
(
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
"
f
"
\n
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
"
)
execute_playbook
(
"
deploy_twamp.yaml
"
,
callback_route
,
inventory
,
extra_vars
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Deploy TWAMP on both sides
"
)
def
deploy_twamp_real
(
subscription
:
Iptrunk
,
process_id
:
UUIDstr
,
callback_route
:
str
)
->
State
:
"""
Deploy the TWAMP session.
"""
extra_vars
=
{
"
subscription
"
:
subscription
,
"
process_id
"
:
process_id
,
"
dry_run
"
:
False
,
}
inventory
=
(
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
"
f
"
\n
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
"
)
execute_playbook
(
"
deploy_twamp.yaml
"
,
callback_route
,
inventory
,
extra_vars
)
return
{
"
subscription
"
:
subscription
}
@workflow
(
"
Deploy TWAMP
"
,
initial_input_form
=
wrap_modify_initial_input_form
(
_initial_input_form_generator
),
target
=
Target
.
MODIFY
,
)
def
deploy_twamp
()
->
StepList
:
"""
Deploy a TWAMP session on an IP trunk.
* Run the TWAMP playbook, including an initial dry run
"""
return
(
init
>>
store_process_subscription
(
Target
.
MODIFY
)
>>
unsync
>>
pp_interaction
(
deploy_twamp_dry
)
>>
pp_interaction
(
deploy_twamp_real
)
>>
resync
>>
done
)
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