Skip to content

Commit

Permalink
Merge branch 'main' into remove-use-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
gatici authored Jan 15, 2025
2 parents 379639e + 5546543 commit ef90d28
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 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`
13 changes: 7 additions & 6 deletions components/NetworkSliceGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
<MainTable
headers={[
{
content: deviceGroup?.["group-name"] || "N/A",
content: deviceGroup?.["group-name"] || "",
style: { textTransform: "none" },
},
{
content:
Expand All @@ -177,7 +178,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
content:
deviceGroup?.["ip-domain-expanded"]?.[
"ue-ip-pool"
] || "N/A",
] || "",

className: "u-align--right",
},
Expand All @@ -190,7 +191,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
content:
deviceGroup?.["ip-domain-expanded"]?.[
"dns-primary"
] || "N/A",
] || "",

className: "u-align--right",
},
Expand All @@ -203,7 +204,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
content:
deviceGroup?.["ip-domain-expanded"]?.[
"mtu"
] || "N/A",
] || "",

className: "u-align--right",
},
Expand All @@ -222,7 +223,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
"ue-dnn-qos"
]?.["dnn-mbr-downlink"] / 1_000_000
} Mbps`
: "N/A",
: "",
className: "u-align--right",
},
],
Expand All @@ -240,7 +241,7 @@ export const NetworkSliceGroups: React.FC<NetworkSliceTableProps> = ({
"ue-dnn-qos"
]?.["dnn-mbr-uplink"] / 1_000_000
} Mbps`
: "N/A",
: "",
className: "u-align--right",
},
],
Expand Down
5 changes: 4 additions & 1 deletion components/NetworkSliceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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
18 changes: 11 additions & 7 deletions components/NetworkSliceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
columns: [
{ content: "MCC" },
{
content: slice["site-info"]?.plmn.mcc || "N/A",
content: slice["site-info"]?.plmn.mcc || "",
className: "u-align--right",
},
],
Expand All @@ -66,7 +66,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
columns: [
{ content: "MNC" },
{
content: slice["site-info"]?.plmn.mnc || "N/A",
content: slice["site-info"]?.plmn.mnc || "",
className: "u-align--right",
},
],
Expand All @@ -76,10 +76,14 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
columns: [
{ content: "UPF" },
{
content: `${slice["site-info"]?.upf?.["upf-name"] || "N/A"}:${
slice["site-info"]?.upf?.["upf-port"] || "N/A"
}`,

content: (() => {
const upfName = slice["site-info"]?.upf?.["upf-name"] ?? "";
const upfPort = slice["site-info"]?.upf?.["upf-port"] ?? "";
if (upfName === "" && upfPort === "") {
return "";
}
return `${upfName}:${upfPort}`;
})(),
className: "u-align--right",
},
],
Expand All @@ -90,7 +94,7 @@ export const NetworkSliceTable: React.FC<NetworkSliceTableProps> = ({
{ content: "gNodeBs" },
{
content:
slice?.["site-info"]?.gNodeBs?.length.toString() || "N/A",
slice?.["site-info"]?.gNodeBs?.length.toString() || "0",
className: "u-align--right",
},
],
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 ef90d28

Please sign in to comment.