Fixed a bug WebUI for production build (#1824)

This commit is contained in:
Sukchan Lee 2022-10-28 14:44:06 +09:00
parent b9f6432e54
commit f1c0b6d239
13 changed files with 5556 additions and 5077 deletions

View File

@ -1,52 +1,32 @@
Docker running example Docker running example
=========================================== ===========================================
* Build Image * Development
`$ docker-compose build` `$ docker compose run dev`
* Development * Run WebUI
`$ docker-compose run dev` `$ docker-compose up webui`
* Runtime
```
$ docker-compose \
-f docker-compose.yml -f docker-compose.run.yml run run
```
* Test * Test
```
$ docker-compose \
-f docker-compose.yml -f docker-compose.test.yml run test
```
* Test(ubuntu:artful) `$ docker compose run test`
```
$ TAG=eoan docker-compose build * Test(ubuntu:focal)
$ TAG=eoan docker-compose \
-f docker-compose.yml -f docker-compose.test.yml run test `$ TAG=focal docker compose run test`
```
* Development(fedora:latest) * Development(fedora:latest)
```
$ DIST=fedora docker-compose build
$ DIST=fedora docker-compose run dev
```
* Runtime(debian:jessie) `$ DIST=fedora docker compose run dev`
```
$ DIST=debian TAG=stretch docker-compose build
$ DIST=debian TAG=stretch docker-compose
-f docker-compose.yml -f docker-compose.run.yml run run
```
* All Test with All Environment * All Test with All Environment
`$ ./check.sh` `$ ./check.sh`
* Run WebUI * Runtime
`$ docker-compose up -d` `$ docker compose run run`
For OpenSUSE Build Service Release For OpenSUSE Build Service Release
=========================================== ===========================================

View File

@ -1,15 +1,9 @@
#!/bin/sh #!/bin/sh
docker-compose build docker-compose run --rm test
docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test TAG=focal docker-compose run --rm test
DIST=fedora docker-compose run --rm test
TAG=bionic docker-compose build DIST=debian docker-compose run --rm test
TAG=bionic docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test #DIST=alpine docker-compose run --rm test
DIST=fedora TAG=32 docker-compose build
DIST=fedora TAG=32 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
DIST=debian docker-compose build
DIST=debian docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
docker rm $(docker ps -qa --no-trunc --filter "status=exited") docker rm $(docker ps -qa --no-trunc --filter "status=exited")

View File

@ -1,22 +0,0 @@
version: '3'
services:
run:
network_mode: "host"
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
- config:/etc/open5gs
hostname: open5gs-run
command: /bin/bash -c "/root/setup.sh; /usr/bin/open5gs-pcrfd -D; /usr/bin/open5gs-pgwd -D; /usr/bin/open5gs-sgwd -D; /usr/bin/open5gs-hssd -D; /usr/bin/open5gs-mmed"
volumes:
config: {}

View File

@ -1,18 +0,0 @@
version: '3'
services:
test:
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
environment:
DB_URI: mongodb://mongodb/open5gs
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
hostname: open5gs-test
command: /bin/bash -c "/root/setup.sh; cd /open5gs/build && meson test -v"

View File

@ -44,6 +44,39 @@ services:
- base - base
command: /bin/bash -c "echo 'build' services" command: /bin/bash -c "echo 'build' services"
run:
# network_mode: "host"
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
volumes:
- config:/etc/open5gs
hostname: open5gs-run
# command: /bin/bash -c "/root/setup.sh; /usr/bin/open5gs-pcrfd -D; /usr/bin/open5gs-pgwd -D; /usr/bin/open5gs-sgwd -D; /usr/bin/open5gs-hssd -D; /usr/bin/open5gs-mmed"
test:
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-open5gs-build
depends_on:
- mongodb
- build
environment:
DB_URI: mongodb://mongodb/open5gs
cap_add:
- NET_ADMIN
devices:
- "/dev/net/tun:/dev/net/tun"
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
hostname: open5gs-test
command: /bin/bash -c "/root/setup.sh; cd /open5gs/build && meson test -v"
dev: dev:
build: build:
context: ./${DIST-ubuntu}/${TAG-latest}/dev context: ./${DIST-ubuntu}/${TAG-latest}/dev
@ -83,3 +116,4 @@ services:
volumes: volumes:
mongodb: {} mongodb: {}
home: {} home: {}
config: {}

View File

@ -1,9 +1,9 @@
FROM node:carbon FROM node:19
MAINTAINER Sukchan Lee <acetcom@gmail.com> MAINTAINER Sukchan Lee <acetcom@gmail.com>
ARG PACKAGE=open5gs ARG PACKAGE=open5gs
ARG VERSION=2.5.0 ARG VERSION=2.5.1
RUN set -e; \ RUN set -e; \
cd /usr/src; \ cd /usr/src; \
@ -13,7 +13,7 @@ RUN set -e; \
mv ./$PACKAGE-$VERSION/ ./$PACKAGE; mv ./$PACKAGE-$VERSION/ ./$PACKAGE;
WORKDIR /usr/src/open5gs/webui WORKDIR /usr/src/open5gs/webui
RUN npm install && \ RUN npm clean-install && \
npm run build npm run build
CMD npm run start CMD npm run start

View File

@ -185,7 +185,7 @@ The WebUI allows you to interactively edit subscriber data. While it is not esse
```bash ```bash
$ sudo apt update $ sudo apt update
$ sudo apt install curl $ sudo apt install curl
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - $ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ sudo apt install nodejs $ sudo apt install nodejs
``` ```

View File

@ -418,7 +418,7 @@ $ ./build/tests/app/app ## Both 5G Core and EPC with ./build/configs/sample.yaml
```bash ```bash
$ sudo apt install curl $ sudo apt install curl
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - $ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ sudo apt install nodejs $ sudo apt install nodejs
``` ```

View File

@ -184,7 +184,7 @@ $ sudo apt install open5gs
The following shows how to install the Web UI of Open5GS. The following shows how to install the Web UI of Open5GS.
```bash ```bash
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - $ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ sudo apt install nodejs $ sudo apt install nodejs
$ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash - $ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash -
``` ```

View File

@ -10,7 +10,7 @@
# #
PACKAGE="open5gs" PACKAGE="open5gs"
VERSION="2.5.0" VERSION="2.5.1"
print_status() { print_status() {
echo echo

10474
webui/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
{ {
"name": "open5gs", "name": "open5gs",
"version": "2.5.0", "version": "2.5.1",
"description": "Open5gs", "description": "Open5gs",
"main": "index.js", "main": "index.js",
"repository": "https://github.com/open5gs/open5gs/webui", "repository": "https://github.com/open5gs/open5gs/webui",
"author": "Open5gs Group", "author": "Open5gs Group",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"dependencies": { "dependencies": {
"axios": "^1.1.3", "axios": "^0.27.2",
"babel-plugin-polished": "^1.1.0", "babel-plugin-polished": "^1.1.0",
"babel-plugin-styled-components": "^2.0.7", "babel-plugin-styled-components": "^2.0.7",
"body-parser": "^1.20.1", "body-parser": "^1.20.1",
@ -38,7 +38,7 @@
"react-icons": "^2.2.5", "react-icons": "^2.2.5",
"react-jsonschema-form": "^0.50.1", "react-jsonschema-form": "^0.50.1",
"react-notification-system": "^0.2.17", "react-notification-system": "^0.2.17",
"react-onclickoutside": "^6.12.2", "react-onclickoutside": "^6.7.1",
"react-redux": "^5.0.7", "react-redux": "^5.0.7",
"react-transition-group": "^1.1.3", "react-transition-group": "^1.1.3",
"redux": "^3.7.2", "redux": "^3.7.2",

View File

@ -38,7 +38,8 @@ co(function* () {
} }
const db = yield mongoose.connect(process.env.DB_URI, { const db = yield mongoose.connect(process.env.DB_URI, {
useNewUrlParser: true, useNewUrlParser: true,
useUnifiedTopology: true useUnifiedTopology: true,
serverSelectionTimeoutMS: 1000
/* other options */ /* other options */
}) })