Table of Contents |
---|
Library
- HV-VES CSIT : https://gerrit.onap.org/r/#/c/59375/JSONs : https://gerrit.onap.org/r/gitweb?p=integration.git;a=tree;f=test/csit/tests/dcaegen2/-collectors-hv-ves-testcases/resources/scenarios;hb=3e3a52e698c023b9bcec8ad9d18892c2b545c6a3HEAD
Precondition
- Server flavor : 8 vCPU / 30GB RAM / 100GB HDD
- Server OS : Ubuntu 16.04
...
- Heat template
Scripts available inStatus colour YellowGreen title TBD Done - Heat template commit to gerrit repo
Status colour Yellow title TBD - HV-VES XNF simulator integration to ONAP procedure
Status colour Yellow title TBD
HV-VES simulator installation
- Put the following bash script on the server and run it :
...
language | bash |
---|
...
- Deploy HV-VES simulator from OpenStack Heat template : HV-VES simulator
- Login to the deployed server using root/onap credentials
- Verify that all docker containers are up :
No Format |
---|
root@hv-ves-sim:~# docker ps -a CONTAINER ID DOCKER_VERSION=17.03 IMAGE DOCKER_COMPOSE_VERSION=1.22.0 } enable_root_ssh () { sed -i 's/PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config service sshd restart echo -e "arthur\narthur" | passwd root } update_os () { COMMAND rm -rf /var/lib/apt/lists/* apt-get clean apt-get updateCREATED } docker_install_configure () { curl https://releases.rancher.com/install-docker/$DOCKER_VERSION.sh | sh STATUS mkdir -p /etc/systemd/system/docker.service.d/ cat > /etc/systemd/system/docker.service.d/docker.conf << EOF [Service] ExecStart= ExecStart=/usr/bin/dockerd -H fd:// --insecure-registry=nexus3.onap.org:10003 EOF PORTS systemctl daemon-reload systemctl restart docker apt-mark hold docker-ce docker login -u docker -p docker nexus3.onap.org:10003 } docker_compose_install () { curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose } hvves_sim_yml_checkout () { mkdir ~/hv-ves_sim/ cd ~/hv-ves_sim/;wget "https://gerrit.onap.org/r/gitweb?p=dcaegen2/collectors/hv-ves.git;a=blob_plain;f=docker-compose.yml;hb=HEAD" -O docker-compose.yml } dcae_simulator_disable () { cd ~/hv-ves_sim/;sed -i '/ dcae-app-simulator/,$d' docker-compose.yml } generate_certs () { mkdir ~/hv-ves_sim/ssl cd ~/hv-ves_sim/ssl;wget "https://gerrit.onap.org/r/gitweb?p=dcaegen2/collectors/hv-ves.git;a=blob_plain;f=ssl/Makefile;hb=HEAD" -O Makefile cd ~/hv-ves_sim/ssl;make FILE=client cd ~/hv-ves_sim/ssl;make FILE=server } start_simulator_env () { cd ~/hv-ves_sim;nohup docker-compose up &> ~/docker-compose.log & for i in {0..300} do sim=`grep -q "Started xNF Simulator API server" ~/docker-compose.log ; echo $?` NAMES 5a4c5011bfeb nexus3.onap.org:10003/onap/ves-hv-collector-xnf-simulator "./run-java.sh run..." 27 seconds ago Up 27 seconds 0.0.0.0:6062->6062/tcp hv-ves_sim_xnf-simulator_1 ad910797eb72 nexus3.onap.org:10003/onap/ves-hv-collector:latest "./run-java.sh run..." 28 seconds ago Up 27 seconds (healthy) 0.0.0.0:6060-6061->6060-6061/tcp if [ $sim -eq 0 ] then hv-ves_sim_ves-hv-collector_1 db196f77fd8e wurstmeister/kafka return 0 else "start-kafka.sh" 28 seconds ago sleep 5s Up 28 seconds fi 0.0.0.0:9092->9092/tcp done } consul_entry () { echo -e "127.0.0.1\tconsul" >> /etc/hosts } consul_configure () { echo '{"kafkaBootstrapServers": "kafka:9092","routing":[{"fromDomain":11,"toTopic":"ves_hvRanMeas"}]}' | curl -X PUT -d @- http://consul:8500/v1/kv/veshv-config -H "Content-Type:application/json" } restart_simulator_env () { hv-ves_sim_kafka_1 e8713cceb027 cd ~/hv-ves_sim;nohup docker-compose restart & }progrium/consul set_versions enable_root_ssh update_os docker_install_configure docker_compose_install hvves_sim_yml_checkout dcae_simulator_disable generate_certs consul_entry start_simulator_env consul_configure restart_simulator_env |
- Verify that all docker containers are up :
No Format |
---|
root@marekpl-rtpmsim:~# docker ps -a CONTAINER ID IMAGE "/bin/start -serve..." 30 seconds ago Up 28 seconds 53/tcp, 53/udp, 8300-8302/tcp, 8400/tcp, 8301-8302/udp, 0.0.0.0:8500->8500/tcp hv-ves_sim_consul_1 5440e045d0a3 wurstmeister/zookeeper COMMAND CREATED STATUS "/bin/sh -c '/usr/..." 30 seconds ago Up PORTS30 seconds 22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp NAMES ac1f97c91fbb nexus3.onap.org:10003/onap/ves-hv-collector-xnf-simulator "./run-java.sh run..." 2 minutes ago Up 28 seconds 0.0.0.0:6062->6062/tcp hv-ves_xnf-simulator_1 c9fccf31d8ac nexus3.onap.org:10003/onap/ves-hv-collector:latest "./run-java.sh run..." 2 minutes ago Up 27 seconds (healthy) 0.0.0.0:6060-6061->6060-6061/tcp hv-ves_ves-hv-collector_1 dfb445680eda wurstmeister/kafka "start-kafka.sh" 2 minutes ago Up 26 seconds 0.0.0.0:9092->9092/tcp hv-ves_kafka_1 b316f34ed9e0 wurstmeister/zookeeper "/bin/sh -c '/usr/..." 2 minutes ago Up 20 seconds 22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp hv-ves_zookeeper_1 586cb4b9dd9f progrium/consul "/bin/start -serve..." 2 minutes ago Up 30 seconds 53/tcp, 53/udp, 8300-8302/tcp, 8400/tcp, 8301-8302/udp, 0.0.0.0:8500->8500/tcp hv-ves_consul_1 root@marekpl-rtpmsim:~# |
- Verify HV-VES configuration :
No Format |
---|
root@marekpl-rtpmsim:~# curl http://consul:8500/v1/kv/veshv-config
[{"CreateIndex":6,"ModifyIndex":6,"LockIndex":0,"Key":"veshv-config","Flags":0,"Value":"eyJrYWZrYUJvb3RzdHJhcFNlcnZlcnMiOiAia2Fma2E6OTA5MiIsInJvdXRpbmciOlt7ImZyb21Eb21haW4iOjExLCJ0b1RvcGljIjoidmVzX2h2UmFuTWVhcyJ9XX0="}] |
HV-VES simulator usage
Prepare sample of XNF file (e.g. the one from https://gerrit.onap.org/r/gitwemessagesAmountb?p=integration.git;a=blob_plain;f=test/csit/tests/dcaegen2/hv-ves-testcases/resources/scenarios/fixed-payload/xnf-fixed-payload-request.json;hb=3e3a52e698c023b9bcec8ad9d18892c2b545c6a3)
No Format |
---|
[
{
"commonEventHeader": {
"version": "sample-version",
"domain": "HVRANMEAS",
"sequence": 1,
"priority": 1,
"eventId": "sample-event-id",
"eventName": "sample-event-name",
"eventType": "sample-event-type",
"startEpochMicrosec": 120034455,
"lastEpochMicrosec": 120034455,
"nfNamingCode": "sample-nf-naming-code",
"nfcNamingCode": "sample-nfc-naming-code",
"reportingEntityId": "sample-reporting-entity-id",
"reportingEntityName": "sample-reporting-entity-name",
"sourceId": "sample-source-id",
"sourceName": "sample-source-name"
},
"messageType": "FIXED_PAYLOAD",
"messagesAmount": 1
}
] |
- Start HV-VES log :
No Format |
---|
root@marekpl-rtpmsim:~# docker logs --tail 0 -f c9fccf31d8ac |
- Start Kafka consumer log :
No Format |
---|
root@marekpl-rtpmsim:~# docker exec -ti dfb445680eda sh
/ # kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ves_hvRanMeas |
- Upload following script to the server as simulator.sh :
No Format |
---|
#!/bin/bash
input_parameters () {
option=$1
file=$2
}
help () {
echo -e "Usage: simulator.sh [send] [message]"
}
send_message () {
if [[ -z $1 ]] || [[ -z $2 ]]
then
echo "Input parameter(s) empty."
help
exit 1
elif [[ $1 == "send" ]] && [[ -n $2 ]]
then
curl -X POST -d @$2 http://localhost:6062/simulator/async -H "Content-Type:application/json"
else
help
fi
}
main () {
input_parameters "$1" "$2"
send_message "$option" "$file"
}
main "$1" "$2" |
- Send the message using simulator.sh :
No Format |
---|
root@marekpl-rtpmsim:~# ./simulator.sh send ./XNF
{"response":"Request accepted"} |
- Check HV-VES log :
No Format |
---|
root@marekpl-rtpmsim:~# docker logs --tail 0 -f c9fccf31d8ac 2018-08-24T14:38:58.156Z INFO [o.o.d.c.v.i.s.NettyTcpServer ] - Handling connection from /172.18.0.6:40002 2018-08-24T14:38:58.188Z INFO [o.a.k.c.p.ProducerConfig ] - ProducerConfig values: acks = 1 batch.size = 16384 bootstrap.servers = [kafka:9092] buffer.memory = 33554432 client.id = compression.type = none connections.max.idle.ms = 540000 enable.idempotence = false interceptor.classes = null key.serializer = class org.onap.dcae.collectors.veshv.impl.adapters.kafka.ProtobufSerializer linger.ms = 0 max.block.ms = 60000 max.in.flight.requests.per.connection = 5 max.request.size = 1048576 metadata.max.age.ms = 300000 metric.reporters = [] metrics.num.samples = 2 metrics.recording.level = INFO metrics.sample.window.ms = 30000 partitioner.class = class org.apache.kafka.clients.producer.internals.DefaultPartitioner receive.buffer.bytes = 32768 reconnect.backoff.max.ms = 1000 reconnect.backoff.ms = 50 request.timeout.ms = 30000 retries = 0 retry.backoff.ms = 100 sasl.jaas.config = null sasl.kerberos.kinit.cmd = /usr/bin/kinit sasl.kerberos.min.time.before.relogin = 60000 sasl.kerberos.service.name = null sasl.kerberos.ticket.renew.jitter = 0.05 sasl.kerberos.ticket.renew.window.factor = 0.8 sasl.mechanism = GSSAPI security.protocol = PLAINTEXT send.buffer.bytes = 131072 ssl.cipher.suites = null ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1] ssl.endpoint.identification.algorithm = null ssl.key.password = null ssl.keymanager.algorithm = SunX509 ssl.keystore.location = null ssl.keystore.password = null ssl.keystore.type = JKS ssl.protocol = TLS ssl.provider = null ssl.secure.random.implementation = null ssl.trustmanager.algorithm = PKIX ssl.truststore.location = null ssl.truststore.password = null ssl.truststore.type = JKS transaction.timeout.ms = 60000 transactional.id = null value.serializer = class org.onap.dcae.collectors.veshv.impl.adapters.kafka.VesMessageSerializer 2018-08-24T14:38:58.220Z INFO [o.a.k.c.u.AppInfoParser ] - Kafka version : 0.11.0.0 2018-08-24T14:38:58.221Z INFO [o.a.k.c.u.AppInfoParserhv-ves_sim_zookeeper_1 root@hv-ves-sim:~# |
- Verify HV-VES configuration from HV-VES docker container :
No Format |
---|
root@hv-ves-sim:~# docker exec -ti ad910797eb72 bash
root@ad910797eb72:/opt/ves-hv-collector# curl http://consul:8500/v1/kv/veshv-config
[{"CreateIndex":5,"ModifyIndex":5,"LockIndex":0,"Key":"veshv-config","Flags":0,"Value":"eyJrYWZrYUJvb3RzdHJhcFNlcnZlcnMiOiAia2Fma2E6OTA5MiIsInJvdXRpbmciOlt7ImZyb21Eb21haW4iOjExLCJ0b1RvcGljIjoidmVzX2h2UmFuTWVhcyJ9XX0="}] |
HV-VES simulator usage
- Start HV-VES container log :
No Format |
---|
root@hv-ves-sim:~# docker logs --tail 0 -f ad910797eb7 |
- Start Kafka consumer log :
No Format |
---|
root@hv-ves-sim:~# docker exec -ti db196f77fd8e sh
/ # kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ves_hvRanMea |
- Send message using simulator.sh script :
No Format |
---|
root@hv-ves-sim:~# hv-ves_sim/simulator.sh send hv-ves_sim/samples/xnf-valid-messages-request.json
{"response":"Request accepted"} |
- Check HV-VES log :
No Format |
---|
root@hv-ves-sim:~# docker logs --tail 0 -f ad910797eb72 2018-09-05T13:38:32.668Z INFO [o.o.d.c.v.i.s.NettyTcpServer ] - Handling connection ] - Kafka commitId : cb8625948210849ffrom /172.18.0.6:51530 2018-0809-24T1405T13:38:5832.228Z669Z TRACE [o.o.d.c.v.i.w.WireChunkDecoder ] - Got message with total size of 336335 B 2018-0809-24T1405T13:38:5832.232Z669Z TRACE [o.o.d.c.v.i.w.WireChunkDecoder ] - Wire payload size: 328327 B 2018-0809-24T1405T13:38:5832.386Z669Z TRACE [o.o.d.c.v.i.w.WireChunkDecoder ] - Received end-of-transmission message 2018-0809-24T1405T13:38:5832.386Z670Z INFO [o.o.d.c.v.i.VesHvCollector ] - Completing stream because of receiving EOT message 2018-0809-24T1405T13:38:5832.415Z672Z TRACE [o.o.d.c.v.i.a.k.KafkaSink ] - Message #1#10001 has been sent to ves_hvRanMeas:0 2018-0809-24T1405T13:38:5832.421Z672Z INFO [o.o.d.c.v.i.s.NettyTcpServer ] - Connection from /172.18.0.6:4000251530 has been closed |
- Check Kafka consumer log :
No Format |
---|
root@marekplroot@hv-ves-rtpmsimsim:~# docker exec -ti dfb445680edadb196f77fd8e sh / # kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic ves_hvRanMeas ? sample-version *sample-version2sample-version:sample-version@???9H???9Rsampleversion@9H9Rsample-nf-naming-codeZsample-nfc-naming-codebsample-reporting-entity-idjsample-reporting-entity-namersample-source-idzsample-source-namednamec a sample/uri8873? ? ?? ??/?a? |