Skip to content

Commit

Permalink
Simplified deployment. With HBase accessible, and gnuplot installed,
Browse files Browse the repository at this point in the history
this works: java -jar ./target/opentsdb-2.1.0RC1-fat.jar tsd.

No requirement for a pre-deployed UI static content directory. The
FatJar contains all the static resources and unloads this content
into the configured/default directory at start time, including the
GWT Web App content and the gnuplot wrapper script. If any content
already exists and has a newer timestamp than the corresponding
resource in the FatJar, the resource is left as is. An additional
FatJar provided command line tool allows for the pre-creation of
the static content directory, which is useful in development.

The process PID is written to a default [and configurable] pid file,
and deleted on clean shutdown.

URL based config and include supporting the load of configuration
files from http:// or file:// based sources.

Configuration properties can be tokenized with System Prop and/or
Environmental Variable decodes as well as JavaScript snippets to
support dynamically computed property values according to the
deployment environment.

Refined logging configuration with configuration override-able
external logging config file location and command line options
to set logging levels for major packages in OpenTSDB and
associated libraries.

Signed-off-by: Chris Larsen <clarsen@yahoo-inc.com>
  • Loading branch information
nickman authored and manolama committed Oct 27, 2016
1 parent 9b6ad09 commit 83d8c89
Show file tree
Hide file tree
Showing 16 changed files with 4,570 additions and 1 deletion.
36 changes: 36 additions & 0 deletions Makefile.am
Expand Up @@ -138,6 +138,11 @@ tsdb_SRC := \
src/tools/TextImporter.java \
src/tools/TreeSync.java \
src/tools/UidManager.java \
src/tools/ArgValueValidator.java \
src/tools/ConfigArgP.java \
src/tools/ConfigMetaType.java \
src/tools/GnuplotInstaller.java \
src/tools/Main.java \
src/tree/Branch.java \
src/tree/Leaf.java \
src/tree/Tree.java \
Expand Down Expand Up @@ -811,6 +816,37 @@ pom.xml: pom.xml.in Makefile
} >$@-t
mv $@-t ../$@

# Generates a maven pom called fat-jar-pom.xml that builds a fat jar
# containing all the dependencies required to run opentsdb
fat-jar-pom.xml: ./fat-jar/fat-jar-pom.xml.in Makefile
(cd $(top_srcdir) ; ./fat-jar/create-src-dir-overlay.sh)
{ \
echo '<!-- Generated by Makefile on '`date`' -->'; \
sed <$< \
-e 's/@ASYNCHBASE_VERSION@/$(ASYNCHBASE_VERSION)/' \
-e 's/@GUAVA_VERSION@/$(GUAVA_VERSION)/' \
-e 's/@GWT_VERSION@/$(GWT_VERSION)/' \
-e 's/@HAMCREST_VERSION@/$(HAMCREST_VERSION)/' \
-e 's/@JACKSON_VERSION@/$(JACKSON_VERSION)/' \
-e 's/@JAVASSIST_VERSION@/$(JAVASSIST_VERSION)/' \
-e 's/@JUNIT_VERSION@/$(JUNIT_VERSION)/' \
-e 's/@LOG4J_OVER_SLF4J_VERSION@/$(LOG4J_OVER_SLF4J_VERSION)/' \
-e 's/@LOGBACK_CLASSIC_VERSION@/$(LOGBACK_CLASSIC_VERSION)/' \
-e 's/@LOGBACK_CORE_VERSION@/$(LOGBACK_CORE_VERSION)/' \
-e 's/@MOCKITO_VERSION@/$(MOCKITO_VERSION)/' \
-e 's/@NETTY_VERSION@/$(NETTY_VERSION)/' \
-e 's/@OBJENESIS_VERSION@/$(OBJENESIS_VERSION)/' \
-e 's/@POWERMOCK_MOCKITO_VERSION@/$(POWERMOCK_MOCKITO_VERSION)/' \
-e 's/@SLF4J_API_VERSION@/$(SLF4J_API_VERSION)/' \
-e 's/@SUASYNC_VERSION@/$(SUASYNC_VERSION)/' \
-e 's/@ZOOKEEPER_VERSION@/$(ZOOKEEPER_VERSION)/' \
-e 's/@spec_title@/$(spec_title)/' \
-e 's/@spec_vendor@/$(spec_vendor)/' \
-e 's/@spec_version@/$(PACKAGE_VERSION)/' \
; \
} >$@-t
mv $@-t ../$@

TIMESTAMP := $(shell date +"%Y%m%d%H%M%S")
RPM_REVISION := 1
RPM_TARGET := noarch
Expand Down
29 changes: 29 additions & 0 deletions fat-jar/create-src-dir-overlay.sh
@@ -0,0 +1,29 @@
# Creates directory structure overlay on top of original source directories so
# that the overlay matches Java package hierarchy.
#!/usr/bin/env bash

if [ ! -d src-main ]; then
mkdir src-main
mkdir src-main/net
mkdir src-main/tsd
(cd src-main/net && ln -s ../../src opentsdb)
(cd src-main/tsd && ln -s ../../src/tsd/QueryUi.gwt.xml QueryUi.gwt.xml)
(cd src-main/tsd && ln -s ../../src/tsd/client client)
fi
if [ ! -d src-test ]; then
mkdir src-test
mkdir src-test/net
(cd src-test/net && ln -s ../../test opentsdb)
fi
if [ ! -d src-resources ]; then
mkdir src-resources
(cd src-resources && ln -s ../fat-jar/logback.xml)
(cd src-resources && ln -s ../fat-jar/file-logback.xml)
(cd src-resources && ln -s ../fat-jar/opentsdb.conf.json)
fi
if [ ! -d test-resources ]; then
mkdir test-resources
(cd test-resources && ln -s ../fat-jar/test-logback.xml)
(cd test-resources && ln -s ../fat-jar/opentsdb.conf.json)
fi

0 comments on commit 83d8c89

Please sign in to comment.