ric-plt/sdl.git
4 years agoAdd rpm and Debian makefile targets 09/3709/6
Timo Tietavainen [Fri, 15 May 2020 08:10:54 +0000 (11:10 +0300)]
Add rpm and Debian makefile targets

Add configuration options to enable rpm or Debian package building and
to specify the output directory where to create package files:
  configure --with-rpm-dir=DIR
  configure --with-deb-dir=DIR

Add makefile targets to build rpm and Debian packages:
  make build_rpm
  make build_deb

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: If40ee4b0a78e2b77e6980103a0b1f94dcb76db6d

4 years agoAdd unit test code coverage (gcov) make target 63/3663/8
Timo Tietavainen [Mon, 11 May 2020 08:48:39 +0000 (11:48 +0300)]
Add unit test code coverage (gcov) make target

Add autotool configure option to enable coverage analysis
and to specify location of coverage result (*.gcov) files:
  configure --with-gcov-report-dir=DIR

Add a new make target to run unit test and collect code coverage
analysis reports (*.gcov):
  make test_gcov

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: I40edf53ad4abe599a86e963326b338d27f3c002f

4 years agoAdd public helper classes for UT mocking 76/2176/5
Timo Tietavainen [Thu, 9 Jan 2020 05:53:15 +0000 (07:53 +0200)]
Add public helper classes for UT mocking

Helper classes provide simple implementation for SDL public
APIs. These classes can be used in SDL clients as base
classes for SDL API mock implementations instead of deriving
mock implementations from pure virtual API classes. This way
mock implementations do not need to be changed every time
SDL APIs change (if the change does not affect UT cases).

Fixed also broken Doxygen include path and macro expansion.

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Idf62b1397b049b4f56b8ed90c57b53ed615cd67c

4 years agoAdd SDL developer and user guides 84/2084/3
Timo Tietavainen [Fri, 20 Dec 2019 08:52:49 +0000 (10:52 +0200)]
Add SDL developer and user guides

Add the first versions of SDL Developer and User guides, which will
be published on the ORAN SC documentation page (under RIC project):
https://docs.o-ran-sc.org.

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Ic23568b44a1560ba59a5466aef2993f95d723894

4 years agoUpdate PackageCloud.io release file 38/1938/2
Rolf Badorek [Thu, 5 Dec 2019 09:41:23 +0000 (11:41 +0200)]
Update PackageCloud.io release file

Updated release file to trigger new LF Jenkins release jobs once.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: I0529d610d45b5a162951081a7169e6f33881b0e6

4 years agoAdd PackageCloud.io release file 42/1842/1
Rolf Badorek [Thu, 28 Nov 2019 12:44:18 +0000 (14:44 +0200)]
Add PackageCloud.io release file

Version 1.0.4-1 will be released for RIC Amber release.

Packages, which will be now released, were pushed to staging area
by this Jenkins job execution:

https://jenkins.o-ran-sc.org/job/ric-plt-sdl-docker-ci-pc-merge-master/5/

Package releasing instructions for reference:

https://docs.releng.linuxfoundation.org/projects/global-jjb/en/latest/jjb/lf-release-jobs.html#packagecloud-release-files

Additionally, improved README.md file instructions based on received
feedback.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: Ibc3cda11d127e877b5a97c83c377139e91f2a013

4 years agoAdd extra line about src files are part of RIC platform project 30/1830/1 Amber
Timo Tietavainen [Thu, 28 Nov 2019 07:55:22 +0000 (09:55 +0200)]
Add extra line about src files are part of RIC platform project

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: Idf0de8c3b3c8133847f14d0d0b1b38a68fcb2c67

4 years agoFix copyright statement of SDL documentation 93/1593/1
Timo Tietavainen [Thu, 14 Nov 2019 10:18:14 +0000 (12:18 +0200)]
Fix copyright statement of SDL documentation

Nokia has a copyright for the source code located under riv-plt/sdl
repository of the ORAN SC Linux Foundation. Updated SDL documentation
and package.sh script copyright statement to be in line with source
code copyright statement.

Removed also one trailing white space character at the end of
the line of the release-notes document.

Change-Id: I14da95f916c3e64b8d0f1c5c7a48001ceafbed0d
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
4 years agoAdd PackageCloud.io publishing to CI scripts 13/1513/2
Rolf Badorek [Tue, 12 Nov 2019 16:19:37 +0000 (18:19 +0200)]
Add PackageCloud.io publishing to CI scripts

CI build scripts updated to publish SDL packages in PackageCloud.io

RPM and Debian packages are available currently.

Changed base image, because eariler one did have Boost libraries built
from source. Debian package building tools will see Boost as missing
dependency if not installed via apt.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: Id5409489415ec26c051366546c5355d6bdb8efcd

4 years agoMerge "Add documentation files"
Timo Tietavainen [Wed, 13 Nov 2019 10:18:55 +0000 (10:18 +0000)]
Merge "Add documentation files"

4 years agoAdd documentation files 41/1541/1
Timo Tietavainen [Wed, 13 Nov 2019 05:59:50 +0000 (07:59 +0200)]
Add documentation files

Added mandatory documentation files for the RIC Amber release.

Change-Id: I8d2b1a9ca9bd01f18082e338cbfd2e044c96b334
Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
4 years agoAutomation adds INFO.yaml 40/1440/2
Aric Gardner [Fri, 8 Nov 2019 16:01:56 +0000 (16:01 +0000)]
Automation adds INFO.yaml

Change-Id: I2e7c45791ba2e6560682972835f8f4d6418f7277
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
4 years agoRemove AX_PTHREAD autoconf macro 16/1416/2
Rolf Badorek [Fri, 8 Nov 2019 09:44:00 +0000 (11:44 +0200)]
Remove AX_PTHREAD autoconf macro

Due the incompatible license, removed AX_PTHREAD autoconf macro.

This macro generates '$(PTHREAD_CFLAGS)' and '$(PTHREAD_LIBS)'
variables for Makefile. This makes program porting easier to
different UNIX/POSIX systems.

Only 'libgmock' and 'libgtest' really needed those Makefile variables,
added required linker options directly to Makefile. Currently used
'-lpthread' linker option should be fine for all Linux base images
which will be used in RIC, if not then some workaround (e.g. a new
configure option) will be added later.

Other usages (other than above mentioned libraries) were a leftover
of former database discovery implementation, which was not imported
to RIC. Removed these unnecessary variable usages from Makefile.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: I895d8ce1581665b4b4816e97e782523d154a74c3

4 years agoMerge "Add CI Dockerfile"
Rolf Badorek [Mon, 4 Nov 2019 15:28:21 +0000 (15:28 +0000)]
Merge "Add CI Dockerfile"

4 years agoAdd CI Dockerfile 17/1317/5
Rolf Badorek [Wed, 9 Oct 2019 07:24:58 +0000 (10:24 +0300)]
Add CI Dockerfile

First version of CI Dockerfile.

Contains only compilation and unit test execution as a verification.

Publishing RPM and Debian packages to PackageCloud.io will be added
as a separate merge request later. Also functional tests will be added
later.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: I6399069e772ba3e9144f83868269ad6554d46776

4 years agoImprove installation instructions 95/1095/1
Rolf Badorek [Wed, 9 Oct 2019 07:58:22 +0000 (10:58 +0300)]
Improve installation instructions

Added two additional clarifications/tips to README.md file:

1) If SDL API is not installed to system default path, then
'PKG_CONFIG_PATH' needs to be adjusted.

2) In some cases dynamic linker cache needs to refreshed manually
after SDL API has been re-installed.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: Ib1b657e6e714c2c81b18a4ede7dfb01f539b29ca

4 years agoAdd standard stream logger 52/1052/2
Rolf Badorek [Wed, 2 Oct 2019 14:22:45 +0000 (17:22 +0300)]
Add standard stream logger

Added and activated logger implementation, which will write logs to
stdout and stderr.

This way SDL logs are included to 'kubectl logs' command output
of containerized application which is using SDL library.

SDL logs starts with "shareddatalayer: " prefix.

RIC has own logging library, which will be taken into use later as
a separate commit / merge request.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: I1b2d4085aa3112b02c4a2161e371712ea5ba2cb5

4 years agoAdd Sentinel configuration reading 50/1050/2
Rolf Badorek [Tue, 1 Oct 2019 15:33:58 +0000 (18:33 +0300)]
Add Sentinel configuration reading

Added reading Sentinel configuration from environment variables.

Sentinel address is configured via 'DBAAS_SERVICE_HOST' and
'DBAAS_SERVICE_SENTINEL_PORT' environment variables.

Sentinel master name is configured via 'DBAAS_MASTER_NAME' environment
variable.

Sentinel support is now activated.

Using Sentinel is optional. If Sentinel related environment variables
are not set, then static address for Redis server is used as before
(i.e. this change is backward compatible).

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: I34031ac56268673996c6fecb00eeed6e5dda8b9a

4 years agoAdd Sentinel change notification handling logic 28/1028/1
Rolf Badorek [Mon, 23 Sep 2019 11:14:56 +0000 (14:14 +0300)]
Add Sentinel change notification handling logic

When new Redis master has been promoted, Sentinel publishes
notification to '+switch-master' channel.

Refer to below web page for further details:
https://redis.io/topics/sentinel

'AsyncSentinelDatabaseDiscovery' will now subscribe notifications for
above mentioned channel. Notification contains information of new Redis
master, which is parsed from message and sent to upper layer via
'StateChangedCb' callback (if callback is set).

When notifications are subscribed from Redis (from Sentinel this case),
connection will go to "subscribed state", and only some pub/sub related
commands are allowed.

Due the above reason, we have two connections (command dispatchers).
One to subscribe notifications and the other for Sentinel commands,
like master inquiry.

Refer to below web page for further details:
https://redis.io/topics/pubsub

In case that subscriber connection goes down, subscription for
notifications is renewed once connection to Sentinel is working again.
Extra master inquiry will be made because we might be missed
notifications during connection cut. Latest master address is refreshed
via 'StateChangedCb', even if has not changed compared to last informed
address. This could be optimized, but as being very rare situation
was not seen worth of extra logic.

In case that the other connection (used for Sentinel commands) is cut,
the related command dispatcher will re-connect in the background.
Possible Sentinel commands during connection cut will fail and trigger
retry after short delay (per already existing implementation).

If some notifications are missed due some other reason than connection
cut, SDL might go to the state that operations will made to Redis slave.
In this situation write operations will fail with a new internal
'AsyncRedisCommandDispatcherErrorCode::WRITING_TO_SLAVE' error code,
which is mapped to 'shareddatalayer::Error::BACKEND_FAILURE'. Recovery
instructions adjusted a bit, so that re-creating SDL API instance is
not optional recovery step (it is the only way to recover from above
mentioned situation currently).

Sentinel support is still disabled, missing implementation will be
added soon as a separate commit(s).

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: I1bb9e121985ee22278e780e50ab13f88acdc65c5

4 years agoUse boolean expects in unit tests 88/988/1
Rolf Badorek [Fri, 20 Sep 2019 11:20:05 +0000 (14:20 +0300)]
Use boolean expects in unit tests

Certain gcc versions will give (per my understanding false positive)
warning when 'EXPECT_EQ' macro is used so that other argument is
'true' or 'false'.

For example, Ubuntu 16.04 has by default such a gcc version.

See some related discussion below:
https://github.com/google/googletest/issues/322

We have defined all compiler warning to be treated as errors, thus
above issue will lead to compilation error.

Simple fix is to use 'EXPECT_TRUE' or 'EXPECT_FALSE' instead. Those are
more readable, and thus better choice anyway.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: Ib0f3841c1b6fe2cf95eac3e4dc0cbcba9c3c8268

4 years agoAdd Redis Sentinel based database discovery 64/964/1
Rolf Badorek [Tue, 17 Sep 2019 13:47:20 +0000 (16:47 +0300)]
Add Redis Sentinel based database discovery

This is first step to support forthcoming Redis HA (Sentinel) DBaaS
deployment.

If sentinel-based database discovery is used (currently still disabled
by configure option), current master is asked from Sentinel.

In case that Sentinel can't be connected, re-try will be triggered
after one second delay. If reply parsing fails, it is considered as
non-recoverable bug and execution is aborted.

Currently, Sentinel address and Redis master name are still hard coded,
will be made configurable in a separate commit soon. Also ordering
change notifications from Sentinel will be implemented separately.

Added new discovery type "SENTINEL" to 'sdltool test-connectivity'
command output.

Refactoring for 'AsyncStorageImpl' class unit tests, so that those will
use database discovery mock implementation. Earlier implementation did
have assumptions for database discovery behavior, which were not
fulfilled any more when sentinel database discovery is used.

Added option to 'AsyncCommandDispatcher' which defines if commands
will be sent to Redis or to Sentinel. In latter case existence checking
for Redis module extension commands is skipped.

Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
Change-Id: Id7507844c9b74115e52d6f8eaf9cb18198c5dc63

4 years agoAdd first version 59/859/5
Rolf Badorek [Tue, 20 Aug 2019 08:17:15 +0000 (11:17 +0300)]
Add first version

First version of C++ SDL API.

Refer README file for instructions how to generate API documentation.

Current version will find database via environment variables, thus RIC
DBaaS service must be up and running before starting the application
pod which uses SDL C++ API.

Change-Id: Ia3c95ac856b293827b680a9f6451a229f69f35f9
Signed-off-by: Rolf Badorek <rolf.badorek@nokia.com>
5 years agoInitial empty repository
Andrew Grimberg [Thu, 21 Mar 2019 23:55:44 +0000 (23:55 +0000)]
Initial empty repository