Skip to content

Commit

Permalink
KREST-638 Some small deployment improvements. (confluentinc#806)
Browse files Browse the repository at this point in the history
Fixes the kafka-rest-run-class script to correctly work
with the development assembly target, moves the standalone
assembly target into the main profile, and beefs up a bit
the Deployment section of the README.
  • Loading branch information
dimitarndimitrov authored Feb 18, 2021
1 parent db49191 commit 9feda4d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,21 @@ To install from source, follow the instructions in the Development section below
Deployment
----------

The REST proxy includes a built-in Jetty server. The wrapper scripts
``bin/kafka-rest-start`` and ``bin/kafka-rest-stop`` are the recommended method of
starting and stopping the service.
The REST proxy includes a built-in Jetty server and can be deployed after
being configured to connect to an existing Kafka cluster.

Running ``mvn clean package`` runs all 3 of its assembly targets.
- The ``development`` target assembles all necessary dependencies in a ``kafka-rest/target``
subfolder without packaging them in a distributable format. The wrapper scripts
``bin/kafka-rest-start`` and ``bin/kafka-rest-stop`` can then be used to start and stop the
service.
- The ``package`` target is meant to be used in shared dependency environments and omits some
dependencies expected to be provided externally. It assembles the other dependencies in a
``kafka-rest/target`` subfolder as well as in distributable archives. The wrapper scripts
``bin/kafka-rest-start`` and ``bin/kafka-rest-stop`` can then be used to start and stop the
service.
- The ``standalone`` target packages all necessary dependencies as a distributable JAR that can
be run as standard (``java -jar $base-dir/kafka-rest/target/kafka-rest-X.Y.Z-standalone.jar``).

Quickstart
----------
Expand Down Expand Up @@ -83,7 +95,7 @@ the REST Proxy running using the default settings and some topics already create
Development
-----------

To build a development version, you may need a development versions of
To build a development version, you may need development versions of
[common](https://github.com/confluentinc/common),
[rest-utils](https://github.com/confluentinc/rest-utils), and
[schema-registry](https://github.com/confluentinc/schema-registry). After
Expand Down
2 changes: 1 addition & 1 deletion bin/kafka-rest-run-class
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ base_dir=$(dirname $0)/..

# Development jars. `mvn package` should collect all the required dependency jars here
for dir in $base_dir/kafka-rest/target/kafka-rest-*-development; do
CLASSPATH=$CLASSPATH:$dir/share/java/kafka-rest-bin/*:$dir/share/java/kafka-rest-lib/*
CLASSPATH=$CLASSPATH:$dir/share/java/kafka-rest/*
done

# Production jars
Expand Down
19 changes: 1 addition & 18 deletions kafka-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
<descriptors>
<descriptor>src/assembly/development.xml</descriptor>
<descriptor>src/assembly/package.xml</descriptor>
<descriptor>src/assembly/standalone.xml</descriptor>
</descriptors>
<archive>
<manifest>
Expand Down Expand Up @@ -203,22 +204,4 @@
</plugins>
</build>

<profiles>
<profile>
<id>standalone</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assembly/standalone.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
2 changes: 1 addition & 1 deletion kafka-rest/src/assembly/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<!-- Assembles a package that can run kafka-rest given dependency packages. This is used to
construct packages OS packages where underlying libraries, like rest-utils, can be shared
construct distributables where underlying libraries, like rest-utils, can be shared
-->
<id>package</id>
<formats>
Expand Down

0 comments on commit 9feda4d

Please sign in to comment.