Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Release/2025 q1 into master #8

Merged
merged 28 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e2cfade
Copying over deduplicator from jpo-utils
John-Wiens Jan 24, 2025
ea0c1ab
Changed Docker file context
John-Wiens Jan 24, 2025
0804fee
Changing CI Settings Directory
John-Wiens Jan 24, 2025
9b33811
Updated Release Notes
John-Wiens Jan 24, 2025
d1ce98c
Removing unnecessary print statements
John-Wiens Jan 28, 2025
90c55b2
Changed Environment Variables names to allow default values
John-Wiens Jan 28, 2025
187f82c
Updating Submodules
John-Wiens Jan 28, 2025
db09e60
Adding in ODE as Submodule Dependency
John-Wiens Jan 30, 2025
0abf851
Including Publish Profile for Github
John-Wiens Jan 30, 2025
8bd15f7
Modify CI to only build on push
John-Wiens Jan 30, 2025
717be7e
various updates to initial repo setup
Michael7371 Jan 31, 2025
792a332
map unit test refactor
Michael7371 Jan 31, 2025
30d8c1c
Updated Bsm Messages to use Version 7 Schemas
John-Wiens Jan 31, 2025
ffb4eaa
Updating Unit Tests to use Schema Version 8
John-Wiens Jan 31, 2025
b9f14a0
Updated Processed Map Unit Test to new Schema
John-Wiens Jan 31, 2025
bbb65b0
Updated Processed Map WKT to the latest Schema
John-Wiens Feb 1, 2025
e710a92
Updating Processed Spat unit tests to latest schemas
John-Wiens Feb 1, 2025
0842564
Updated TIM message to latest Schema
John-Wiens Feb 1, 2025
912deba
Merge pull request #2 from usdot-jpo-ode/unit-test-fixes
John-Wiens Feb 1, 2025
4236cb7
Merge pull request #1 from usdot-jpo-ode/deduplicator-setup
SaikrishnaBairamoni Feb 3, 2025
3d8584c
Adding in Rocks DB Memory Management
John-Wiens Feb 3, 2025
7bce34e
Tuned Java Memory Allocation
John-Wiens Feb 4, 2025
e08ceb4
Removing max ram percentage
John-Wiens Feb 4, 2025
cb2e497
Removing Errors from docker-compose variables
John-Wiens Feb 4, 2025
e23aae8
Merge pull request #3 from usdot-jpo-ode/memory-update
John-Wiens Feb 4, 2025
6d99a92
Merge pull request #4 from usdot-jpo-ode/develop
SaikrishnaBairamoni Feb 5, 2025
6933756
Update submodule references to tagged versions
SaikrishnaBairamoni Feb 6, 2025
d01566f
Merge pull request #7 from usdot-jpo-ode/update_submodules_ref
SaikrishnaBairamoni Feb 6, 2025
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
69 changes: 69 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM eclipse-temurin:21-jdk

# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=vscode
ARG USER_UID=1234
ARG USER_GID=$USER_UID

# Configure apt
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get -y install --no-install-recommends apt-utils dialog 2>&1

# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd --gid $USER_GID $USERNAME
RUN useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME
# [Optional] Add sudo support for the non-root user
RUN apt-get install -y sudo
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
RUN chmod 0440 /etc/sudoers.d/$USERNAME

# Verify git, needed tools installed
RUN apt-get -y install git openssh-client less iproute2 procps curl lsb-release zip unzip sed kafkacat telnet

#-------------------Install SDKMan----------------------------------
RUN curl -s https://get.sdkman.io | bash
RUN chmod a+x "$HOME/.sdkman/bin/sdkman-init.sh"
#-------------------------------------------------------------------------------------------------------------

#-------------------Install Maven CLI Tools----------------------------------
ARG MAVEN_VERSION=3.6.3
RUN /bin/bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk install maven ${MAVEN_VERSION}"
#-------------------------------------------------------------------------------------------------------------

# Install snmp (rsu-data-controller dependency)
RUN apt-get -y install snmp

#-------------------Install Kafka----------------------------------
RUN mkdir ~/Downloads
RUN curl "https://archive.apache.org/dist/kafka/3.6.1/kafka_2.12-3.6.1.tgz" -o ~/Downloads/kafka.tgz
RUN mkdir ~/kafka \
&& cd ~/kafka \
&& tar -xvzf ~/Downloads/kafka.tgz --strip 1
RUN echo "\nadvertised.listeners=PLAINTEXT://localhost:9092" >> ~/kafka/config/server.properties
#-------------------------------------------------------------------------------------------------------------

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog

# Allow for a consistant java home location for settings - image is changing over time
RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi

COPY kafka /etc/init.d/kafka
RUN chmod 775 /etc/init.d/kafka && update-rc.d kafka defaults

COPY ./docker-entrypoint.sh ./docker-entrypoint.sh
RUN chmod +x ./docker-entrypoint.sh
ENTRYPOINT ["./docker-entrypoint.sh"]
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/java-8
{
"name": "JPO Deduplicator Java 21",
"dockerFile": "Dockerfile",
"overrideCommand": false,
"shutdownAction": "stopContainer",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"vscjava.vscode-java-pack",
"vscjava.vscode-java-debug",
"vscjava.vscode-maven",
"vscjava.vscode-java-dependency",
"vscjava.vscode-java-test",
"hbenl.vscode-test-explorer",
"ms-vscode.test-adapter-converter",
"esbenp.prettier-vscode",
"mhutchie.git-graph",
"tabnine.tabnine-vscode",
"redhat.java",
"redhat.vscode-commons"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [8080, 9090, 46753, 46800, 5555, 6666, 8090, 2181, 9092],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash .devcontainer/post-create.sh",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
"runArgs": [
"--network=host"
]
}
22 changes: 22 additions & 0 deletions .devcontainer/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

trap stop SIGTERM SIGINT SIGQUIT SIGHUP ERR

start() {
echo "Container started, starting kafka..." >>/root/startup.txt
sudo service kafka start
}

stop() {
echo "Container stopped, performing cleanup..." >>/root/shutdown.txt
sudo service kafka stop
sleep 2
exit 0
}

start

while
sleep 1 &
wait $!
do :; done
11 changes: 11 additions & 0 deletions .devcontainer/jpo-deduplicator.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "."
}
],
"settings": {
"java.configuration.updateBuildConfiguration": "automatic",
"java.server.launchMode": "Standard"
}
}
36 changes: 36 additions & 0 deletions .devcontainer/kafka
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
DAEMON_PATH=/root/kafka
PATH=$PATH:$DAEMON_PATH/bin
PATH=$PATH:/root/.sdkman/candidates/java/current/bin

export LOG_DIR=/var/log/kafka

# See how we were called.
case "$1" in
start)
# Start daemon.
echo "Starting Kafka";
$DAEMON_PATH/bin/kafka-server-start.sh -daemon $DAEMON_PATH/config/server.properties
;;
stop)
# Stop daemons.
echo "Shutting down Kafka";
$DAEMON_PATH/bin/kafka-server-stop.sh
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
pid=`ps ax | grep -i 'kafka.Kafka' | grep -v grep | awk '{print $1}'`
if [ -n "$pid" ]
then
echo "Kafka is Running as PID: $pid"
else
echo "Kafka is not Running"
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
30 changes: 30 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cd ~/kafka/
KAFKA_CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)"

bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties

# start kafka
bin/kafka-server-start.sh -daemon config/kraft/server.properties
# wait 2 seconds for the server to start and be able to add partitions
sleep 2s
# add topics

# MAP
bin/kafka-topics.sh --create --topic "topic.OdeMapJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.DeduplicatedOdeMapJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.ProcessedMap" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.DeduplicatedProcessedMap" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1

# SPaT
bin/kafka-topics.sh --create --topic "topic.OdeSpatJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.DeduplicatedOdeSpatJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.ProcessedSpat" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.DeduplicatedProcessedSpat" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1

# BSM
bin/kafka-topics.sh --create --topic "topic.OdeBsmJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.DeduplicatedOdeBsmJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1

# TIM
bin/kafka-topics.sh --create --topic "topic.OdeTimJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
bin/kafka-topics.sh --create --topic "topic.DeduplicatedOdeTimJson" --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1
48 changes: 48 additions & 0 deletions .github/workflows/artifact-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Java Package

on:
push:
branches:
- "develop"
- "master"
- "release/*"


jobs:
deduplicator-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21a
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Remove snapshot from version
run: |
cd jpo-deduplicator
mvn versions:set -DremoveSnapshot

- name: Build with Maven
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
MAVEN_GITHUB_TOKEN_NAME: ${{ vars.MAVEN_GITHUB_TOKEN_NAME }}
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG: ${{ github.repository_owner }}
run: |
cd jpo-deduplicator
mvn -s settings.xml -B package --file pom.xml -DskipTests -Ppackage-jar

- name: Publish to GitHub Packages
run: |
cd jpo-deduplicator
mvn -s settings.xml --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy -DskipTests -Ppackage-jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GITHUB_TOKEN_NAME: ${{ vars.MAVEN_GITHUB_TOKEN_NAME }}
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG: ${{ github.repository_owner }}
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
pull_request:
paths:
- 'jpo-deduplicator/**'



jobs:
deduplicator-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: 'maven'

- name: Run tests
env:
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG: ${{ github.repository_owner }}
run: |
cd $GITHUB_WORKSPACE/jpo-deduplicator
mvn verify -s ./settings.xml
26 changes: 26 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker build

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
jpo-deduplicator:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
context: .
build-args: |
MAVEN_GITHUB_TOKEN_NAME=${{ vars.MAVEN_GITHUB_TOKEN_NAME }}
MAVEN_GITHUB_TOKEN=${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG=${{ github.repository_owner }}
secrets: |
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
cache-from: type=gha
cache-to: type=gha,mode=max
41 changes: 41 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "DockerHub Build and Push"

on:
push:
branches:
- "develop"
- "master"
- "release/*"

jobs:
dockerhub-jpo-deduplicator:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Replcae Docker tag
id: set_tag
run: echo "TAG=$(echo ${GITHUB_REF##*/} | sed 's/\//-/g')" >> $GITHUB_ENV

- name: Build
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: usdotjpoode/jpo-deduplicator:${{ env.TAG }}
build-args: |
MAVEN_GITHUB_TOKEN_NAME=${{ vars.MAVEN_GITHUB_TOKEN_NAME }}
MAVEN_GITHUB_TOKEN=${{ secrets.MAVEN_GITHUB_TOKEN }}
MAVEN_GITHUB_ORG=${{ github.repository_owner }}
secrets: |
MAVEN_GITHUB_TOKEN: ${{ secrets.MAVEN_GITHUB_TOKEN }}
cache-from: type=gha
cache-to: type=gha,mode=max
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.env

**/target
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "jpo-utils"]
path = jpo-utils
url = https://github.com/usdot-jpo-ode/jpo-utils.git
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"redhat.vscode-xml",
"vscjava.vscode-java-pack",
"redhat.java",
"vmware.vscode-boot-dev-pack"
]
}
Loading
Loading