Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: config gNBs and UPFs #194

Merged

Conversation

patriciareinoso
Copy link
Contributor

@patriciareinoso patriciareinoso commented Jul 1, 2024

Inventory Service

This feature adds endpoints to configure gNBs and UPFs.

gNB

  • GET /config/v1/inventory/gnb
  • POST inventory/gnb/:gnb-name
  • DELETE inventory/gnb/:gnb-name

UPF

  • GET /config/v1/inventory/upf
  • POST inventory/gnb/:upf-hostname
  • DELETE inventory/gnb/:upf-hostname

Usage

gNB

Get all gNBs

curl -v "${WEBUI_IP}:5000/config/v1/inventory/gnb"

Add a new gNB. tac parameter is mandatory.

curl -v "${WEBUI_IP}:5000/config/v1/inventory/gnb/gnb-2" \
--header 'Content-Type: application/json' \
--data '{
  "tac": "123"
}'

Remove a gNB.

curl -v -X DELETE "${WEBUI_IP}:5000/config/v1/inventory/gnb/gnb-2"

UPF

Get all UPFs

curl -v "${WEBUI_IP}:5000/config/v1/inventory/upf"

Add a new UPF. port parameter is mandatory.

curl -v "${WEBUI_IP}:5000/config/v1/inventory/upf/upf-1" \
--header 'Content-Type: application/json' \
--data '{
  "port": "123"
}'

Remove a UPF.

curl -v -X DELETE "${WEBUI_IP}:5000/config/v1/inventory/upf/upf-1"

Rationale

Canonical builds its own UI for WebConsole (we call it NMS). The NMS needs to retrieve a list of UPF and gNB to configure Network Slices, these parameters can be dynamically configured. Since the NMS is exported in static files and served by the Webconsole (#191), the NMS needs to retrieve these parameters from a webconsole service.
image

@thakurajayL
Copy link
Contributor

Provide sample UPF list file and gNB list file.

@patriciareinoso patriciareinoso marked this pull request as ready for review July 17, 2024 11:00
@patriciareinoso patriciareinoso marked this pull request as draft July 19, 2024 09:00
@patriciareinoso patriciareinoso marked this pull request as ready for review July 23, 2024 08:05
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
@patriciareinoso patriciareinoso force-pushed the feat-dynamic-param-service branch from f90462c to e36af39 Compare July 23, 2024 09:14
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
Signed-off-by: Patricia Reinoso <[email protected]>
@patriciareinoso patriciareinoso force-pushed the feat-dynamic-param-service branch from 9fc9da6 to 8dd0de4 Compare July 23, 2024 10:25
Signed-off-by: Patricia Reinoso <[email protected]>
@patriciareinoso patriciareinoso changed the title feat: dynamic parameter service feat: config gNBs and UPFS Jul 23, 2024
@patriciareinoso patriciareinoso changed the title feat: config gNBs and UPFS feat: config gNBs and UPFs Jul 23, 2024
@patriciareinoso
Copy link
Contributor Author

@gruyaume these changes do not use the build tag ui. is that ok?

@patriciareinoso patriciareinoso requested a review from gruyaume July 23, 2024 10:37
configapi/api_inventory.go Outdated Show resolved Hide resolved
configapi/api_inventory.go Show resolved Hide resolved
configmodels/model_inventory.go Outdated Show resolved Hide resolved
@gruyaume
Copy link
Contributor

@gruyaume these changes do not use the build tag ui. is that ok?

I think that's fine, they are not directly related to the ui and they won't break any existing behaviour.

Signed-off-by: Patricia Reinoso <[email protected]>
@gab-arrobo gab-arrobo requested a review from thakurajayL July 23, 2024 19:15
@patriciareinoso patriciareinoso requested a review from gruyaume July 25, 2024 14:04
Copy link
Contributor

@gruyaume gruyaume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving assuming this has been tested manually as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the tests :)

@patriciareinoso
Copy link
Contributor Author

@thakurajayL can we move forward with this PR?


type Upf struct {
Hostname string `json:"hostname"`
Port string `json:"port"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO you plan to port as 8805 or some other non standard port? SMF may be using default 8805 port.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using port 8805 and we intend to maintain consistency with the SMF by using the same port.

return fmt.Errorf("Failed to create UPF %v: %w", upfHostname, err)
}
if newUpf.Port == "" {
errorMessage := "Post UPF request body is missing port"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to know how UPF port is used and what it should be.

Copy link
Contributor Author

@patriciareinoso patriciareinoso Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UPF port is specified in the parameters when creating a new network slice.

    "upf": {
      "upf-name": "upf-external.testpcf.svc.cluster.local",
      "upf-port": "8805"
    }

We are keeping the UPF parameters consistent with what is asked for network slice creation, even if we use 8805.

@thakurajayL thakurajayL merged commit a4973b5 into omec-project:master Aug 2, 2024
8 checks passed
@patriciareinoso patriciareinoso deleted the feat-dynamic-param-service branch August 13, 2024 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants