influxdb: an open source time series database
This commit is contained in:
parent
7e08d66e8e
commit
2d9281822a
|
@ -0,0 +1,2 @@
|
|||
InfluxDB is an open-source time series database optimixed for fast
|
||||
storage and retrieval of time series data.
|
|
@ -0,0 +1,121 @@
|
|||
# $NetBSD$
|
||||
|
||||
GITHUB_PROJECT= influxdb
|
||||
PKGVERSION_NOREV= 1.6.5
|
||||
DISTNAME= influxdb-1.6.5
|
||||
GITHUB_TAG= v${PKGVERSION_NOREV}
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= ${MASTER_SITE_GITHUB:=influxdata/}
|
||||
MAINTAINER= william@welliver.org
|
||||
HOMEPAGE= https://www.influxdata.com/
|
||||
COMMENT= Time-series Database
|
||||
LICENSE= mit
|
||||
|
||||
# despite being the default value, this explicit declaration is required for things
|
||||
# to build properly.
|
||||
EXTRACT_SUFX= .tar.gz
|
||||
|
||||
IFDB_DISTNAME= ${DISTNAME}${EXTRACT_SUFX}
|
||||
IFDB_DEPENDENCIES= influxdb-dependencies-${PKGVERSION_NOREV}.tar.gz
|
||||
DISTFILES= ${IFDB_DISTNAME}
|
||||
.if !defined(BOOTSTRAP)
|
||||
DISTFILES+= ${IFDB_DEPENDENCIES}
|
||||
SITES.influxdb-dependencies-${PKGVERSION_NOREV}.tar.gz= https://bitbucket.org/hww3/influxdb/downloads/
|
||||
.endif
|
||||
|
||||
#EXTRACT_ONLY= ${IFDB_DISTNAME}
|
||||
EXTRACT_DIR.${IFDB_DISTNAME}= ${WRKDIR}/src/github.com/influxdata
|
||||
EXTRACT_DIR.${IFDB_DEPENDENCIES}= ${WRKDIR}/src/github.com/influxdata
|
||||
WRKSRC= ${WRKDIR}/src/github.com/influxdata/influxdb
|
||||
USE_TOOLS+= gmake curl
|
||||
|
||||
BUILD_DEPENDS+= go19-1.9.*:../../lang/go19
|
||||
BUILD_DEPENDS+= asciidoc-[0-9]*:../../textproc/asciidoc
|
||||
BUILD_DEPENDS+= xmlto-[0-9]*:../../textproc/xmlto
|
||||
|
||||
# go language executables don't have SSP support
|
||||
CHECK_SSP_SKIP= bin/*
|
||||
|
||||
PKGSRC_MAKE_ENV+= GOPATH=${WRKDIR}
|
||||
|
||||
PKG_SYSCONFSUBDIR= influxdb
|
||||
|
||||
DATADIR= ${VARBASE}/lib/influxdb
|
||||
LOGDIR= ${VARBASE}/log/influxdb
|
||||
|
||||
SUBST_CLASSES+= fix-cfg
|
||||
SUBST_STAGE.fix-cfg= pre-configure
|
||||
SUBST_MESSAGE.fix-cfg= Disabling phone-home in sample config
|
||||
SUBST_FILES.fix-cfg= etc/config.sample.toml
|
||||
SUBST_SED.fix-cfg= -e 's/^\# reporting-disabled = false/reporting-disabled = true/'
|
||||
|
||||
BUILD_DEFS+= INFLUXDB_USER INFLUXDB_GROUP VARBASE
|
||||
FILES_SUBST+= INFLUXDB_USER=${INFLUXDB_USER:Q}
|
||||
FILES_SUBST+= INFLUXDB_GROUP=${INFLUXDB_GROUP:Q}
|
||||
FILES_SUBST+= DATADIR=${DATADIR:Q}
|
||||
FILES_SUBST+= LOGDIR=${LOGDIR:Q}
|
||||
|
||||
INFLUXDB_USER?= influxdb
|
||||
INFLUXDB_GROUP?= influxdb
|
||||
OWN_DIRS_PERMS+= ${DATADIR} ${INFLUXDB_USER} ${INFLUXDB_GROUP} 0700
|
||||
OWN_DIRS_PERMS+= ${LOGDIR} ${INFLUXDB_USER} ${INFLUXDB_GROUP} 0700
|
||||
PKG_USERS_VARS+= INFLUXDB_USER
|
||||
PKG_GROUPS_VARS+= INFLUXDB_GROUP
|
||||
PKG_GROUPS= ${INFLUXDB_GROUP}
|
||||
PKG_USERS= ${INFLUXDB_USER}:${INFLUXDB_GROUP}
|
||||
RCD_SCRIPTS= influxdb
|
||||
|
||||
INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1 etc/influxdb share/doc/influxdb share/examples/influxdb
|
||||
|
||||
DOC_FILES+= LICENSE LICENSE_OF_DEPENDENCIES.md QUERIES.md README.md CHANGELOG.md
|
||||
BIN_FILES+= influx influx_inspect influx_stress influx_tsm influxd stress_test_server test_client
|
||||
CONF_FILES+= ${PREFIX}/share/examples/${PKGBASE}/config.sample.toml ${PKG_SYSCONFDIR}/config.toml
|
||||
|
||||
GO_BIN= ${PREFIX}/go19/bin/go
|
||||
|
||||
post-extract:
|
||||
${MV} ${WRKDIR}/src/github.com/influxdata/${DISTNAME} \
|
||||
${WRKDIR}/src/github.com/influxdata/influxdb
|
||||
# ${CP} files/mmap_solaris.go ${WRKSRC}/pkg/mmap
|
||||
|
||||
# TODO: figure out how to properly depend on the extract target
|
||||
# fetch the additional dependencies that telegraf requires to compile and prepare a tarball containing them for use later.
|
||||
.PHONY: _fetch_dependencies
|
||||
_fetch_dependencies: extract
|
||||
cd ${WRKSRC} && ${SETENV} ${PKGSRC_MAKE_ENV} ${GO_BIN} get github.com/sparrc/gdm
|
||||
cd ${WRKSRC} && ${SETENV} ${PKGSRC_MAKE_ENV} ${GO_BIN} install github.com/sparrc/gdm
|
||||
cd ${WRKSRC} && ${SETENV} ${PKGSRC_MAKE_ENV} ${WRKDIR}/bin/gdm restore
|
||||
cd ${WRKDIR} && ${SETENV} ${PKGSRC_MAKE_ENV} rm -rf src/github.com/influxdata/influxdb
|
||||
cd ${WRKDIR} && ${SETENV} ${PKGSRC_MAKE_ENV} find . -type d -name \.git -exec rm -rf {} \;
|
||||
cd ${WRKDIR} && ${SETENV} ${PKGSRC_MAKE_ENV} tar czvf ${IFDB_DEPENDENCIES} src
|
||||
cd ${WRKDIR} && ${SETENV} ${PKGSRC_MAKE_ENV} mv ${IFDB_DEPENDENCIES} ${WRKDIR}
|
||||
|
||||
# upload the dependency tarball somewhere that others can access.
|
||||
# this should probably be someplace more "official".
|
||||
.PHONY: _upload_dependencies
|
||||
_upload_dependencies: _fetch_dependencies
|
||||
curl -u $$BITBUCKET_USERNAME:$$BITBUCKET_PASSWORD -s -X POST https://api.bitbucket.org/2.0/repositories/$$BITBUCKET_USERNAME/influxdb/downloads -F files=@${WRKDIR}/${IFDB_DEPENDENCIES}
|
||||
|
||||
do-build:
|
||||
cd ${WRKSRC} && ${SETENV} ${PKGSRC_MAKE_ENV} ${GO_BIN} get -ldflags "-X main.version=${PKGVERSION_NOREV} -X main.commit=${GITHUB_TAG} -X main.buildstamp=pkgsrc" ./...
|
||||
cd ${WRKSRC} && ${SETENV} ${PKGSRC_MAKE_ENV} ${GO_BIN} install ./...
|
||||
|
||||
do-install:
|
||||
cd ${WRKSRC}/man && ${SETENV} ${PKGSRC_MAKE_ENV} ${MAKE_PROGRAM}
|
||||
.for idir in ${INSTALLATION_DIRS}
|
||||
${MKDIR} ${DESTDIR}${PREFIX}/${idir}
|
||||
.endfor
|
||||
for manpage in ${WRKSRC}/man/*.1 ; do \
|
||||
${INSTALL_MAN} $$manpage ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 ; \
|
||||
done
|
||||
.for x in ${BIN_FILES}
|
||||
${INSTALL} ${WRKDIR}/bin/${x} \
|
||||
${DESTDIR}${PREFIX}/bin/${x}
|
||||
.endfor
|
||||
.for x in ${DOC_FILES}
|
||||
${INSTALL_DATA} ${WRKSRC}/${x} \
|
||||
${DESTDIR}${PREFIX}/share/doc/influxdb/${x}
|
||||
.endfor
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/config.sample.toml ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}
|
||||
|
||||
.include "../../mk/bsd.pkg.mk"
|
|
@ -0,0 +1,26 @@
|
|||
@comment $NetBSD$
|
||||
bin/influx
|
||||
bin/influx_inspect
|
||||
bin/influx_stress
|
||||
bin/influx_tsm
|
||||
bin/influxd
|
||||
bin/stress_test_server
|
||||
bin/test_client
|
||||
man/man1/influx.1
|
||||
man/man1/influx_inspect.1
|
||||
man/man1/influx_stress.1
|
||||
man/man1/influx_tsm.1
|
||||
man/man1/influxd-backup.1
|
||||
man/man1/influxd-config.1
|
||||
man/man1/influxd-restore.1
|
||||
man/man1/influxd-run.1
|
||||
man/man1/influxd-version.1
|
||||
man/man1/influxd.1
|
||||
share/doc/influxdb/CHANGELOG.md
|
||||
share/doc/influxdb/LICENSE
|
||||
share/doc/influxdb/LICENSE_OF_DEPENDENCIES.md
|
||||
share/doc/influxdb/QUERIES.md
|
||||
share/doc/influxdb/README.md
|
||||
share/examples/influxdb/config.sample.toml
|
||||
@pkgdir man1
|
||||
@pkgdir etc/influxdb
|
|
@ -0,0 +1,10 @@
|
|||
$NetBSD$
|
||||
|
||||
SHA1 (influxdb-1.6.5.tar.gz) = 45250a33285ad4e1e03bf8ad5066c6ac5202b710
|
||||
RMD160 (influxdb-1.6.5.tar.gz) = 5762e1ad031f6d688e976ef18fcc4972975d716d
|
||||
SHA512 (influxdb-1.6.5.tar.gz) = 4bf8acfdf423d4ef84a34c63fe9fb7aad66b22c95ed55efb9f4c6602f96ee8ee0d45fc1eb5f793f4eac02b67b7eac4a966cb60e6583da4fbd8f6cdea9665cea1
|
||||
Size (influxdb-1.6.5.tar.gz) = 1513474 bytes
|
||||
SHA1 (influxdb-dependencies-1.6.5.tar.gz) = 0c8e0d0833e11953b0c89c714219bcad4e5c8c3c
|
||||
RMD160 (influxdb-dependencies-1.6.5.tar.gz) = 50b110a7d9f150945d8862006f61e80934566809
|
||||
SHA512 (influxdb-dependencies-1.6.5.tar.gz) = 7103a11df1cb0f7844ba9840766700585ecd9e0102fe3073d7df71932b158c7883192f3fbfa57e7e3a35765949ccb9970dab9f09f84f7233dab38a6f59bd6c7d
|
||||
Size (influxdb-dependencies-1.6.5.tar.gz) = 18642231 bytes
|
|
@ -0,0 +1,23 @@
|
|||
#!@RCD_SCRIPTS_SHELL@
|
||||
|
||||
# PROVIDE: influxdb
|
||||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
|
||||
if [ -f /etc/rc.subr ]
|
||||
then
|
||||
. /etc/rc.subr
|
||||
fi
|
||||
|
||||
name="influxdb"
|
||||
rcvar=$name
|
||||
influxdb_user="@INFLUXDB_USER@"
|
||||
influxdb_group="@INFLUXDB_GROUP@"
|
||||
influxdb_chdir="@VARBASE@/lib/influxdb"
|
||||
pidfile="@VARBASE@/lib/influxdb/data/influxdb.pid"
|
||||
STDERR="@LOGDIR@/influxdb.log"
|
||||
command="@PREFIX@/bin/influxd"
|
||||
command_args="-config @PREFIX@/etc/influxdb/config.toml -pidfile ${pidfile} 1>/dev/null 2>> $STDERR &"
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
|
@ -0,0 +1,41 @@
|
|||
// +build solaris
|
||||
|
||||
package mmap
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func Map(path string) ([]byte, error) {
|
||||
f, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
fi, err := f.Stat()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if fi.Size() == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
data, err := unix.Mmap(int(f.Fd()), 0, int(fi.Size()), syscall.PROT_READ, syscall.MAP_SHARED)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// Unmap closes the memory-map.
|
||||
func Unmap(data []byte) error {
|
||||
if data == nil {
|
||||
return nil
|
||||
}
|
||||
return unix.Munmap(data)
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
|
||||
<service_bundle type='manifest' name='@SMF_NAME@:default'>
|
||||
<service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
|
||||
<create_default_instance enabled='false' />
|
||||
<single_instance />
|
||||
<dependency name='network' grouping='require_all' restart_on='none' type='service'>
|
||||
<service_fmri value='svc:/milestone/network:default' />
|
||||
</dependency>
|
||||
<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
|
||||
<service_fmri value='svc:/system/filesystem/local:default' />
|
||||
</dependency>
|
||||
<method_context working_directory="@DATADIR@">
|
||||
<method_credential user='@INFLUXDB_USER@' group='@INFLUXDB_GROUP@' />
|
||||
</method_context>
|
||||
<exec_method type='method' name='start'
|
||||
exec='@PREFIX@/bin/influxd -config @PKG_SYSCONFDIR@/config.toml -pidfile @DATADIR@/influxdb.pid 2>> @LOGDIR@/influxdb.log &'
|
||||
timeout_seconds="60" />
|
||||
<exec_method type='method' name='stop' exec=':kill' timeout_seconds="60" />
|
||||
<template>
|
||||
<common_name>
|
||||
<loctext xml:lang='C'>InfluxDB Time Series database</loctext>
|
||||
</common_name>
|
||||
<documentation>
|
||||
<manpage title='influxd' section='1' manpath='/@PREFIX@/man' />
|
||||
<doc_link name='homepage' uri='https://docs.influxdata.com/influxdb/' />
|
||||
</documentation>
|
||||
</template>
|
||||
</service>
|
||||
</service_bundle>
|
Loading…
Reference in New Issue