Skip to content

Commit

Permalink
Merge branch 'develop' into cvmgr-cimms-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob6838 committed Dec 10, 2024
2 parents adcb888 + bafdb2e commit a287040
Show file tree
Hide file tree
Showing 46 changed files with 906 additions and 106 deletions.
62 changes: 37 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,42 +52,54 @@ FROM maven:3.8-eclipse-temurin-21-alpine as jbuilder

WORKDIR /home

ARG MAVEN_GITHUB_TOKEN
ARG MAVEN_GITHUB_ORG

ENV MAVEN_GITHUB_TOKEN=$MAVEN_GITHUB_TOKEN
ENV MAVEN_GITHUB_ORG=$MAVEN_GITHUB_ORG

# Copy only the files needed to avoid putting all sorts of junk from your local env on to the image
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/pom.xml ./jpo-ode/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-common/pom.xml ./jpo-ode/jpo-ode-common/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-common/src ./jpo-ode/jpo-ode-common/src
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-plugins/pom.xml ./jpo-ode/jpo-ode-plugins/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-plugins/src ./jpo-ode/jpo-ode-plugins/src
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-core/pom.xml ./jpo-ode/jpo-ode-core/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-core/src ./jpo-ode/jpo-ode-core/src/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-svcs/pom.xml ./jpo-ode/jpo-ode-svcs/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-svcs/src ./jpo-ode/jpo-ode-svcs/src

COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-geojsonconverter/pom.xml ./jpo-geojsonconverter/
COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-geojsonconverter/src ./jpo-geojsonconverter/src

COPY ./jpo-conflictmonitor/jpo-conflictmonitor/pom.xml ./jpo-conflictmonitor/
COPY ./jpo-conflictmonitor/jpo-conflictmonitor/src ./jpo-conflictmonitor/src
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/pom.xml ./jpo-ode/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-common/pom.xml ./jpo-ode/jpo-ode-common/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-common/src ./jpo-ode/jpo-ode-common/src
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-plugins/pom.xml ./jpo-ode/jpo-ode-plugins/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-plugins/src ./jpo-ode/jpo-ode-plugins/src
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-core/pom.xml ./jpo-ode/jpo-ode-core/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-core/src ./jpo-ode/jpo-ode-core/src/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-svcs/pom.xml ./jpo-ode/jpo-ode-svcs/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-ode/jpo-ode-svcs/src ./jpo-ode/jpo-ode-svcs/src

# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-geojsonconverter/pom.xml ./jpo-geojsonconverter/
# COPY ./jpo-conflictmonitor/jpo-geojsonconverter/jpo-geojsonconverter/src ./jpo-geojsonconverter/src

# COPY ./jpo-conflictmonitor/jpo-conflictmonitor/pom.xml ./jpo-conflictmonitor/
# COPY ./jpo-conflictmonitor/jpo-conflictmonitor/src ./jpo-conflictmonitor/src

COPY ./jpo-conflictvisualizer-api/pom.xml ./jpo-conflictvisualizer-api/
COPY ./jpo-conflictvisualizer-api/src ./jpo-conflictvisualizer-api/src
COPY ./jpo-conflictvisualizer-api/settings.xml ./jpo-conflictvisualizer-api/

WORKDIR /home/jpo-conflictvisualizer-api
RUN mvn -s settings.xml dependency:resolve

WORKDIR /home/jpo-ode
COPY ./jpo-conflictvisualizer-api/src ./src
RUN mvn -s settings.xml install -DskipTests

RUN mvn install -DskipTests
# WORKDIR /home/jpo-ode

WORKDIR /home/jpo-geojsonconverter
# RUN mvn install -DskipTests

RUN mvn clean install -DskipTests
# WORKDIR /home/jpo-geojsonconverter

WORKDIR /home/jpo-conflictmonitor
# RUN mvn clean install -DskipTests

RUN mvn clean install -DskipTests
# WORKDIR /home/jpo-conflictmonitor

WORKDIR /home/jpo-conflictvisualizer-api
# RUN mvn clean install -DskipTests

# WORKDIR /home/jpo-conflictvisualizer-api

RUN mvn clean package -DskipTests
ENTRYPOINT ["tail", "-f", "/dev/null"]
# RUN mvn clean package -DskipTests
# ENTRYPOINT ["tail", "-f", "/dev/null"]


# # === RUNTIME IMAGE for Java and ACM ===
Expand Down
2 changes: 1 addition & 1 deletion asn1_codec
Submodule asn1_codec updated from 3b4076 to 6ce858
1 change: 0 additions & 1 deletion jpo-conflictmonitor
Submodule jpo-conflictmonitor deleted from 6cfe9f
77 changes: 69 additions & 8 deletions jpo-conflictvisualizer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-conflictvisualizer-api</artifactId>
<version>1.3.1-SNAPSHOT</version>
<version>1.4.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jpo-conflictvisualizer-api</name>
<description>Conflict Visualizer</description>
Expand All @@ -23,6 +23,8 @@
<sonar.language>java</sonar.language>
<!-- <thymeleaf.version>3.0.3.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.1</thymeleaf-layout-dialect.version> -->
<!-- Allow override of github organization when publishing artifacts to github -->
<github_organization>usdot-jpo-ode</github_organization>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -98,7 +100,7 @@
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-ode-core</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<!-- required exclusion to preserve keycloak versions -->
<exclusions>
<exclusion>
Expand All @@ -107,27 +109,42 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-ode-core</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-ode-plugins</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-ode-svcs</artifactId>
<version>2.1.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-geojsonconverter</artifactId>
<version>1.3.1-SNAPSHOT</version>
<classifier>jpo-geojsonconverter</classifier>
<version>1.4.2</version>
<!-- Allow using newer streams version than geojsonconverter -->
<exclusions>
<exclusion>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams-test-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>usdot.jpo.ode</groupId>
<artifactId>jpo-conflictmonitor</artifactId>
<version>1.3.1-SNAPSHOT</version>
<classifier>jpo-conflictmonitor</classifier>
<version>1.5.0</version>
<!-- <classifier>jpo-conflictmonitor</classifier> -->
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -290,5 +307,49 @@
</plugin>
</plugins>
</build>
<!-- profile to output only source code and not include any spring boot dependencies in
published jar -->
<profiles>
<profile>
<id>package-jar</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>
us.dot.its.jpo.ode.api.ConflictApiApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>repackage</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- GitHub Artifact publishing configuration -->
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/${github_organization}/jpo-conflictvisualizer</url>
</repository>
</distributionManagement>

</project>
67 changes: 67 additions & 0 deletions jpo-conflictvisualizer-api/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<activeProfiles>
<activeProfile>default</activeProfile>
</activeProfiles>
<servers>
<server>
<id>github</id>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
<server>
<id>github_jpo_ode</id>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
<server>
<id>github_jpo_geojsonconverter</id>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
<server>
<id>github_jpo_conflictmonitor</id>
<username>jpo_conflictvisualizer</username>
<password>${env.MAVEN_GITHUB_TOKEN}</password>
</server>
</servers>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/${env.MAVEN_GITHUB_ORG}/jpo-ode</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>github_jpo_ode</id>
<name>GitHub JPO ODE</name>
<url>https://maven.pkg.github.com/${env.MAVEN_GITHUB_ORG}/jpo-ode</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>github_jpo_geojsonconverter</id>
<name>GitHub JPO GeojsonConverter</name>
<url>https://maven.pkg.github.com/${env.MAVEN_GITHUB_ORG}/jpo-geojsonconverter</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>github_jpo_conflictmonitor</id>
<name>GitHub JPO ConflictMonitor</name>
<url>https://maven.pkg.github.com/${env.MAVEN_GITHUB_ORG}/jpo-conflictmonitor</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</settings>
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ public APIServiceController(
try {

logger.info("Starting {}", this.getClass().getSimpleName());

System.out.println("Controller is Null" + stompController != null);

SpatSocketForwardTopology spatSocketForwardTopology = new SpatSocketForwardTopology(
"topic.ProcessedSpat",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class ConflictMonitorApiProperties {
private String securitySvcsSignatureEndpoint = "sign";



private int lingerMs = 0;


@Autowired
Expand Down Expand Up @@ -185,6 +185,15 @@ public void setKafkaBrokers(String kafkaBrokers) {
this.kafkaBrokers = kafkaBrokers;
}

@Value("${kafka.linger_ms}")
public void setKafkaLingerMs(int lingerMs) {
this.lingerMs = lingerMs;
}

public int getKafkaLingerMs() {
return lingerMs;
}

public String getKafkaProducerType() {
return kafkaProducerType;
}
Expand Down Expand Up @@ -257,6 +266,8 @@ public void setKafkaTopicsDisabledSet(Set<String> kafkaTopicsDisabledSet) {
this.kafkaTopicsDisabledSet = kafkaTopicsDisabledSet;
}




@Bean
public ObjectMapper defaultMapper() {
Expand Down Expand Up @@ -380,7 +391,11 @@ public Properties createStreamProperties(String name) {
streamProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, FIVE_MINUTES_MS);

// Disable batching
streamProps.put(ProducerConfig.BATCH_SIZE_CONFIG, 0);
// streamProps.put(ProducerConfig.BATCH_SIZE_CONFIG, 0);

streamProps.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "zstd");
streamProps.put(ProducerConfig.LINGER_MS_CONFIG, getKafkaLingerMs());


if (confluentCloudEnabled) {
streamProps.put("ssl.endpoint.identification.algorithm", "https");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,29 @@ public class MongoConfig extends AbstractMongoClientConfiguration{
@Value("${spring.data.mongodb.password}")
private String password;

@Value("${spring.data.mongodb.authenticationDatabase}")
private String authenticationDatabase;

@Value("${spring.data.mongodb.uri}")
private String overrideURI;

@Override
protected String getDatabaseName() {
return db;
}

@Override
public void configureClientSettings(MongoClientSettings.Builder builder) {
// customization hook
String uri = "mongodb://"+username+":"+password+"@"+host+":"+port+"/"+db;

String uri = "";

if(overrideURI != null && !overrideURI.isEmpty() && !overrideURI.equals("null")){
uri = overrideURI;
}else{
uri = "mongodb://"+username+":"+password+"@"+host+":"+port+"/"+db + "?authSource="+authenticationDatabase;
}


// String uri = "mongodb://"+host+":"+port+"/"+db;
System.out.println("Connecting to MongoDB at: " + uri);
builder.applyConnectionString(new ConnectionString(uri));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ public void addSpatBroadcastRateDistribution(List<IDCount> data, Long startTime,
for(IDCount elem : data){
int index = Integer.parseInt(elem.getId()) / 10;
output.get(index).setCount(elem.getCount());
System.out.println(elem);
}

// Convert to Chart Data and generate graph
Expand Down Expand Up @@ -348,7 +347,6 @@ public void addMapBroadcastRateDistribution(List<IDCount> data, Long startTime,
for(IDCount elem : data){
int index = Integer.parseInt(elem.getId());
output.get(index).setCount(elem.getCount());
System.out.println(elem);
}

// Convert to Chart Data and generate graph
Expand Down
Loading

0 comments on commit a287040

Please sign in to comment.