Skip to content
Snippets Groups Projects
Commit 02665bfa authored by JORGE SASIAIN's avatar JORGE SASIAIN
Browse files

Merge branch 'develop-patch' into 'develop'

Develop patch

See merge request goat/geant-service-orchestrator!2
parents 48be8c9d 80cb3065
No related branches found
Tags 2.28
1 merge request!2Develop patch
...@@ -2,3 +2,4 @@ __pycache__/ ...@@ -2,3 +2,4 @@ __pycache__/
*.egg-info *.egg-info
.coverage .coverage
coverage.xml coverage.xml
.tox/
## Modeling of Trunk service in WFO ## Modeling of Trunk service in WFO
### Products & fixed inputs ### Products & fixed inputs
- Trunk - Trunk
- Reference to PB Trunk - Reference to PB Trunk
- TrunkConfig - TrunkConfig
- Reference to PB TrunkConfig - Reference to PB TrunkConfig
- TrunkConfigCommon - TrunkConfigCommon
- Reference to PB TrunkConfigCommon - Reference to PB TrunkConfigCommon
- TrunkConfigSide - TrunkConfigSide
- Reference to PB TrunkConfigSide - Reference to PB TrunkConfigSide
### Product blocks & resource types ### Product blocks & resource types
- Trunk - Trunk
- Id - Id
- GeantSSid - GeantSSid
- Name - Name
- TrunkConfig - TrunkConfig
- Id - Id
- Reference to PB Trunk - Reference to PB Trunk
- TrunkConfigCommon - TrunkConfigCommon
- Id - Id
- Speed - Speed
- IsLeasedLine - IsLeasedLine
- IsIsMetric - IsIsMetric
- MinimumLinks - MinimumLinks
- Reference to PB TrunkConfig - Reference to PB TrunkConfig
- TrunkConfigSide - TrunkConfigSide
- Id - Id
- Name - Name
- AEName - AEName
- GeantASid - GeantASid
- IPv4Address - IPv4Address
- IPv6Address - IPv6Address
- Members (How to model arrays?) - Members (How to model arrays?)
- Reference to PB TrunkConfig - Reference to PB TrunkConfig
### Doubts related to products ### Doubts related to products
Does “optional” in a resource in the provisioning stage make sense for attributes that the end user does not choose? The provision step in the workflow is used to create the ID and call whatever management system to provision the actual product. Does "optional" just mean that in the final subscription the parameter can be left empty by the user? Does “optional” in a resource in the provisioning stage make sense for attributes that the end user does not choose? The provision step in the workflow is used to create the ID and call whatever management system to provision the actual product. Does "optional" just mean that in the final subscription the parameter can be left empty by the user?
**Optional means that the user is allowed to submit the process/subscription with the resource left empty.**
How to enforce that each TrunkConfig has exactly 2 TrunkConfigSide? n the workflow, in the selector of the parent product block, in Choice you can specify min_items and max_items. But in my case hierarchy is in the opposite direction (I can select multiple trunk_config from trunk_config_side but not the other way around). So it seems this can't be enforced by WFO?
How to enforce that each TrunkConfig has exactly 2 TrunkConfigSide? n the workflow, in the selector of the parent product block, in Choice you can specify min_items and max_items. But in my case hierarchy is in the opposite direction (I can select multiple trunk_config from trunk_config_side but not the other way around). So it seems this can't be enforced by WFO?
How hierarchy should be (TrunkConfig contains product block reference to Trunk like it is now, or the opposite)? As it’s now, you make a Trunk first, and in TrunkConfig input you select a Trunk. Then in TrunkConfigCommon and TrunkConfigSide input you select a TrunkConfig. **You can create two TrunkConfigSide's that refer to the same TrunkConfig block (but this is not enforced, you can have 0, 1, or 3+, like with other products)**
### Workflows How hierarchy should be (TrunkConfig contains product block reference to Trunk like it is now, or the opposite)? As it’s now, you make a Trunk first, and in TrunkConfig input you select a Trunk. Then in TrunkConfigCommon and TrunkConfigSide input you select a TrunkConfig.
- Create / Modify? / Terminate for:
- Trunk ### Workflows
- TrunkConfig - Create / Modify? / Terminate for:
- TrunkConfigCommon - Trunk
- TrunkConfigSide - TrunkConfig
- TrunkConfigCommon
### Workflow doubts - TrunkConfigSide
In the example tutorial, _provision_in_group_management_system, a hash is created from something like the user_name and that builds the user_id. Does this mean that user_name is unique? How is this enforced?
### Workflow doubts
Can you select which resource types are “fixed” in the modify workflow once the subscription of a trunk service is Active? In the example tutorial, _provision_in_group_management_system, a hash is created from something like the user_name and that builds the user_id. Does this mean that user_name is unique? How is this enforced?
If I update the python code of a workflow but its name and associated product stays the same, do I have to do anything to reflect its update (e.g. delete the workflow in a migration then add it again, or just add it again, or do nothing)? Can you select which resource types are “fixed” in the modify workflow once the subscription of a trunk service is Active?
I have a workflow called “create_trunk”, which is a workflow of the product type called “Trunk”. If I update the python code of a workflow but its name and associated product stays the same, do I have to do anything to reflect its update (e.g. delete the workflow in a migration then add it again, or just add it again, or do nothing)?
I get this error when trying to “Create new process / subscription” in the GUI after registering the workflows, and also by doing a POST to http://10.98.1.62:8080/api/processes/create_trunk: **Nothing needs to be done**
``INFO: 10.98.1.62:53656 - "POST /api/processes/create_trunk HTTP/1.1" 404 Not Found``
Is process the same as subscription? If not, what’s the endpoint/way to create a subscription from a workflow? I have a workflow called “create_trunk”, which is a workflow of the product type called “Trunk”.
I get this error when trying to “Create new process / subscription” in the GUI after registering the workflows, and also by doing a POST to http://10.98.1.62:8080/api/processes/create_trunk:
## Resources ``INFO: 10.98.1.62:53656 - "POST /api/processes/create_trunk HTTP/1.1" 404 Not Found``
WFO API: Is process the same as subscription? If not, what’s the endpoint/way to create a subscription from a workflow?
https://workfloworchestrator.org/orchestrator-core/architecture/application/api/ (Swagger) **Running products DB migration again fixed this (even though I think I submitted exactly the same data...)**
https://github.com/workfloworchestrator/orchestrator-core/tree/main/orchestrator/api/api_v1/endpoints
## TODO
Carolina notes: - Fix flake8 errors for main.py products and workflows imports
https://wiki.geant.org/pages/viewpage.action?pageId=562921625 - Integrate provision step (in CreateTrunkConfigSide) with IPAM/Infoblox
## Resources
WFO API:
https://workfloworchestrator.org/orchestrator-core/architecture/application/api/ (Swagger)
https://github.com/workfloworchestrator/orchestrator-core/tree/main/orchestrator/api/api_v1/endpoints
Carolina notes:
https://wiki.geant.org/pages/viewpage.action?pageId=562921625
...@@ -2,8 +2,8 @@ from orchestrator import OrchestratorCore ...@@ -2,8 +2,8 @@ from orchestrator import OrchestratorCore
from orchestrator.cli.main import app as core_cli from orchestrator.cli.main import app as core_cli
from orchestrator.settings import AppSettings from orchestrator.settings import AppSettings
# from geant_service_orchestrator import products import products
# from geant_service_orchestrator import workflows import workflows
app = OrchestratorCore(base_settings=AppSettings()) app = OrchestratorCore(base_settings=AppSettings())
......
import random from random import randint
from typing import List from typing import List
from uuid import uuid4 from uuid import uuid4
...@@ -57,7 +57,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: ...@@ -57,7 +57,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
def _provision_in_gap() -> int: def _provision_in_gap() -> int:
return random.randint(0, 2147483648) return randint(0, 2147483648)
@step("Create subscription") @step("Create subscription")
......
from random import randint
from typing import List from typing import List
from uuid import uuid4 from uuid import uuid4
from random import randint
from orchestrator.db.models import ProductTable, SubscriptionTable from orchestrator.db.models import ProductTable, SubscriptionTable
from orchestrator.forms import FormPage from orchestrator.forms import FormPage
......
...@@ -43,6 +43,25 @@ def trunk_config_selector() -> list: ...@@ -43,6 +43,25 @@ def trunk_config_selector() -> list:
) )
def member_selector() -> list:
interfaces_dict = {
"ge-0/0/1": "ge-0/0/1",
"ge-0/0/2": "ge-0/0/2",
"ge-0/0/3": "ge-0/0/3",
"ge-0/0/4": "ge-0/0/4",
"ge-0/0/5": "ge-0/0/5"
}
return choice_list(
Choice("Member Interfaces", zip(
interfaces_dict.keys(),
interfaces_dict.items())), # type:ignore
min_items=1,
max_items=4,
unique_items=True,
)
def initial_input_form_generator(product_name: str) -> FormGenerator: def initial_input_form_generator(product_name: str) -> FormGenerator:
class CreateTrunkConfigSideForm(FormPage): class CreateTrunkConfigSideForm(FormPage):
class Config: class Config:
...@@ -53,7 +72,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator: ...@@ -53,7 +72,7 @@ def initial_input_form_generator(product_name: str) -> FormGenerator:
geant_a_sid: str geant_a_sid: str
ipv4_address: Optional[str] ipv4_address: Optional[str]
ipv6_address: Optional[str] ipv6_address: Optional[str]
members: List[str] members: member_selector() # type:ignore
trunk_config_ids: trunk_config_selector() # type:ignore trunk_config_ids: trunk_config_selector() # type:ignore
user_input = yield CreateTrunkConfigSideForm user_input = yield CreateTrunkConfigSideForm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment