summaryrefslogtreecommitdiffstats
path: root/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb
diff options
context:
space:
mode:
authorLudwig Schwiedrzik <ludwig.schwiedrzik@d-fine.com>2024-06-18 09:58:07 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2024-06-25 11:06:09 +0000
commit7618c4a08229834883c8ade90e52c8c41eb81901 (patch)
tree37e054bdcf3408bb9dfc1c96e821bb887c9d5614 /recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb
parent5ed44ad0a16a7e20c226eb10bca059f8f4e0559d (diff)
Add persistent storage grpc APIricefish_17.92.0ricefish/17.92.017.92.0
In the current demo, user settings such as radio stations and HVAC preferences are lost upon poweroff. The agl-persistent-storage-api adds a simple grpc API that enables persistent storage of key-value pairs using RocksDB. The API supports Write, Read, Delete, and Search calls, as well as calls to recursively list or delete nodes (intended for use with VSS-like keys) and to destroy the database. Separate namespaces are also supported. The API is written in Rust, the repo can be viewed under this URL: https://github.com/LSchwiedrzik/agl-persistent-storage-api Test builds were successfully carried out by Jan-Simon Möller. Bug-AGL: [SPEC-5187] Change-Id: Ic11d31c75268f922c84785da8cd29fa6b022612f Signed-off-by: Ludwig Schwiedrzik <ludwig.schwiedrzik@d-fine.com> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/29996 Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Tested-by: Jenkins Job builder account
Diffstat (limited to 'recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb')
-rw-r--r--recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb46
1 files changed, 46 insertions, 0 deletions
diff --git a/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb b/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb
new file mode 100644
index 000000000..63a315fd6
--- /dev/null
+++ b/recipes-demo/agl-persistent-storage-api/agl-persistent-storage-api_git.bb
@@ -0,0 +1,46 @@
+DESCRIPTION = "A grpc API that provides persistent storage for the Automotive Grade Linux demo"
+SUMMARY = "Our goal is to develop a grpc API for AGLthat serves as persistent storage API for the demo. The API will be written in Rust and make use of tonic for grpc functionality as well as RocksDB as a database backend, using rust-rocksdb. Use cases include retaining settings over a system shutdown (e.g. audio, HVAC, profile data, Wifi settings, radio presets, metric vs imperial units)."
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=493c464569a4f93a01fc9025ee76a69b"
+
+SRC_URI = "git://github.com/LSchwiedrzik/agl-persistent-storage-api.git;protocol=https;branch=master \
+ file://agl-persistent-storage-api.service \
+ "
+
+# Modify these as desired
+PV = "1.0+git${SRCPV}"
+SRCREV = "f69d46510e5b13cdb559dbc077aced1f74e19f66"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "protobuf-native grpc-native rocksdb clang-native"
+TOOLCHAIN = "clang"
+
+require ${BPN}-crates.inc
+
+inherit cargo cargo-update-recipe-crates systemd
+#useradd
+
+SYSTEMD_SERVICE:${PN} = "${BPN}.service"
+
+USERADD_PACKAGES = "${PN}"
+USERADDEXTENSION = "useradd-staticids"
+GROUPADD_PARAM:${PN} = "-g 903 persistent-api ;"
+USERADD_PARAM:${PN} = "--system -g 903 -u 903 -o -d / --shell /bin/nologin persistent-api ;"
+
+do_compile:prepend() {
+ export ROCKSDB_CXX_STD="--std=c99"
+ export ROCKSDB_INCLUDE_DIR="${RECIPE_SYSROOT}/usr/include"
+}
+
+do_install:append () {
+ # copy systemd service file into destination folder
+ mv ${D}/usr/bin/server ${D}/usr/bin/agl-service-persistent-storage
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}
+ fi
+}
+
+FILES:${PN} += "${systemd_system_unitdir} ${datadir}"
+