Skip to content

Commit

Permalink
Remove uber jar (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
chia7712 authored Jun 6, 2022
1 parent 4923d28 commit 5d55b1b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Run the tool from source code

Run the tool from release
```shell
java -jar app-0.0.1-SNAPSHOT-all.jar offset --bootstrap.servers 192.168.50.178:19993
./docker/start_kafka_tool.sh offset --bootstrap.servers 192.168.50.178:19993
```

### Offset Explorer Configurations
Expand Down Expand Up @@ -253,17 +253,17 @@ Run the tool from source code
Run the tool from release
```shell
# fetch every Mbeans from specific JMX server.
java -jar app-0.0.1-SNAPSHOT-all.jar metrics --jmx.server 192.168.50.178:1099
./docker/start_kafka_tool.sh metrics --jmx.server 192.168.50.178:1099

# fetch any Mbean that its object name contains property "type=Memory".
java -jar app-0.0.1-SNAPSHOT-all.jar metrics --jmx.server 192.168.50.178:1099 --property type=Memory
./docker/start_kafka_tool.sh metrics --jmx.server 192.168.50.178:1099 --property type=Memory

# fetch any Mbean that belongs to "kafka.network" domain name,
# and it's object name contains two properties "request=Metadata" and "name=LocalTimeMs".
java -jar app-0.0.1-SNAPSHOT-all.jar metrics --jmx.server 192.168.50.178:1099 --domain kafka.network --property request=Metadata --property name=LocalTimeMs
./docker/start_kafka_tool.sh metrics --jmx.server 192.168.50.178:1099 --domain kafka.network --property request=Metadata --property name=LocalTimeMs

# list all Mbeans' object name on specific JMX server.
java -jar app-0.0.1-SNAPSHOT-all.jar metrics --jmx.server 192.168.50.178:1099 --view-object-name-list
./docker/start_kafka_tool.sh metrics --jmx.server 192.168.50.178:1099 --view-object-name-list
```

### Metric Explorer Configurations
Expand Down
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.0'
id 'maven-publish'
}

Expand Down Expand Up @@ -41,8 +40,8 @@ dependencies {

application {
// Define the main class for the application.
mainClass = 'org.astraea.App'
applicationDefaultJvmArgs = ["-server", "-XX:+UseG1GC", "-Djava.awt.headless=true", "-Xms4G", "-Xmx4G"]
mainClass = 'org.astraea.app.App'
applicationDefaultJvmArgs = ["-server", "-XX:+UseG1GC", "-Djava.awt.headless=true"]
}

java {
Expand Down
13 changes: 4 additions & 9 deletions docker/start_kafka_tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ function showHelp() {

function generateDockerfile() {
echo "# this dockerfile is generated dynamically
FROM ubuntu:22.04 AS build
# Do not ask for confirmations when running apt-get, etc.
ENV DEBIAN_FRONTEND noninteractive
# install tools
RUN apt-get update && apt-get install -y openjdk-11-jdk git curl
FROM ghcr.io/skiptests/astraea/deps AS build
# clone repo
WORKDIR /tmp
Expand All @@ -43,7 +37,7 @@ WORKDIR /tmp/astraea
RUN git checkout $VERSION
RUN ./gradlew clean build -x test --no-daemon
RUN mkdir /opt/astraea
RUN cp \$(find ./app/build/libs/ -maxdepth 1 -type f -name app-*-all.jar) /opt/astraea/app.jar
RUN tar -xvf \$(find ./app/build/distributions/ -maxdepth 1 -type f -name app-*.tar) -C /opt/astraea/ --strip-components=1
FROM ubuntu:22.04
Expand Down Expand Up @@ -99,10 +93,11 @@ function runContainer() {

docker run --rm --init \
$background \
-e JAVA_OPTS="$JMX_OPTS $HEAP_OPTS" \
-p $JMX_PORT:$JMX_PORT \
$need_to_bind_web \
"$IMAGE_NAME" \
/bin/bash -c "java $JMX_OPTS $HEAP_OPTS -jar /opt/astraea/app.jar $args"
/opt/astraea/bin/app $args
}

# ===================================[main]===================================
Expand Down

0 comments on commit 5d55b1b

Please sign in to comment.