From 75c0d3c4216ac8b629c7768c6f1f925b5d5ade32 Mon Sep 17 00:00:00 2001 From: karnem <mikhail.karnevskiy@desy.de> Date: Fri, 4 Aug 2023 16:52:49 +0200 Subject: [PATCH] enable test of the receiver-fabric --- .gitlab-ci.yml | 2 +- .../services-linux/receiver_fabric.json | 33 +++++++++++++++++++ deploy/build_env/services-linux/run_asapo.sh | 3 ++ .../build_env/services-linux/supervisord.conf | 9 +++++ .../check_linux.sh | 16 ++++----- .../full_chain/two_beamlines/check_linux.sh | 16 +++++---- 6 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 deploy/build_env/services-linux/receiver_fabric.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4678cc045..fad0bebc1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -119,7 +119,7 @@ test-services-linux-debug: - cd $CI_PROJECT_DIR - bash /run_asapo.sh - cd $CI_PROJECT_DIR/build - - ctest --no-compress-output -T Test -L all -E "kafka|full_chain_monitoring|full_chain_two_beamlines-fabric|full_chain_simple_chain_withdata_fromcache-fabric|noaccess|restart|logger_fluentd" --output-on-failure --output-junit testResult.xml + - ctest --no-compress-output -T Test -L all -E "kafka|full_chain_monitoring|noaccess|restart|logger_fluentd" --output-on-failure --output-junit testResult.xml tags: - kubernetes-executor rules: diff --git a/deploy/build_env/services-linux/receiver_fabric.json b/deploy/build_env/services-linux/receiver_fabric.json new file mode 100644 index 000000000..82cb9d907 --- /dev/null +++ b/deploy/build_env/services-linux/receiver_fabric.json @@ -0,0 +1,33 @@ +{ + "MonitoringServer": "auto", + "PerformanceDbServer":"localhost:8086", + "MonitorPerformance": true, + "PerformanceDbName": "db_test", + "DatabaseServer":"auto", + "DiscoveryServer": "localhost:8410", + "DataServer": { + "AdvertiseURI": "127.0.0.1:8431", + "NThreads": 2, + "ListenPort": 8431, + "NetworkMode": ["fabric"] + }, + "Metrics": { + "Expose": true, + "ListenPort": 8430 + }, + "DataCache": { + "Use": true, + "SizeGB": 1, + "ReservedShare": 10 + }, + "AuthorizationServer": "localhost:8412", + "AuthorizationInterval": 1000, + "ListenPort": 8411, + "Tag": "localhost", + "ReceiveToDiskThresholdMB":50, + "MaxNumPersistedStreams":100, + "LogLevel" : "debug", + "Kafka" : { + "Enabled" : false + } + } diff --git a/deploy/build_env/services-linux/run_asapo.sh b/deploy/build_env/services-linux/run_asapo.sh index 3533e8955..b62b0e453 100644 --- a/deploy/build_env/services-linux/run_asapo.sh +++ b/deploy/build_env/services-linux/run_asapo.sh @@ -7,6 +7,9 @@ cp build/monitoring/monitoring_server/asapo-monitoring-server /asapo-monitoring- cp deploy/asapo_services_light/*json / +# Two receiver configs (tcp and fabric) are required for tests +cp deploy/asapo_services_light/receiver.json /receiver_tcp.json +cp deploy/build_env/services-linux/receiver_fabric.json / cp build/deploy/asapo_services_light/nginx.conf /etc/nginx/nginx.conf diff --git a/deploy/build_env/services-linux/supervisord.conf b/deploy/build_env/services-linux/supervisord.conf index f8c9cffee..08801145e 100644 --- a/deploy/build_env/services-linux/supervisord.conf +++ b/deploy/build_env/services-linux/supervisord.conf @@ -7,6 +7,15 @@ loglevel=info ; info, debug, warn, trace childlogdir=/var/log/supervisord/ ; where child log files will live user=root +[inet_http_server] +port = 127.0.0.1:9001 + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=http://127.0.0.1:9001 + [program:mongo] command=/usr/bin/mongod --bind_ip_all --dbpath /var/lib/mongodb/ stderr_logfile=/tmp/mongo_err.log diff --git a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh index f1969878d..0e735ad72 100644 --- a/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh +++ b/tests/automatic/full_chain/simple_chain_filegen_readdata_cache/check_linux.sh @@ -29,13 +29,13 @@ Cleanup() { set +e set +o pipefail if [[ $network_type == "fabric" ]]; then - nomad stop receiver - nomad run receiver_tcp.nmd + cp /receiver_tcp.json /receiver.json + supervisorctl restart receiver while true do sleep 1 - curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep 127.0.0.1 || continue - echo recevier started + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep localhost || continue + echo recevier tcp started break done fi @@ -60,13 +60,13 @@ Cleanup() { } if [[ $network_type == "fabric" ]]; then - nomad stop receiver - nomad run receiver_fabric.nmd + cp /receiver_fabric.json /receiver.json + supervisorctl restart receiver while true do sleep 1 - curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep 127.0.0.1 || continue - echo recevier started + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep localhost || continue + echo recevier fabric started break done fi diff --git a/tests/automatic/full_chain/two_beamlines/check_linux.sh b/tests/automatic/full_chain/two_beamlines/check_linux.sh index 61271989b..478c50754 100644 --- a/tests/automatic/full_chain/two_beamlines/check_linux.sh +++ b/tests/automatic/full_chain/two_beamlines/check_linux.sh @@ -30,12 +30,14 @@ Cleanup() { echo cleanup set +e if [[ $network_type == "fabric" ]]; then - nomad stop receiver - nomad run receiver_tcp.nmd + #nomad stop receiver + #nomad run receiver_tcp.nmd + cp /receiver_tcp.json /receiver.json + supervisorctl restart receiver while true do sleep 1 - curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep 127.0.0.1 || continue + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep localhost || continue echo recevier started break done @@ -59,12 +61,14 @@ Cleanup() { } if [[ $network_type == "fabric" ]]; then - nomad stop receiver - nomad run receiver_fabric.nmd + #nomad stop receiver + #nomad run receiver_fabric.nmd + cp /receiver_fabric.json /receiver.json + supervisorctl restart receiver while true do sleep 1 - curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep 127.0.0.1 || continue + curl --silent 127.0.0.1:8400/asapo-discovery/v0.1/asapo-receiver?protocol=v0.6 --stderr - | grep localhost || continue echo recevier started break done -- GitLab