summaryrefslogtreecommitdiffstats
path: root/clover/controller/process
diff options
context:
space:
mode:
authorEddie Arrage <eddie.arrage@huawei.com>2018-06-28 17:42:28 +0000
committerEddie Arrage <eddie.arrage@huawei.com>2018-07-31 03:39:28 +0000
commitf38f41124db707b390e8f21c1a91e1022b3633ab (patch)
tree434392d7104140ebf65ef7542bf325471e1d7e73 /clover/controller/process
parent1f543c55dd426a34ab3cafa514fa446c22b6fa03 (diff)
Implement initial clover-controller service
- First pass of clover-controller which resides within the k8s cluster and provides interfaces to all Clover services - Only service that should need to be exposed outside of cluster - Docker build of container that uses stack of nginx, gunicorn and flask to provide REST interface - REST interface is intended to serve cloverctl CLI and dashboard browser UI - Implements GRPC messaging to clover-collector and snort - GRPC interfaces files for snort/nginx are added to container from repo. Collector GRPC files will be removed from controller/control/api once patch below is merged https://gerrit.opnfv.org/gerrit/#/c/57245/ and added similarly - Provides first pass callback for file upload from clover-server. - Some REST messages implement JSON for passing params to internal services - Redis interface added to obtain data from services. Currently, a simple interface to retrieve snort event information - YAML manifest renderer to add to k8s. Uses NodePort service currently, defaulting to port 32044. - Removed collector gRPC interface files with merge of collector - Expose tracing and monitoring host/port parameters, as these vary depending on Istio version and Jaeger version - Add logging to flask blueprints - Added jmeter blueprint interface with REST for testplan generation, start test and result retrieval - Added flask Response to REST reply messages - Retrieve some basic stats from collector in json response Change-Id: I59eaeb860445ade4b45bba22747a61fb0cf0bbd4 Signed-off-by: Eddie Arrage <eddie.arrage@huawei.com>
Diffstat (limited to 'clover/controller/process')
-rw-r--r--clover/controller/process/__init__.py11
-rwxr-xr-xclover/controller/process/gunicorn_process.sh11
-rw-r--r--clover/controller/process/nginx.conf18
-rwxr-xr-xclover/controller/process/nginx_process.sh11
-rwxr-xr-xclover/controller/process/start_process.sh15
5 files changed, 66 insertions, 0 deletions
diff --git a/clover/controller/process/__init__.py b/clover/controller/process/__init__.py
new file mode 100644
index 0000000..d67a6c0
--- /dev/null
+++ b/clover/controller/process/__init__.py
@@ -0,0 +1,11 @@
+from flask import Flask, Response
+
+
+app = Flask(__name__)
+
+@app.route("/")
+def index():
+ return Response("It works!"), 200
+
+if __name__ == "__main__":
+ app.run(debug=True)
diff --git a/clover/controller/process/gunicorn_process.sh b/clover/controller/process/gunicorn_process.sh
new file mode 100755
index 0000000..033596f
--- /dev/null
+++ b/clover/controller/process/gunicorn_process.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Copyright (c) Authors of Clover
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+gunicorn --bind 0.0.0.0:8000 --chdir /control wsgi
diff --git a/clover/controller/process/nginx.conf b/clover/controller/process/nginx.conf
new file mode 100644
index 0000000..5b26922
--- /dev/null
+++ b/clover/controller/process/nginx.conf
@@ -0,0 +1,18 @@
+worker_processes auto;
+pid /run/nginx.pid;
+
+events {
+ worker_connections 768;
+}
+
+
+http {
+ server {
+ listen 80;
+
+ location / {
+ include proxy_params;
+ proxy_pass http://localhost:8000;
+ }
+ }
+}
diff --git a/clover/controller/process/nginx_process.sh b/clover/controller/process/nginx_process.sh
new file mode 100755
index 0000000..953719d
--- /dev/null
+++ b/clover/controller/process/nginx_process.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Copyright (c) Authors of Clover
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+service nginx restart
diff --git a/clover/controller/process/start_process.sh b/clover/controller/process/start_process.sh
new file mode 100755
index 0000000..0c8ce11
--- /dev/null
+++ b/clover/controller/process/start_process.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+#
+# Copyright (c) Authors of Clover
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+# Start nginx
+./nginx_process.sh
+
+# Start gunicorn
+./gunicorn_process.sh