Skip to content
Snippets Groups Projects
Commit b47f4a0a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of https://labs.etsi.org/rep/tfs/controller into feat/hackfest3

parents 5fc6376d 36233be1
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!164Merge 3rd hackfest material to develop
Showing
with 42 additions and 123 deletions
......@@ -32,7 +32,7 @@ include:
- local: '/src/opticalattackmitigator/.gitlab-ci.yml'
- local: '/src/opticalattackdetector/.gitlab-ci.yml'
# - local: '/src/opticalattackmanager/.gitlab-ci.yml'
- local: '/src/automation/.gitlab-ci.yml'
- local: '/src/ztp/.gitlab-ci.yml'
- local: '/src/policy/.gitlab-ci.yml'
#- local: '/src/webui/.gitlab-ci.yml'
#- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
......
......@@ -40,7 +40,7 @@ components deployed.
## Impacted Components
List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, Automation, Policy, Compute, etc.
List of impacted components: Context, Device, Service, PathComp, Slice, Monitoring, ZTP, Policy, Compute, etc.
Just an enumeration, elaboration of impacts is done below.
## Component1 Impact
......
......@@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"}
# If not already set, set the list of components, separated by spaces, you want to build images for, and deploy.
# By default, only basic components are deployed
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"}
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice compute webui load_generator"}
# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}
......
......@@ -59,7 +59,7 @@ for COMPONENT in $TFS_COMPONENTS; do
echo " Building Docker image..."
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log"
if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then
if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then
docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
elif [ "$COMPONENT" == "pathcomp" ]; then
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log"
......
......@@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"}
# If not already set, set the list of components, separated by spaces, you want to build images for, and deploy.
# By default, only basic components are deployed
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation monitoring pathcomp service slice compute webui load_generator"}
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice compute webui load_generator"}
# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}
......@@ -207,7 +207,7 @@ for COMPONENT in $TFS_COMPONENTS; do
echo " Building Docker image..."
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log"
if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then
if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then
$DOCKER_BUILD -t "$COMPONENT:$TFS_IMAGE_TAG" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
elif [ "$COMPONENT" == "pathcomp" ]; then
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}-frontend.log"
......
......@@ -21,7 +21,7 @@
export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"}
# If not already set, set the list of components you want to build images for, and deploy.
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector l3_attackmitigator l3_centralizedattackdetector webui"}
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector l3_attackmitigator l3_centralizedattackdetector webui"}
########################################################################################################################
# Automated steps start here
......
......@@ -16,7 +16,7 @@
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
export TFS_COMPONENTS="context device automation service compute monitoring webui"
export TFS_COMPONENTS="context device ztp service compute monitoring webui"
# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
......
......@@ -16,7 +16,7 @@
# If not already set, set the list of components you want to install dependencies for.
# By default, dependencies for all components are installed.
# Components still not supported by this script:
# automation & policy : implemented in Java
# ztp & policy : implemented in Java
# dlt : under design
# pathcomp : under design
ALL_COMPONENTS="context device service compute monitoring webui interdomain slice"
......@@ -38,7 +38,7 @@ printf "\n"
echo "Collecting requirements from components..."
for COMPONENT in $TFS_COMPONENTS
do
if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then continue; fi
if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then continue; fi
diff requirements.in src/$COMPONENT/requirements.in | grep '^>' | sed 's/^>\ //' >> requirements.in
done
printf "\n"
......
......@@ -277,9 +277,9 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: monitoring # namespace where prometheus is running
name: tfs-automationservice-metric
name: tfs-ztpservice-metric
labels:
app: automationservice
app: ztpservice
#release: prometheus
#release: prom # name of the release
# ( VERY IMPORTANT: You need to know the correct release name by viewing
......@@ -290,7 +290,7 @@ spec:
matchLabels:
# Target app service
#namespace: tfs
app: automationservice # same as above
app: ztpservice # same as above
#release: prometheus # same as above
endpoints:
- port: metrics # named port in target app
......@@ -474,4 +474,4 @@ spec:
namespaceSelector:
any: false
matchNames:
- tfs # namespace where the app is running
\ No newline at end of file
- tfs # namespace where the app is running
......@@ -19,9 +19,9 @@ metadata:
annotations:
app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000
labels:
app.kubernetes.io/name: automationservice
app: automationservice
name: automationservice
app.kubernetes.io/name: ztpservice
app: ztpservice
name: ztpservice
spec:
ports:
- name: grpc
......@@ -32,7 +32,7 @@ spec:
port: 9192
targetPort: 8080
selector:
app.kubernetes.io/name: automationservice
app.kubernetes.io/name: ztpservice
type: ClusterIP
---
apiVersion: apps/v1
......@@ -41,21 +41,21 @@ metadata:
annotations:
app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000
labels:
app: automationservice
app.kubernetes.io/name: automationservice
name: automationservice
app: ztpservice
app.kubernetes.io/name: ztpservice
name: ztpservice
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: automationservice
app.kubernetes.io/name: ztpservice
template:
metadata:
annotations:
app.quarkus.io/build-timestamp: 2022-09-19 - 10:48:18 +0000
labels:
app: automationservice
app.kubernetes.io/name: automationservice
app: ztpservice
app.kubernetes.io/name: ztpservice
spec:
containers:
- env:
......@@ -67,7 +67,7 @@ spec:
value: contextservice
- name: DEVICE_SERVICE_HOST
value: deviceservice
image: labs.etsi.org:5050/tfs/controller/automation:0.2.0
image: labs.etsi.org:5050/tfs/controller/ztp:0.2.0
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
......@@ -79,7 +79,7 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
name: automationservice
name: ztpservice
ports:
- containerPort: 5050
name: grpc
......@@ -108,12 +108,12 @@ spec:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: automationservice-hpa
name: ztpservice-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: automationservice
name: ztpservice
minReplicas: 1
maxReplicas: 10
metrics:
......
......@@ -25,8 +25,11 @@ export TFS_COMPONENTS="context device pathcomp service slice compute webui load_
# Uncomment to activate Monitoring
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
# Uncomment to activate Automation and Policy Manager
#export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"
# Uncomment to activate ZTP
#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp"
# Uncomment to activate Policy Manager
#export TFS_COMPONENTS="${TFS_COMPONENTS} policy"
# Uncomment to activate Optical CyberSecurity
#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager"
......
......@@ -13,11 +13,11 @@
// limitations under the License.
syntax = "proto3";
package automation;
package ztp;
import "context.proto";
service AutomationService {
service ZtpService {
rpc ZtpGetDeviceRole(DeviceRoleId) returns (DeviceRole) {}
rpc ZtpGetDeviceRolesByDeviceId(context.DeviceId) returns (DeviceRoleList) {}
rpc ZtpAdd(DeviceRole) returns (DeviceRoleState) {}
......
......@@ -24,7 +24,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 centralizedattackdetector"
COMPONENTS="context device ztp policy service compute monitoring centralizedattackdetector"
# Set the tag you want to use for your images.
IMAGE_TAG="tf-dev"
......@@ -43,7 +43,7 @@ for COMPONENT in $COMPONENTS; do
echo " Building Docker image..."
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log"
if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then
if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then
docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
else
docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/ > "$BUILD_LOG"
......
......@@ -24,7 +24,7 @@ export REGISTRY_IMAGE=${REGISTRY_IMAGE:-""}
#export REGISTRY_IMAGE="http://my-container-registry.local/"
# If not already set, set the list of components you want to build images for, and deploy.
export COMPONENTS=${COMPONENTS:-"context device automation policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"}
export COMPONENTS=${COMPONENTS:-"context device ztp policy service compute monitoring dbscanserving opticalattackmitigator opticalcentralizedattackdetector webui"}
# If not already set, set the tag you want to use for your images.
export IMAGE_TAG=${IMAGE_TAG:-"tf-dev"}
......@@ -78,7 +78,7 @@ for COMPONENT in $COMPONENTS; do
echo " Building Docker image..."
BUILD_LOG="$TMP_LOGS_FOLDER/build_${COMPONENT}.log"
if [ "$COMPONENT" == "automation" ] || [ "$COMPONENT" == "policy" ]; then
if [ "$COMPONENT" == "ztp" ] || [ "$COMPONENT" == "policy" ]; then
docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile ./src/"$COMPONENT"/ > "$BUILD_LOG"
else
docker build -t "$IMAGE_NAME" -f ./src/"$COMPONENT"/Dockerfile . > "$BUILD_LOG"
......
......@@ -24,4 +24,4 @@ export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"}
# Automated steps start here
########################################################################################################################
kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/automationservice
kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/ztpservice
......@@ -55,8 +55,8 @@ def skip_file(file_path : str) -> bool:
if '/.mvn/' in file_path: return True
if '/hackfest/kafka/kafka_2.13-2.8.0' in file_path: return True
if '/src/device/service/drivers/openconfig/templates/' in file_path: return True
if '/automation/target/generated-sources/grpc/' in file_path: return True
if '/automation/target/kubernetes/' in file_path: return True
if '/ztp/target/generated-sources/grpc/' in file_path: return True
if '/ztp/target/kubernetes/' in file_path: return True
if '/policy/target/generated-sources/grpc/' in file_path: return True
if '/policy/target/kubernetes/' in file_path: return True
if '/src/dlt/gateway/' in file_path: return True
......
../../../../../proto/automation.proto
\ No newline at end of file
_______ ______ _ _ _ _
|__ __| | ____| | /\ | | | | (_)
| | ___ _ __ __ _| |__ | | _____ __ / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __
| |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \
| | __/ | | (_| | | | | (_) \ V V / / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | |
|_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|
package automation;
import io.quarkus.grpc.runtime.MutinyService;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: automation.proto")
public interface AutomationService extends MutinyService {
io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request);
io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request);
}
\ No newline at end of file
package automation;
import java.util.function.BiFunction;
import io.quarkus.grpc.runtime.MutinyClient;
@javax.annotation.Generated(
value = "by Mutiny Grpc generator",
comments = "Source: automation.proto")
public class AutomationServiceClient implements AutomationService, MutinyClient<MutinyAutomationServiceGrpc.MutinyAutomationServiceStub> {
private final MutinyAutomationServiceGrpc.MutinyAutomationServiceStub stub;
public AutomationServiceClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyAutomationServiceGrpc.MutinyAutomationServiceStub, MutinyAutomationServiceGrpc.MutinyAutomationServiceStub> stubConfigurator) {
this.stub = stubConfigurator.apply(name,MutinyAutomationServiceGrpc.newMutinyStub(channel));
}
@Override
public MutinyAutomationServiceGrpc.MutinyAutomationServiceStub getStub() {
return stub;
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRole> ztpGetDeviceRole(automation.Automation.DeviceRoleId request) {
return stub.ztpGetDeviceRole(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleList> ztpGetDeviceRolesByDeviceId(context.ContextOuterClass.DeviceId request) {
return stub.ztpGetDeviceRolesByDeviceId(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpAdd(automation.Automation.DeviceRole request) {
return stub.ztpAdd(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpUpdate(automation.Automation.DeviceRoleConfig request) {
return stub.ztpUpdate(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceRoleState> ztpDelete(automation.Automation.DeviceRole request) {
return stub.ztpDelete(request);
}
@Override
public io.smallrye.mutiny.Uni<automation.Automation.DeviceDeletionResult> ztpDeleteAll(context.ContextOuterClass.Empty request) {
return stub.ztpDeleteAll(request);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment