Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InfluxDB as a package #5900

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
32 changes: 32 additions & 0 deletions cross/influxdb2-client/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PKG_NAME = influxdb2-client
PKG_VERS = 2.7.3
PKG_EXT = tar.gz
PKG_DIST_SITE = https://dl.influxdata.com/influxdb/releases
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS)-linux-$(PKG_DIST_ARCH).$(PKG_EXT)

DEPENDS =

HOMEPAGE = https://www.influxdata.com/products/influxd/
COMMENT = InfluxDB is an open-source time series database developed by the company InfluxData. It is written in the Go programming language for storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics. It also has support for processing data from Graphite. This package is the CLI client which connects to the database.
LICENSE = Apache-2.0/MIT

INSTALL_TARGET = influxdb2-client_install

UNSUPPORTED_ARCHS = $(32bit_ARCHS)

PKG_DIST_ARCH_LIST = amd64 arm64

include ../../mk/spksrc.archs.mk

ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH))
PKG_DIST_ARCH = amd64
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH))
PKG_DIST_ARCH = arm64
endif

include ../../mk/spksrc.install-resources.mk

.PHONY: influxdb2-client_install
influxdb2-client_install:
install -m 755 -d $(STAGING_INSTALL_PREFIX)/bin
install -m 755 $(WORK_DIR)/influx $(STAGING_INSTALL_PREFIX)/bin
1 change: 1 addition & 0 deletions cross/influxdb2-client/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/influx
6 changes: 6 additions & 0 deletions cross/influxdb2-client/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
influxdb2-client-2.7.3-linux-amd64.tar.gz SHA1 c4731c4f6e785ab558eca2991ea05bbcb987e5ed
influxdb2-client-2.7.3-linux-amd64.tar.gz SHA256 a266f304547463b6bc7886bf45e37d252bcc0ceb3156ab8d78c52561558fbfe6
influxdb2-client-2.7.3-linux-amd64.tar.gz MD5 10327ca140e882d330de3876e3e88af6
influxdb2-client-2.7.3-linux-arm64.tar.gz SHA1 9cfdbaa671f2a96418ec0b099485a01f0073cd03
influxdb2-client-2.7.3-linux-arm64.tar.gz SHA256 d5d09f5279aa32d692362cd096d002d787b3983868487e6f27379b1e205b4ba2
influxdb2-client-2.7.3-linux-arm64.tar.gz MD5 34d565f6100295ce62ad791dd4cf43cf
33 changes: 33 additions & 0 deletions cross/influxdb2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PKG_NAME = influxdb2
PKG_VERS = 2.7.4
PKG_EXT = tar.gz
PKG_DIST_SITE = https://dl.influxdata.com/influxdb/releases
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS)_linux_$(PKG_DIST_ARCH).$(PKG_EXT)

DEPENDS =

HOMEPAGE = https://www.influxdata.com/products/influxdb/
COMMENT = InfluxDB is an open-source time series database developed by the company InfluxData. It is written in the Go programming language for storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics. It also has support for processing data from Graphite. This package is the database daemon which includes a web UI.
LICENSE = Apache-2.0/MIT

INSTALL_TARGET = influxdb2_install

UNSUPPORTED_ARCHS = $(32bit_ARCHS)

PKG_DIST_ARCH_LIST = amd64 arm64

include ../../mk/spksrc.archs.mk

ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH))
PKG_DIST_ARCH = amd64
else ifeq ($(findstring $(ARCH),$(ARMv8_ARCHS)),$(ARCH))
PKG_DIST_ARCH = arm64
endif

include ../../mk/spksrc.install-resources.mk

.PHONY: influxdb2_install
influxdb2_install:
install -m 755 -d $(STAGING_INSTALL_PREFIX)/bin
install -m 755 $(WORK_DIR)/$(PKG_DIR)/usr/bin/influxd $(STAGING_INSTALL_PREFIX)/bin
1 change: 1 addition & 0 deletions cross/influxdb2/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/influxd
6 changes: 6 additions & 0 deletions cross/influxdb2/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
influxdb2-2.7.4_linux_amd64.tar.gz SHA1 7990961fc4ca66ad76e4c14798868be308a0a292
influxdb2-2.7.4_linux_amd64.tar.gz SHA256 2a2ccca52e42fb483c93ac3672cb264ffb804fc0be33209e5d954dd755146288
influxdb2-2.7.4_linux_amd64.tar.gz MD5 704766d07383e439727f6f6731f2c123
influxdb2-2.7.4_linux_arm64.tar.gz SHA1 3152e617faf43928889214a192e1a117f2f40d77
influxdb2-2.7.4_linux_arm64.tar.gz SHA256 bf7386a1279f3d7eb96dd5b54e80c7d2a541facf60689e78913ae2f8f4503616
influxdb2-2.7.4_linux_arm64.tar.gz MD5 63e8de49918eff95d2a78c3f13e05fa6
34 changes: 34 additions & 0 deletions spk/influxdb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
SPK_NAME = influxdb
SPK_VERS = 2.7.4
SPK_REV = 1
SPK_ICON = src/influxdb.png

DEPENDS = cross/influxdb2 cross/influxdb2-client

MAINTAINER = SynoCommunity
DESCRIPTION = InfluxDB is an open-source time series database developed by the company InfluxData. It is written in the Go programming language for storage and retrieval of time series data in fields such as operations monitoring, application metrics, Internet of Things sensor data, and real-time analytics. It also has support for processing data from Graphite. This package includes both the database and CLI client
STARTABLE = yes
DISPLAY_NAME = InfluxDB
CHANGELOG = "1. Created initial package"

HOMEPAGE = https://www.influxdata.com/products/influxdb/
LICENSE = Apache-2.0/MIT

# There does not exist a 32 bit package
UNSUPPORTED_ARCHS = $(32bit_ARCHS)

# WIZARDS_DIR = src/wizard/

include ../../mk/spksrc.common.mk

SPK_COMMANDS = bin/influx bin/influxd

SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh
SERVICE_PORT = 8186
SERVICE_PORT_TITLE = InfluxDB API

# Admin link for in DSM UI
ADMIN_PORT = $(SERVICE_PORT)

include ../../mk/spksrc.spk.mk
Binary file added spk/influxdb/src/influxdb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions spk/influxdb/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
INFLUXD_CONFIG_PATH=${SYNOPKG_PKGVAR}/config.yml
INFLUXD=${SYNOPKG_PKGDEST}/bin/influxd

export INFLUXD_CONFIG_PATH=${INFLUXD_CONFIG_PATH}

SERVICE_COMMAND="${INFLUXD}"
SVC_BACKGROUND=yes
SVC_WRITE_PID=yes
SVC_CWD="${SYNOPKG_PKGVAR}"

service_postinst ()
{
cat << EOF > "${INFLUXD_CONFIG_PATH}"
http-bind-address: ":${SERVICE_PORT}"
reporting-disabled: true
bolt-path: "${SYNOPKG_PKGVAR}/.influxdbv2/influxd.bolt"
engine-path: "${SYNOPKG_PKGVAR}/.influxdbv2/engine"
sqlite-path: "${SYNOPKG_PKGVAR}/.influxdbv2/influxd.sqlite"

EOF
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config is now static.
I highly recommend to add the config file to the package in the var folder.
This way it will automatically be installed.
Plus the config file in the package will not overwrite the config on package updates.