Skip to content

Commit

Permalink
feat: support empty UPF field in NS
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciareinoso committed Jan 14, 2025
1 parent 51da225 commit ae40842
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ This target will produce the webconsole binary with the static export of NMS emb

### `make rock`

This target will produce a `sdcore-nms.rock` OCI image file, which will have the webconsole binary as a service. It will use the master branch of webconsole by default.
If you want to use a specific tag for the webconsole repo, you must switch to the branch/tag in ./build/webconsole-src
This target will produce a `sdcore-nms.rock` OCI image file, which will have the webconsole binary as a service. It will use the master branch of webconsole by default.
If you want to use a specific tag for the webconsole repository, you must switch to the branch/tag in ./build/webconsole-src

`rockcraft` must be installed to use this option.

### `make deploy`

This target will create an LXC VM called `nms`, install docker, deploy the `NMS` and `MongoDB` OCI image, create a valid config file for `NMS`, and start the program.
After the process is done, from your host machine you can run `lxc list`, and use the IP address to connect to both mongodb and NMS. The port for NMS is `:5000` and the port for mongodb is `:27017`.
After the process is done, from your host machine you can run `lxc list`, and use the IP address to connect to both MongoDB and NMS. The port for NMS is `:5000` and the port for MongoDB is `:27017`.

`make rock` must have successfully completed and `lxd` must be installed to use this option.

Expand Down Expand Up @@ -67,7 +67,7 @@ for them are stored in the `/artifacts` folder. Any files used in the build proc

### Webconsole binary

`go` and `nodejs` is required to build webconsole.
`go` and `nodejs` are required to build webconsole.

The `make webconsole` target is responsible for producing the binary that serves the NMS frontend. Once run, it will:

Expand All @@ -83,7 +83,7 @@ The binary will need to be run with a config file. An example is available in th

`rockcraft` is required to create the OCI image.

The rock can be built with `rockcraft pack`. This process will use the local NMS and a predefined tag of webconsole repo to create an OCI image. The webconsole branch/tag is defined in the `rockcraft.yaml` file.
The rock can be built with `rockcraft pack`. This process will use the local NMS and a predefined tag of webconsole repository to create an OCI image. The webconsole branch/tag is defined in the `rockcraft.yaml` file.

The `make rock` target modifies this build process by directly using the `build/webconsole-src` directory. This allows you to use a local version of webconsole in the OCI image instead of having to pull from the specified tag in `rockcraft.yaml`. This is useful if you want to test changes to the backend rather than the frontend. The process is:

Expand All @@ -93,7 +93,7 @@ The `make rock` target modifies this build process by directly using the `build/

## Deploy

The binary requires a config file and an available mongodb deployment to operate. By default, the path for the config file is `./config/webuicfg.yaml` from the directory of the binary. The OCI image does not come with a config file preconfigured, but the repo contains an example at `examples/config/webuicfg.yaml`.
The binary requires a config file and an available MongoDB deployment to operate. By default, the path for the config file is `./config/webuicfg.yaml` from the directory of the binary. The OCI image does not come with a config file preconfigured, but the repository contains an example at `examples/config/webuicfg.yaml`.

`make deploy` takes care of quickly getting a running program. It will:

Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ A Network Management System for managing the Aether SD-Core 5G core network.

## Usage

NMS needs to be configured with the following environment variables:
- `WEBUI_ENDPOINT`: The endpoint of the webui. This is used to redirect the swagger operations to the webui.

The NMS has a swagger UI page that rus by default on `localhost`. If the NMS will run remotely, set the following environment.
```console
export WEBUI_ENDPOINT=10.1.182.28:5000
export WEBUI_ENDPOINT=<NMS-ip>:5000
```

Run the NMS as follows:

```console
docker pull ghcr.io/canonical/sdcore-nms:1.1.0
docker run -it --env WEBUI_ENDPOINT ghcr.io/canonical/sdcore-nms:1.1.0
docker run -it --env WEBUI_ENDPOINT -v <path-to-config-file>:/config/webuicfg.yaml -p 5000:5000 ghcr.io/canonical/sdcore-nms:1.1.0
```

An example of the config file can be found in `examples/config/webuicfg.yaml`
5 changes: 4 additions & 1 deletion components/NetworkSliceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ const NetworkSliceModal = ({ networkSlice, toggleModal, onSave }: NetworkSliceMo

const getUpfFromNetworkSlice = () => {
if (networkSlice) {
return { hostname: networkSlice["site-info"]["upf"]["upf-name"], port: networkSlice["site-info"]["upf"]["upf-port"] };
return {
hostname: networkSlice["site-info"]?.["upf"]?.["upf-name"] ?? "",
port: networkSlice["site-info"]?.["upf"]?.["upf-port"] ?? "",
};
} else {
return {} as UpfItem;
}
Expand Down
1 change: 1 addition & 0 deletions utils/editNetworkSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const editNetworkSlice = async ({
sliceData["site-info"]["plmn"].mcc = mcc
sliceData["site-info"]["plmn"].mnc = mnc
sliceData["site-info"]["gNodeBs"] = gnbList
sliceData["site-info"]["upf"] = sliceData["site-info"]["upf"] ?? {};
sliceData["site-info"]["upf"]["upf-name"] = upfName
sliceData["site-info"]["upf"]["upf-port"] = upfPort

Expand Down

0 comments on commit ae40842

Please sign in to comment.