Commit 796efb64 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

ECOC F5GA Telemetry Demo:

- Separated redeploy into destroy and deploy scripts to prevent race conditions
- Cleanup of old scripts
parent bcec95f5
Loading
Loading
Loading
Loading
+36 −8
Original line number Diff line number Diff line
@@ -14,15 +14,43 @@
# limitations under the License.


# Make folder containing the script the root folder for its execution
cd $(dirname $0)
# Assuming the instances are named as: simap-server, tfs-e2e-ctrl, tfs-agg-ctrl, tfs-ip-ctrl

# Get the current hostname
HOSTNAME=$(hostname)
echo "Destroying in ${HOSTNAME}..."

echo "[E2E] Subscribe Telemetry slice2..."
curl --request POST --location --header 'Content-Type: application/json' \
    --data @data/telemetry/subscription-slice2.json \
    http://0.0.0.0:80/restconf/operations/subscriptions:establish-subscription
echo

case "$HOSTNAME" in
    simap-server)
        echo "Cleaning up..."
        docker rm --force simap-server
        docker rm --force nce-fan-ctrl
        docker rm --force nce-t-ctrl
        docker rm --force traffic-changer

echo "Done!"
        sleep 2
        docker ps -a
        ;;
    tfs-e2e-ctrl)
        echo "Destroying TFS E2E Controller..."
        source ~/tfs-ctrl/src/tests/ecoc25-f5ga-telemetry/deploy-specs-e2e.sh
        kubectl delete namespace $TFS_K8S_NAMESPACE
        ;;
    tfs-agg-ctrl)
        echo "Destroying TFS Agg Controller..."
        source ~/tfs-ctrl/src/tests/ecoc25-f5ga-telemetry/deploy-specs-agg.sh
        kubectl delete namespace $TFS_K8S_NAMESPACE
        ;;
    tfs-ip-ctrl)
        echo "Destroying TFS IP Controller..."
        source ~/tfs-ctrl/src/tests/ecoc25-f5ga-telemetry/deploy-specs-ip.sh
        kubectl delete namespace $TFS_K8S_NAMESPACE
        ;;
    *)
        echo "Unknown host: $HOSTNAME"
        echo "No commands to run."
        ;;
esac

echo "Ready!"
+0 −22
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (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.


./scripts/show_logs_device.sh > device.log
./scripts/show_logs_service.sh > service.log
./scripts/show_logs_slice.sh > slice.log
./scripts/show_logs_pathcomp_frontend.sh > pathcomp.log
./scripts/show_logs_simap_connector.sh > simap.log
./scripts/show_logs_nbi.sh > nbi.log
+0 −21
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (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.


export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:5000/tfs/"}
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui"}
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"f5ga"}

./deploy/build-only.sh
+0 −73
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (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.


# Make folder containing the script the root folder for its execution
cd $(dirname $0)


echo "[E2E] Subscribe Telemetry slice1..."
# POST to create subscription and capture response
resp=$(curl -sS --request POST --location --header 'Content-Type: application/json' \
    --data @data/telemetry/subscription-slice1.json \
    http://0.0.0.0:80/restconf/operations/subscriptions:establish-subscription)
echo "$resp"

# Ensure `jq` is available for JSON parsing
if ! command -v jq >/dev/null 2>&1; then
    echo "Error: jq is required but not installed. Install jq and retry." >&2
    exit 1
fi

# Extract the subscription URI from the JSON response
# Example response: {"identifier":"4086","uri":"/restconf/data/subscriptions/4086"}
uri=$(echo "$resp" | jq -r '.uri // empty')

if [ -z "$uri" ]; then
    echo "Failed to extract subscription URI from response" >&2
    exit 1
fi

# Build full URL (use http for RESTCONF chunked/SSE-style streaming)
full_url="http://0.0.0.0:80${uri}"

echo "Streaming telemetry from '$full_url' (press Ctrl+C to stop)..."

# Attempt a long-lived HTTP GET that will dump data as it arrives.
# Many RESTCONF subscription implementations use chunked responses / SSE
# and this curl invocation will keep printing incoming data.
curl -N -sS -H 'Accept: application/yang-data+json' "$full_url"

# If your server exposes a WebSocket endpoint instead, use a websocket client
# such as `websocat` or `wscat`. Example (requires websocat):
#   websocat "ws://0.0.0.0:80${uri}"
# Or using node's wscat:
#   npx wscat -c "ws://0.0.0.0:80${uri}"

# If you need a Python websocket client (requires `websocket-client`):
#   python3 - <<'PY'
#from websocket import create_connection
#ws = create_connection('ws://0.0.0.0:80' + '${uri}')
#try:
#    while True:
#        msg = ws.recv()
#        print(msg)
#finally:
#    ws.close()
#PY

echo

echo "Done!"
Loading