Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(worker): add new module azkarra-worker
- add scripts to build Docker image for azkarra-worker - cleanup maven pom.xml for log4j2 dependencies
- Loading branch information
1 parent
a3e5525
commit 25f9083
Showing
14 changed files
with
575 additions
and
9 deletions.
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,20 @@ | ||
/azkarra-* | ||
*.iml | ||
build-deploy-site.sh | ||
checkstyle | ||
.circleci | ||
CONTRIBUTING.md | ||
docs | ||
generate-deploy-apidocs.sh | ||
.git | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.idea | ||
images | ||
LICENSE | ||
Makefile | ||
pom.xml | ||
README.md | ||
site | ||
target |
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,51 @@ | ||
# Copyright 2019 StreamThoughts. | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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 governing permissions and | ||
# limitations under the License. | ||
# | ||
# Azkarra Streams Worker | ||
# VERSION 0.5.0 | ||
FROM azul/zulu-openjdk:13 | ||
|
||
ARG azkarraVersion | ||
ARG azkarraBranch | ||
ARG azkarraCommit | ||
|
||
ENV AZKARRA_HOME="/usr/local/azkarra" \ | ||
AZKARRA_VERSION="${azkarraVersion}" \ | ||
AZKARRA_COMMIT="${azkarraCommit}" \ | ||
AZKARRA_BRANCH="${azkarraBranch}" | ||
|
||
RUN mkdir -p ${AZKARRA_HOME} \ | ||
mkdir -p ${AZKARRA_HOME}/share/java/azkarra-worker | ||
|
||
# Copy dependencies | ||
COPY ./docker-build/dependencies/ ${AZKARRA_HOME}/share/java/azkarra-worker | ||
|
||
# Copy resources | ||
COPY ./docker-entrypoint.sh / | ||
COPY ./docker-build/resources/ ${AZKARRA_HOME}/ | ||
|
||
# Copy classes | ||
COPY ./docker-build/classes/ ${AZKARRA_HOME}/share/java/azkarra-worker | ||
|
||
LABEL io.streamthoughts.docker.name="azkarra-streams" \ | ||
io.streamthoughts.docker.version=$AZKARRA_VERSION \ | ||
io.streamthoughts.docker.branch=$AZKARRA_VERSION \ | ||
io.streamthoughts.docker.commit=$AZKARRA_VERSION | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] |
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,48 @@ | ||
# Makefile used to build docker images for Azkarra | ||
|
||
AZKARRA_VERSION := $(shell mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout) | ||
GIT_COMMIT := $(shell git rev-parse --short HEAD) | ||
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) | ||
|
||
REPOSITORY = streamthoughts | ||
IMAGE = azkarra-streams-worker | ||
DIST_DIR = ./azkarra-worker/target/distribution/azkarra-worker-${AZKARRA_VERSION} | ||
|
||
.SILENT: | ||
|
||
all: build-images clean-build | ||
|
||
clean-containers: | ||
echo "Cleaning containers \n========================================== "; | ||
|
||
clean-images: | ||
echo "Cleaning images \n========================================== "; | ||
for image in `docker images -qf "label=io.streamthoughts.docker.name"`; do \ | ||
echo "Removing image $${image} \n==========================================\n " ; \ | ||
docker rmi -f $${image} || exit 1 ; \ | ||
done | ||
|
||
clean-build: | ||
echo "Cleaning build directory \n========================================== "; | ||
rm -rf ./docker-build; | ||
|
||
build-images: | ||
echo "Building image \n========================================== "; | ||
echo "AZKARRA_VERSION="$(AZKARRA_VERSION) | ||
echo "GIT_COMMIT="$(GIT_COMMIT) | ||
echo "GIT_BRANCH="$(GIT_BRANCH) | ||
echo "==========================================\n " | ||
mkdir -p ./docker-build/classes && mkdir -p ./docker-build/dependencies && mkdir -p ./docker-build/resources; | ||
mvn clean package && \ | ||
cp -r ${DIST_DIR}/bin ./docker-build/resources/ && \ | ||
cp -r ${DIST_DIR}/etc ./docker-build/resources/ && \ | ||
find ${DIST_DIR}/share/java/ -type f -regextype posix-egrep -not -iregex '^.*(?-worker)/(?azkarra-).*\.jar' -print0 | xargs -0 cp -t ./docker-build/dependencies && \ | ||
find ${DIST_DIR}/share/java/ -type f -regextype posix-egrep -iregex '^.*(?-worker)/(?azkarra-).*\.jar' -print0 | xargs -0 cp -t ./docker-build/classes && \ | ||
docker build \ | ||
--build-arg azkarraVersion=${AZKARRA_VERSION} \ | ||
--build-arg azkarraCommit=${GIT_COMMIT} \ | ||
--build-arg azkarraBranch=${GIT_BRANCH} \ | ||
-t ${REPOSITORY}/${IMAGE}:latest . || exit 1 ; | ||
docker tag ${REPOSITORY}/${IMAGE}:latest ${REPOSITORY}/azkarra-streams:${AZKARRA_VERSION} || exit 1 ; | ||
|
||
clean: clean-containers clean-images clean-build |
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
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,11 @@ | ||
azkarra { | ||
context { | ||
streams { | ||
bootstrap.servers = "localhost:9092" | ||
default.key.serde = "org.apache.kafka.common.serialization.Serdes$StringSerde" | ||
default.value.serde = "org.apache.kafka.common.serialization.Serdes$StringSerde" | ||
} | ||
|
||
enable.wait.for.topics = true | ||
} | ||
} |
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,46 @@ | ||
<!-- | ||
Copyright 2019 StreamThoughts. | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You 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 governing permissions and | ||
limitations under the License. | ||
--> | ||
<Configuration status="INFO"> | ||
<Appenders> | ||
<Console name="Console" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> | ||
</Console> | ||
<RollingFile | ||
name="RollingFile" | ||
fileName="${sys:log4j.logsDir}/azkarra-worker.log" | ||
filePattern="${sys:log4j.logsDir}/azkarra-worker.%i.log.gz" | ||
ignoreExceptions="false"> | ||
<PatternLayout> | ||
<Pattern>%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Pattern> | ||
</PatternLayout> | ||
<Policies> | ||
<SizeBasedTriggeringPolicy size="100MB" /> | ||
</Policies> | ||
<DefaultRolloverStrategy max="5" /> | ||
</RollingFile> | ||
</Appenders> | ||
<Loggers> | ||
<Logger name="org.apache.kafka" level="INFO"/> | ||
<Logger name="io.streamthoughts" level="INFO"/> | ||
<Root level="error"> | ||
<AppenderRef ref="RollingFile"/> | ||
<AppenderRef ref="Console"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
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,146 @@ | ||
<!-- | ||
Copyright 2019 StreamThoughts. | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You 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 governing permissions and | ||
limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>azkarra-streams-reactor</artifactId> | ||
<groupId>io.streamthoughts</groupId> | ||
<version>0.5-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>azkarra-worker</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<name>Azkarra Streams Worker</name> | ||
<description>Standalone Azkarra Streams application</description> | ||
|
||
<properties> | ||
<checkstyle.config.location>${project.parent.basedir}</checkstyle.config.location> | ||
</properties> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<release>11</release> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>false</addClasspath> | ||
<mainClass>io.streamthoughts.azkarra.AzkarraWorker</mainClass> | ||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<configuration> | ||
<descriptors> | ||
<descriptor>src/assembly/package.xml</descriptor> | ||
<descriptor>src/assembly/development.xml</descriptor> | ||
</descriptors> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<outputDirectory>./target/distribution</outputDirectory> | ||
<finalName>${project.artifactId}-${project.version}</finalName> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-make-assembly</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.apache.kafka</groupId> | ||
<artifactId>kafka-streams</artifactId> | ||
<scope>compile</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.streamthoughts</groupId> | ||
<artifactId>azkarra-streams</artifactId> | ||
<version>${project.version}</version> | ||
<scope>compile</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<!-- START dependencies for logging --> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-core</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-slf4j-impl</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<!-- END dependencies for logging --> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.