Commit b9fe45e6 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'feat/webui' into 'develop'

First version of the WebUI

See merge request teraflow-h2020/controller!73
parents 0d715111 7b2637c6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ include:
  #- local: '/src/tester_integration/.gitlab-ci.yml'
  #- local: '/src/tester_functional/.gitlab-ci.yml'
  - local: '/src/automation/.gitlab-ci.yml'
  - local: '/src/webui/.gitlab-ci.yml'
  # - local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
  # - local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml'
  # - local: '/src/l3_attackmitigator/.gitlab-ci.yml'
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ REGISTRY_IMAGE=""
#REGISTRY_IMAGE="http://my-container-registry.local/"

# Set the list of components you want to build images for, and deploy.
COMPONENTS="context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector"
COMPONENTS="context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"

# Set the tag you want to use for your images.
IMAGE_TAG="tf-dev"
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ pip install --upgrade pip setuptools wheel pip-tools pylint pytest pytest-benchm
echo "" > requirements.in

#TODO: include here your component
COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving"
COMPONENTS="compute context device service monitoring opticalcentralizedattackdetector opticalattackmitigator dbscanserving webui"

# compiling dependencies from all components
for component in $COMPONENTS
+72 −0
Original line number Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  name: webuiservice
spec:
  selector:
    matchLabels:
      app: webuiservice
  template:
    metadata:
      labels:
        app: webuiservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
      - name: server
        image: registry.gitlab.com/teraflow-h2020/controller/webui:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 8004 # TODO: define the real port
        env:
        - name: LOG_LEVEL
          value: "DEBUG"
        readinessProbe:
          httpGet:
            path: /healthz/ready
            port: 8004
          initialDelaySeconds: 5
          timeoutSeconds: 1
        livenessProbe:
          httpGet:
            path: /healthz/live
            port: 8004
          initialDelaySeconds: 5
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 250m
            memory: 512Mi
          limits:
            cpu: 700m
            memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: webuiservice
spec:
  type: ClusterIP
  selector:
    app: webuiservice
  ports:
  - name: http
    port: 8004
    targetPort: 8004
---
# apiVersion: v1
# kind: Service
# metadata:
#   name: webuiservice-public
#   labels:
#     app: webuiservice
# spec:
#   type: NodePort
#   selector:
#     app: webuiservice
#   ports:
#   - name: http
#     protocol: TCP
#     port: 8004
#     targetPort: 8004
---

open_webui.sh

0 → 100755
+12 −0
Original line number Diff line number Diff line
# this script opens the webui

WEBUI_PROTO=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.ports[0].name}'`
WEBUI_IP=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.clusterIP}'`
WEBUI_PORT=`kubectl get service/webuiservice -n tf-dev -o jsonpath='{.spec.ports[0].port}'`
URL=${WEBUI_PROTO}://${WEBUI_IP}:${WEBUI_PORT}

echo Opening web UI on URL ${URL}

# curl -kL ${URL}

python3 -m webbrowser ${URL}
 No newline at end of file
Loading