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

Optical component:

- Pre-merge cleanup
parent 849e3a08
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!212Resolve "(CNIT) Integrate leftover common contributions related to Optical Controller component"
......@@ -364,7 +364,7 @@ for COMPONENT in $TFS_COMPONENTS; do
echo "Waiting for '$COMPONENT' component..."
COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/")
kubectl wait --namespace $TFS_K8S_NAMESPACE \
--for='condition=available' --timeout=90s deployment/${COMPONENT_OBJNAME}service
--for='condition=available' --timeout=300s deployment/${COMPONENT_OBJNAME}service
printf "\n"
done
......
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: Deployment
metadata:
......@@ -9,36 +23,39 @@ spec:
replicas: 1
template:
metadata:
labels:
app: opticalcontrollerservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: localhost:32000/tfs/opticalcontroller:dev
imagePullPolicy: Never
ports:
- containerPort: 5022
- containerPort: 9192
env:
- name: LOG_LEVEL
value: "INFO"
resources:
requests:
cpu: 500m
memory: 128Mi
limits:
cpu: 1000m
memory: 1024Mi
- name: server
image: localhost:32000/tfs/opticalcontroller:dev
imagePullPolicy: Never
ports:
- containerPort: 10060
- containerPort: 9192
env:
- name: LOG_LEVEL
value: "INFO"
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10060"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10060"]
resources:
requests:
cpu: 500m
memory: 128Mi
limits:
cpu: 1000m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: opticalcontrollerservice
labels:
labels:
app: opticalcontrollerservice
spec:
type: ClusterIP
......@@ -47,8 +64,8 @@ spec:
ports:
- name: grpc
protocol: TCP
port: 5022
targetPort: 5022
port: 10060
targetPort: 10060
- name: metrics
protocol: TCP
port: 9192
......
#!/bin/bash
Docker_Container=$1
Docker_Port=$2
if [ -n "$Docker_Container" ] && [ -n "$Docker_Port" ];then
sudo docker stop "$Docker_Container" -t 1
sudo docker rm "$Docker_Container"
echo "Creating TPs"
screen -dmS t1 -T xterm sh -c "docker run -p 10.0.2.15:"$Docker_Port":2022 -v ~/tfs-ctrl/tempOC/files:/files --name $Docker_Container -it asgamb1/oc23bgp.img:latest"
sleep 2
if [ "$( docker container inspect -f '{{.State.Running}}' "$Docker_Container")" = "true" ]; then
docker exec "$Docker_Container" cp /files/demoECOC21_4.xml demoECOC21.xml
docker exec "$Docker_Container" /confd/examples.confd/OC23/startNetconfAgent.sh
else
echo "your container is not running yet"
fi
else
echo "Please define the docker container name and port"
fi
......@@ -59,7 +59,7 @@ class ServiceNameEnum(Enum):
TE = 'te'
FORECASTER = 'forecaster'
E2EORCHESTRATOR = 'e2eorchestrator'
OPTICALCONTROLLER = 'opticalcontroller'
OPTICALCONTROLLER = 'opticalcontroller'
BGPLS = 'bgpls-speaker'
# Used for test and debugging only
......@@ -88,6 +88,7 @@ DEFAULT_SERVICE_GRPC_PORTS = {
ServiceNameEnum.TE .value : 10030,
ServiceNameEnum.FORECASTER .value : 10040,
ServiceNameEnum.E2EORCHESTRATOR .value : 10050,
ServiceNameEnum.OPTICALCONTROLLER .value : 10060,
ServiceNameEnum.BGPLS .value : 20030,
# Used for test and debugging only
......
......@@ -241,6 +241,5 @@ if __name__ == '__main__':
#topologies,links= getTopology()
#print ("topologies{} and devices {}".format(topologies,links))
rsa = RSA(nodes_dict, links_dict)
app.run(host='0.0.0.0', port=5022,debug=True)
app.run(host='0.0.0.0', port=10060,debug=True)
#!/bin/bash
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
DOCKER_CONTAINER=$1
DOCKER_PORT=$2
if [ -n "$DOCKER_CONTAINER" ] && [ -n "$DOCKER_PORT" ];then
sudo docker stop "$DOCKER_CONTAINER" -t 1
sudo docker rm "$DOCKER_CONTAINER"
echo "Creating TPs"
screen -dmS t1 -T xterm sh -c "docker run -p 10.0.2.15:"$DOCKER_PORT":2022 -v ~/tfs-ctrl/tempOC/files:/files --name $DOCKER_CONTAINER -it asgamb1/oc23bgp.img:latest"
sleep 2
if [ "$( docker container inspect -f '{{.State.Running}}' "$DOCKER_CONTAINER")" = "true" ]; then
docker exec "$DOCKER_CONTAINER" cp /files/demoECOC21_4.xml demoECOC21.xml
docker exec "$DOCKER_CONTAINER" /confd/examples.confd/OC23/startNetconfAgent.sh
else
echo "your container is not running yet"
fi
else
echo "Please define the docker container name and port"
fi
#!/bin/bash
asgamb1/flexscale-node.imgasgamb1/flexscale-node.imgasgamb1/flexscale-node.imgasgamb1/flexscale-node.img#!/bin/bash
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
sudo docker stop na1 -t 1
sudo docker stop na2 -t 1
......@@ -20,4 +32,4 @@ source "./startExtraNetConfigAgent.sh" "na2" "2024"
sleep 3
screen -dmS t3 -T xterm sh -c 'docker run -p 10.0.2.15:2025:2022 -v ~/tfs-ctrl/tempOC/files:/files --name na3 -it asgamb1/flexscale-node.img:latest ./startNetconfAgent.sh'
screen -dmS t4 -T xterm sh -c 'docker run -p 10.0.2.15:2026:2022 -v ~/tfs-ctrl/tempOC/files:/files --name na4 -it asgamb1/flexscale-node.img:latest ./startNetconfAgent.sh'
\ No newline at end of file
screen -dmS t4 -T xterm sh -c 'docker run -p 10.0.2.15:2026:2022 -v ~/tfs-ctrl/tempOC/files:/files --name na4 -it asgamb1/flexscale-node.img:latest ./startNetconfAgent.sh'
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