-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Cos integration for KSQL. #663
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fb7a5f0
Cos integration for KSQL.
hjafarpour c0dfac8
Changed java version in comments to 8.
hjafarpour 5f5981d
Applied review feedback. Renamed the files for ksql.
hjafarpour 7b70567
Added ksql confluent files.
hjafarpour 1ac9ba2
Updated log directories.
hjafarpour 1614692
honor LOG_DIR.
hjafarpour 37e902b
Set the default for LOG_DIR if it's not set.
hjafarpour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# Dependencies you'll probably need to install to compile this: make, curl, git, | ||
# zip, unzip, patch, java8-jdk | openjdk-8-jdk, maven. | ||
|
||
SHELL=/bin/bash | ||
|
||
ifndef VERSION | ||
# Note that this is sensitive to this package's version being the first | ||
# <version> tag in the pom.xml | ||
VERSION=$(shell grep version pom.xml | head -n 1 | awk -F'>|<' '{ print $$3 }') | ||
endif | ||
|
||
export PACKAGE_TITLE=ksql | ||
export FULL_PACKAGE_TITLE=confluent-ksql | ||
export PACKAGE_NAME=$(FULL_PACKAGE_TITLE)-$(VERSION) | ||
|
||
# Defaults that are likely to vary by platform. These are cleanly separated so | ||
# it should be easy to maintain altered values on platform-specific branches | ||
# when the values aren't overridden by the script invoking the Makefile | ||
|
||
# Whether we should apply patches. This only makes sense for alternate packaging | ||
# systems that know how to apply patches themselves, e.g. Debian. | ||
APPLY_PATCHES?=yes | ||
|
||
# DESTDIR may be overriden by e.g. debian packaging | ||
ifeq ($(DESTDIR),) | ||
DESTDIR=$(CURDIR)/BUILD/ | ||
endif | ||
|
||
ifeq ($(PACKAGE_TYPE),archive) | ||
PREFIX=$(PACKAGE_NAME) | ||
SYSCONFDIR=$(PREFIX)/etc/$(PACKAGE_TITLE) | ||
SYSTEMDDIR=$(PREFIX)/lib/systemd/system | ||
else | ||
PREFIX=/usr | ||
SYSCONFDIR=/etc/$(PACKAGE_TITLE) | ||
SYSTEMDDIR=/lib/systemd/system | ||
endif | ||
|
||
# Whether we should run tests during the build. | ||
SKIP_TESTS?=yes | ||
|
||
all: install | ||
|
||
|
||
archive: install | ||
rm -f $(CURDIR)/$(PACKAGE_NAME).tar.gz && cd $(DESTDIR) && tar -czf $(CURDIR)/$(PACKAGE_NAME).tar.gz $(PREFIX) | ||
rm -f $(CURDIR)/$(PACKAGE_NAME).zip && cd $(DESTDIR) && zip -r $(CURDIR)/$(PACKAGE_NAME).zip $(PREFIX) | ||
|
||
apply-patches: $(wildcard patches/*) | ||
ifeq ($(APPLY_PATCHES),yes) | ||
git reset --hard HEAD | ||
cat patches/series | xargs -iPATCH bash -c 'patch -p1 < patches/PATCH' | ||
endif | ||
|
||
build: apply-patches | ||
ifeq ($(SKIP_TESTS),yes) | ||
mvn -DskipTests=true install | ||
else | ||
mvn install | ||
endif | ||
|
||
BINPATH=$(PREFIX)/bin | ||
LIBPATH=$(PREFIX)/share/java/$(PACKAGE_TITLE) | ||
DOCPATH=$(PREFIX)/share/doc/$(PACKAGE_TITLE) | ||
|
||
INSTALL=install -D -m 644 | ||
INSTALL_X=install -D -m 755 | ||
|
||
install: build | ||
# Safety precatuion to avoid removing of root dir when DESTDIR or PREFIX is not set, for wathever reason | ||
if [[ $(DESTDIR)$(PREFIX) != /tmp/confluent/* ]]; then echo "DESTDIR=$(DESTDIR) or PREFIX=$(PREFIX) is weird" ; exit 1 ; fi | ||
rm -rf $(DESTDIR)$(PREFIX) | ||
mkdir -p $(DESTDIR)$(PREFIX) | ||
mkdir -p $(DESTDIR)$(BINPATH) | ||
mkdir -p $(DESTDIR)$(LIBPATH) | ||
mkdir -p $(DESTDIR)$(SYSCONFDIR) | ||
for svc in debian/*.service ; do \ | ||
$(INSTALL) -o root -g root -D $$svc $(DESTDIR)$(SYSTEMDDIR)/$$(basename $$svc) ; \ | ||
done | ||
pushd "ksql/target/ksql-$(VERSION)-package" ; \ | ||
find bin/ -type f | grep -v README[.]rpm | xargs -I XXX $(INSTALL_X) -o root -g root XXX $(DESTDIR)$(PREFIX)/XXX ;\ | ||
find share/ -type f | grep -v README[.]rpm | xargs -I XXX $(INSTALL) -o root -g root XXX $(DESTDIR)$(PREFIX)/XXX ; \ | ||
pushd etc/ksql/ ; \ | ||
find . -type f | grep -v README[.]rpm | xargs -I XXX $(INSTALL) -o root -g root XXX $(DESTDIR)$(SYSCONFDIR)/XXX | ||
|
||
|
||
clean: | ||
rm -rf $(CURDIR)/$(PACKAGE_NAME)* | ||
rm -rf $(FULL_PACKAGE_TITLE)-$(RPM_VERSION)*rpm | ||
rm -rf RPM_BUILDING | ||
|
||
distclean: clean | ||
git reset --hard HEAD | ||
git status --ignored --porcelain | cut -d ' ' -f 2 | xargs rm -rf | ||
|
||
test: | ||
|
||
.PHONY: clean install | ||
|
||
|
||
|
||
RPM_VERSION=$(shell echo $(VERSION) | sed -e 's/-alpha[0-9]*//' -e 's/-beta[0-9]*//' -e 's/-rc[0-9]*//' -e 's/-SNAPSHOT//') | ||
# Get any -alpha, -beta, -rc piece that we need to put into the Release part of | ||
# the version since RPM versions don't support non-numeric | ||
# characters. Ultimately, for something like 0.8.2-beta, we want to end up with | ||
# Version=0.8.2 Release=0.X.beta | ||
# where X is the RPM release # of 0.8.2-beta (the prefix 0. forces this to be | ||
# considered earlier than any 0.8.2 final releases since those will start with | ||
# Version=0.8.2 Release=1) | ||
RPM_RELEASE_POSTFIX=$(subst -,,$(subst $(RPM_VERSION),,$(VERSION))) | ||
ifneq ($(RPM_RELEASE_POSTFIX),) | ||
RPM_RELEASE_POSTFIX_UNDERSCORE=_$(RPM_RELEASE_POSTFIX) | ||
RPM_RELEASE_ID=0.$(REVISION).$(RPM_RELEASE_POSTFIX) | ||
else | ||
RPM_RELEASE_ID=$(REVISION) | ||
endif | ||
|
||
|
||
|
||
rpm: RPM_BUILDING/SOURCES/$(FULL_PACKAGE_TITLE)-$(RPM_VERSION).tar.gz | ||
echo "Building the rpm" | ||
rpmbuild --define="_topdir `pwd`/RPM_BUILDING" -tb $< | ||
find RPM_BUILDING/{,S}RPMS/ -type f | xargs -n1 -iXXX mv XXX . | ||
echo | ||
echo "=================================================" | ||
echo "The rpms have been created and can be found here:" | ||
@ls -laF $(FULL_PACKAGE_TITLE)*rpm | ||
echo "=================================================" | ||
|
||
# Unfortunately, because of version naming issues and the way rpmbuild expects | ||
# the paths in the tar file to be named, we need to rearchive the package. So | ||
# instead of depending on archive, this target just uses the unarchived, | ||
# installed version to generate a new archive. Note that we always regenerate | ||
# the symlink because the RPM_VERSION doesn't include all the version info -- it | ||
# can leave of things like -beta, -rc1, etc. | ||
RPM_BUILDING/SOURCES/$(FULL_PACKAGE_TITLE)-$(RPM_VERSION).tar.gz: rpm-build-area install debian/$(FULL_PACKAGE_TITLE).spec.in RELEASE_$(RPM_VERSION)$(RPM_RELEASE_POSTFIX_UNDERSCORE) | ||
rm -rf $(FULL_PACKAGE_TITLE)-$(RPM_VERSION) | ||
mkdir $(FULL_PACKAGE_TITLE)-$(RPM_VERSION) | ||
cp -R $(DESTDIR)/* $(FULL_PACKAGE_TITLE)-$(RPM_VERSION) | ||
sed "s@##RPMVERSION##@$(RPM_VERSION)@g; s@##RPMRELEASE##@$(RPM_RELEASE_ID)@g" < debian/$(FULL_PACKAGE_TITLE).spec.in > $(FULL_PACKAGE_TITLE)-$(RPM_VERSION)/$(FULL_PACKAGE_TITLE).spec | ||
rm -f $@ && tar -czf $@ $(FULL_PACKAGE_TITLE)-$(RPM_VERSION) | ||
rm -rf $(FULL_PACKAGE_TITLE)-$(RPM_VERSION) | ||
|
||
rpm-build-area: RPM_BUILDING/BUILD RPM_BUILDING/RPMS RPM_BUILDING/SOURCES RPM_BUILDING/SPECS RPM_BUILDING/SRPMS | ||
|
||
RPM_BUILDING/%: | ||
mkdir -p $@ | ||
|
||
RELEASE_%: | ||
echo 0 > $@ | ||
|
||
check: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
confluent-ksql (0.1~SNAPSHOT-1) unstable; urgency=low | ||
|
||
* Initial release. | ||
|
||
-- Confluent Packaging <[email protected]> Fri, 02 Dec 2015 22:09:36 +0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Source: confluent-ksql | ||
Section: misc | ||
Priority: optional | ||
Maintainer: Confluent Packaging <[email protected]> | ||
Build-Depends: debhelper (>= 9), dh-systemd, java8-jdk, javahelper (>= 0.40), | ||
make, maven | ||
Standards-Version: 3.9.3 | ||
Homepage: http://confluent.io | ||
|
||
Package: confluent-ksql | ||
Architecture: all | ||
Depends: ${misc:Depends}, confluent-rest-utils, adduser | ||
Description: Streaming SQL engine for Apache Kafka. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: ksql | ||
Source: https://github.com/confluentinc/ksql | ||
|
||
Files: * | ||
Copyright: 2014 Confluent, Inc. | ||
License: Apache-2 | ||
|
||
Files: debian/* | ||
Copyright: 2014 Confluent, Inc. | ||
License: Apache-2 | ||
|
||
License: Apache-2 | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
use this file except in compliance with the License. You may obtain a copy of | ||
the License at | ||
. | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
. | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
License for the specific language overning permissions and limitations under | ||
the License. | ||
. | ||
On Debian systems, the Apache 2.0 license can be found in | ||
/usr/share/common-licenses/Apache-2.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[DEFAULT] | ||
upstream-tree=tag | ||
upstream-tag=%(version)s | ||
debian-tag=debian-%(version)s | ||
debian-branch=debian-%(version)s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
standard_build_layout.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/Makefile b/Makefile | ||
new file mode 100644 | ||
index 0000000..3f83b80 | ||
--- /dev/null | ||
+++ b/Makefile | ||
@@ -0,0 +1,8 @@ | ||
+clean: | ||
+ | ||
+distclean: | ||
+ | ||
+%: | ||
+ cp debian/Makefile Makefile.debian | ||
+ $(MAKE) -f Makefile.debian $@ | ||
+ rm -f Makefile.debian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/make -f | ||
|
||
%: | ||
dh $@ --with javahelper,systemd | ||
|
||
override_dh_systemd_enable: | ||
dh_systemd_enable --no-enable | ||
|
||
override_dh_systemd_start: | ||
dh_systemd_start --no-start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 (quilt) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hint:
To (manually) verify final package contents, do:
for archive:
tar tvzf output/..ksql..tar.gz
rpm:
rpm -qpl output/..ksql..rpm
deb:
dpkg -c output/..ksql..all.deb