Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ WORKDIR /opt/build
#COPY --from=app-build /opt/build/vclu/target/vclu.jar .

RUN $JAVA_HOME/bin/jlink \
--add-modules java.base,java.net.http,java.xml,java.naming,java.management,jdk.zipfs,jdk.crypto.ec,jdk.httpserver \
--add-modules java.base,java.net.http,java.xml,java.naming,java.management,jdk.zipfs,jdk.crypto.ec,jdk.httpserver,jdk.unsupported \
# --add-modules $(jdeps --ignore-missing-deps --print-module-deps vclu.jar),java.base,java.xml,java.naming,java.management,java.sql,java.instrument,jdk.zipfs \
--strip-debug \
--no-man-pages \
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ exec "setpriv" "--reuid" "ubuntu" "--regid" "ubuntu" "--clear-groups" "--ambient
"$JAVA_HOME/bin/java" \
"-XX:+DisableAttachMechanism" \
"-server" "-Xshare:off" "-XX:+UseContainerSupport" "-XX:+UseZGC" "-XX:+UseDynamicNumberOfGCThreads" \
"--enable-native-access=ALL-UNNAMED" \
"--sun-misc-unsafe-memory-access=allow" \
"-XX:+ExitOnOutOfMemoryError" \
"-Djava.net.preferIPv6Addresses=false" \
"-Djava.net.preferIPv4Stack=true" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ThreadUtil {
System.setProperty("jdk.virtualThreadScheduler.maxPoolSize", String.valueOf(maxPoolSize));
System.setProperty("jdk.virtualThreadScheduler.parallelism", String.valueOf(MIN_RUNNABLE));

System.setProperty("jdk.tracePinnedThreads", "short");
//System.setProperty("jdk.tracePinnedThreads", "short");

LOGGER.debug("Virtual Threads: {}-{}", MIN_RUNNABLE, maxPoolSize);

Expand Down
36 changes: 17 additions & 19 deletions modules/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<jstachio.version>1.3.7</jstachio.version>

<aws.sdk.version>2.32.19</aws.sdk.version>
<paho.mqtt.version>1.2.5</paho.mqtt.version>
<netty.version>4.2.5.Final</netty.version>
<hivemq-mqtt-client.version>1.3.10</hivemq-mqtt-client.version>
<netty.version>4.1.128.Final</netty.version>

<slf4j.version>2.0.17</slf4j.version>
<logback.version>1.5.19</logback.version>
Expand Down Expand Up @@ -240,11 +240,22 @@
<version>${jstachio.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.eclipse.paho/org.eclipse.paho.client.mqttv3 -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>${paho.mqtt.version}</version>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
<version>${hivemq-mqtt-client.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<classifier>linux-x86_64</classifier>
<scope>runtime</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -307,25 +318,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>${netty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-mqtt</artifactId>
<version>${netty.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<classifier>linux-x86_64</classifier>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
25 changes: 12 additions & 13 deletions modules/vclu/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,18 @@
</dependency>

<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
<scope>runtime</scope>
</dependency>

<dependency>
Expand All @@ -85,22 +95,11 @@
<artifactId>moquette-broker</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-mqtt</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<classifier>linux-x86_64</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
29 changes: 18 additions & 11 deletions modules/vclu/src/main/java/pl/psobiech/opengr8on/vclu/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.CountDownLatch;

/**
Expand All @@ -46,11 +47,7 @@ private Main() {
// NOP
}

public static void main(String[] args) throws Exception {
if (args.length < 1) {
throw new UnexpectedException("Missing argument: Network Interface Name or local IP Address");
}

static void main(String[] args) throws Exception {
final Path runtimeDirectory = Paths.get("./runtime").toAbsolutePath();
final Path rootDirectory = runtimeDirectory.resolve("root");

Expand All @@ -61,12 +58,22 @@ public static void main(String[] args) throws Exception {

LOGGER.info("Current VCLU PIN: {}", new String(cluKeys.pin(), StandardCharsets.US_ASCII));

final String networkInterfaceNameOrIpAddress = args[args.length - 1];
final NetworkInterfaceDto networkInterface = IPv4AddressUtil.getLocalIPv4NetworkInterfaceByName(networkInterfaceNameOrIpAddress)
.or(() ->
IPv4AddressUtil.getLocalIPv4NetworkInterfaceByIpAddress(networkInterfaceNameOrIpAddress)
)
.orElseThrow(() -> new UnexpectedException("Cannot find IP address of interface: " + networkInterfaceNameOrIpAddress));
final NetworkInterfaceDto networkInterface;
if (args.length > 0) {
final String networkInterfaceNameOrIpAddress = args[args.length - 1];
networkInterface = IPv4AddressUtil.getLocalIPv4NetworkInterfaceByName(networkInterfaceNameOrIpAddress)
.or(() ->
IPv4AddressUtil.getLocalIPv4NetworkInterfaceByIpAddress(networkInterfaceNameOrIpAddress)
)
.orElseThrow(() -> new UnexpectedException("Cannot find IP address of interface: " + networkInterfaceNameOrIpAddress));
} else {
final List<NetworkInterfaceDto> networkInterfaces = IPv4AddressUtil.getLocalIPv4NetworkInterfaces();
if (networkInterfaces.isEmpty()) {
throw new UnexpectedException("No network interfaces found");
}

networkInterface = networkInterfaces.getFirst();
}

final CLUDevice cluDevice = readCluDevice(aDriveDirectory, networkInterface, cluKeys);

Expand Down
Loading
Loading