269 Commits

Author SHA1 Message Date
Olexandr, Mazur
83efcb27eb Merge pull request #121 from miha-jancar-shastacloud/main
Improvement of secret management
2025-02-10 11:02:12 +02:00
miha-jancar-shastacloud
7a30170f58 Improvement on secret management 2025-02-06 16:05:34 +01:00
Olexandr, Mazur
fb1b8455df Merge pull request #112 from Telecominfraproject/next
1.2 Rel next->main PR
2024-12-20 13:56:54 +02:00
Olexandr, Mazur
c7b8698d5a Merge pull request #110 from Telecominfraproject/feat/initial_api_formalization
Feat/initial api formalization
2024-12-19 15:13:29 +02:00
Oleksandr Mazur
c95e8dfe6b Docker compose template: enable topomap feat by default
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
e9d37d1b8c Initial formalization of API in form of YAML files
Add initial list of YAML files that formalize Kafka API:
 - requests list that CGW can handle
 - responses that CGW will generate
 - unsolicited events that CGW might generate

Also a small cleanup of requests and responses was made,
to align it with a common format (renamed some of the fields,
added missing etc).
Tests are tweaked to accomodate for changed field names.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
8f7736f7d3 CGW: Connection server: update local redis timestamp after handling requests
Internally, group add / del requests do alter the Redis timestamp
(lat update timestamp), however the main loop of connection_server
that processes messages is _not_ aware of this change up untill
the next iteration of the loop.

Fix this to make sure we _save_ locally the timestamp that
we get from redis once we know for sure that local shard
modified it (e.g. after group add/del request handled).

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
2777135e2a CGW: Connection server: do not duplicate replies on unknown GID
Whenever CGW receives reply for an unknown GID, it firstly
sends the <unknown GID> reply.
Right after that it sends another one (duplicate), which
is redundant and should not be sent.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
4ee92484e0 CGW: rework partial infra add/del returned infras list
Change CGW behavior to return only 'failed_infras' in both
infra add/del partial or completely failed responses.

This tweaks the previous redundant data that was returned in the
response - list of <all> macs in case of a successfull completion,
which is unnecessary - it's already clear that request succeeded,
and actions were made over supplied infra list.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-19 14:51:16 +02:00
Oleksandr Mazur
3155b8da83 CGW: remove 'infra_name' from infra_group API
Remove unused 'infra_name' from NB API requests that
manage infra_group (add/del).
Also change tests / utils and helper scripts to no longer
form kafka msgs with 'infra_name' present.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-19 14:51:16 +02:00
Olexandr, Mazur
849511cd5c Merge pull request #111 from Telecominfraproject/dev-redis-infra-cache-client
Added separate redis client to work with infras cache!
2024-12-16 15:32:34 +02:00
Sviatoslav Boichuk
6d2999298e Added separate redis client to work with infras cache! 2024-12-16 12:24:22 +02:00
Olexandr, Mazur
66625eef15 Merge pull request #109 from Telecominfraproject/feat/initial_isolated_tests_execution
Feat/initial isolated tests execution
2024-12-11 17:05:21 +02:00
Oleksandr Mazur
4a20121b4b Update readme
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-11 17:04:20 +02:00
Oleksandr Mazur
af4dfb4272 Build: use multi-cgw deployment target as a default one
Replace script-based approach for CGW/services creation,
in favor of multi-cgw templated generated compose file.

Also, add a new run-tests target, that executes / starts
test run, for the sake of convinience.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-11 16:58:46 +02:00
Oleksandr Mazur
e79afca822 Tests: execute tests in tmpfs context (folder)
Whenever tests start, they might do some enviromental
changes to local FS. Handle this by moving
the 'context' of tests execution to a tmpfs folder, that
can be easily purged after tests are done / new test run
is being executed.

NOTE: further changes in regard to tests isolation should
potentially utilize a separate docker container that serves
as a fresh clean and isolated enviroment for tests run.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-11 16:24:15 +02:00
Oleksandr Mazur
49555495e8 Tests: core: add timeout values for common clients
Force redis, PSQL, kafka clients to have a strict
timeout value for any requests.

It's done to ensure our tests do not hang for an unknown
period of time in case if something goes wrong.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-11 16:24:15 +02:00
Oleksandr Mazur
047e37a101 Connection processor: add a force TLS-accept timeout
Whenever TLS accept (tungstenite::accept(tls_stream))
blocks for too long (>15 seconds), stop trying
to accept the stream using tokio_selector.
This is done to ensure we don't have a hang
connection processor that might hang for a very
long period of time waiting for a connection to be
accepted.

Also run cargo fmt to fix some import indentation.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-11 16:24:15 +02:00
Olexandr, Mazur
3f2b42272e Merge pull request #107 from Telecominfraproject/dev-enhance-nb-replys
Dev enhance nb replys
2024-12-11 16:23:11 +02:00
Olexandr, Mazur
1821404a9c Merge pull request #108 from Telecominfraproject/fix/tests_add_msised_test_file
Tests: add missed test file
2024-12-11 08:00:57 +02:00
Oleksandr Mazur
8be06b7628 Tests: add missed test file
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-10 17:11:39 +02:00
Sviatoslav Boichuk
840b9a970b Fixed tests print messages 2024-12-10 15:40:27 +02:00
Sviatoslav Boichuk
09e92207e9 Added malformed packets basic tests 2024-12-10 15:23:36 +02:00
Sviatoslav Boichuk
da93161530 Send infra enqueue response to NB if failed to parse msg 2024-12-10 14:03:04 +02:00
Sviatoslav Boichuk
be93ba2d63 Removed usused conn index param 2024-12-10 14:03:04 +02:00
Sviatoslav Boichuk
b5ce07669a Removed unused variable from app args 2024-12-10 14:03:04 +02:00
Sviatoslav Boichuk
52f29e5f49 Return error if msg relay failed 2024-12-10 14:03:04 +02:00
Olexandr, Mazur
cd35ca6e1e Merge pull request #105 from Telecominfraproject/dev-basic-msg-relay-test
Dev basic msg relay test
2024-12-10 13:57:48 +02:00
Sviatoslav Boichuk
3326b1290d Merge pull request #106 from Telecominfraproject/fix/add_missed_configs
Utils: Kafka: add missing cfg samples
2024-12-10 11:51:47 +02:00
Oleksandr Mazur
3e63d06f8a Utils: Kafka: add missing cfg samples
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-10 11:47:24 +02:00
Sviatoslav Boichuk
7d1588c318 Fixed func params 2024-12-10 11:25:14 +02:00
Sviatoslav Boichuk
2405379c50 Added infra assign message relay test 2024-12-10 11:23:37 +02:00
Sviatoslav Boichuk
87eaa2dee9 Fixed GRPC Public Host name in Docker Compose template file 2024-12-09 17:05:58 +02:00
Sviatoslav Boichuk
25bc4b027b Fixed rustfmt 2024-12-09 15:31:40 +02:00
Sviatoslav Boichuk
932b211706 Merge pull request #103 from Telecominfraproject/feat/test_initial_infra_message_impl
Initial infra message impl
2024-12-06 13:03:03 +02:00
Olexandr, Mazur
f28e82d3d3 Merge pull request #104 from Telecominfraproject/dev-multi-cgw-deploy
Dev multi cgw deploy
2024-12-06 11:55:03 +02:00
Sviatoslav Boichuk
91809db229 Fix Group create to shard: set infras capacity from config instead of hardcoded value 2024-12-05 16:13:43 +02:00
Sviatoslav Boichuk
8feb522d6d Updated CGW tests 2024-12-05 16:12:57 +02:00
Oleksandr Mazur
10fd2d765b Testing: initial message queue (infra msg) infrastructure
Add initial infrastructure for sending / receiving messages
using websocket bindings for client sim.
Add initial handle-reboot-simulation test, that both
tests CGW's ability to sink down a request, as well as
test it's behavior whenever simulated device's been rebooted.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-05 14:52:24 +02:00
Oleksandr Mazur
f1357a0e97 CGW: fix ucentral result invalid parsers
Change the AP ucentral result parser to expect proper
format of result message.
Add a basic (same as for AP) ucentral result parser
for switch-parser.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-05 14:39:00 +02:00
Oleksandr Mazur
8d919e6dcb Utils: run_cgw: change hardcoded host port bind to env-var
Export host-to-docker port based on value taken from
env var rather then hardcoded value.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-05 14:36:57 +02:00
Sviatoslav Boichuk
1522b13463 Update README.md file 2024-12-05 14:22:26 +02:00
Sviatoslav Boichuk
1356565f58 Added Docker Compose tempalte to start multi-cgw instances 2024-12-05 14:22:21 +02:00
Sviatoslav Boichuk
ae78f133d4 Removed duplicate if condition in run_cgw.sh + fix CGW_REDIS_USERNAME|PASSWORD env var checker 2024-12-05 12:31:45 +02:00
Sviatoslav Boichuk
6e0dda17cd Fix warning in Docker.debug file 2024-12-05 12:31:45 +02:00
Sviatoslav Boichuk
0020a4bf8e Merge pull request #102 from Telecominfraproject/feat/cgw_kafka_key_in_replies
Feat/cgw kafka key in replies
2024-12-04 13:36:01 +02:00
Oleksandr Mazur
7f9fbd6905 Utils: client simulator: add a missed mac list that is used in clientsim
The predefined mac list in the txt file is used
internally by the client simulator. It was missed
in previous commits.

Future clientsim rework should eliminate use of <predefined>
mac lists, but it's used now.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-03 15:13:58 +02:00
Oleksandr Mazur
723c2ffb1b CGW: provide (optional) kafka routing key in some of replies
The provided kafka key in (some of the) replies can be used
by NB services to talk <directly> to _this_ local shard
that replied, effectively using kafka partitioning to
not rely on the relaying mechanism.
The keys list is calculated upon each kafka partition rebalancing,
if the partition number changes.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-03 15:12:08 +02:00
Oleksandr Mazur
8ce7104ef8 Utils: Kafka: fix helper scripts / cli parser group add
Remove unused shard id argument from cli parser in
<generic> (assign to <any>) infra group create request.

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-12-03 15:12:07 +02:00
Oleksandr Mazur
c17b89f1d2 Utils: Client simulator: fix sim not starting using docker
Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
2024-11-26 15:15:35 +02:00