diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index c7a3107..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -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/jpo-deduplicator - mvn verify -s ./settings.xml \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8853375..7660b5e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,27 +4,7 @@ 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: jpo-deduplicator - 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 - +jobs: jpo-jikkou: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 5b12f7f..a49ccba 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -7,39 +7,7 @@ on: - "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: Replace 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: jpo-deduplicator - 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 - +jobs: dockerhub-jpo-jikkou: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 53d023e..4014f8c 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,6 @@ The JPO ITS utilities repository serves as a central location for deploying open - [Configuration](#configuration) - [Configure Kafka Connector Creation](#configure-kafka-connector-creation) - [Quick Run](#quick-run-2) - - [5. jpo-deduplicator](#5-jpo-deduplicator) - - [Deduplication Config](#deduplication-config) - - [Generate a Github Token](#generate-a-github-token) - - [Quick Run](#quick-run-3) - [Security Notice](#security-notice) @@ -190,70 +186,6 @@ The following environment variables can be used to configure Kafka Connectors: 3. Click `OdeBsmJson`, and now you should see your message! 8. Feel free to test this with other topics or by producing to these topics using the [ODE](https://github.com/usdot-jpo-ode/jpo-ode) - - - -## 5. jpo-deduplicator -The JPO-Deduplicator is a Kafka Java spring-boot application designed to reduce the number of messages stored and processed in the ODE system. This is done by reading in messages from an input topic (such as topic.ProcessedMap) and outputting a subset of those messages on a related output topic (topic.DeduplicatedProcessedMap). Functionally, this is done by removing deduplicate messages from the input topic and only passing on unique messages. In addition, each topic will pass on at least 1 message per hour even if the message is a duplicate. This behavior helps ensure messages are still flowing through the system. The following topics currently support deduplication. - -- topic.ProcessedMap -> topic.DeduplicatedProcessedMap -- topic.ProcessedMapWKT -> topic.DeduplicatedProcessedMapWKT -- topic.OdeMapJson -> topic.DeduplicatedOdeMapJson -- topic.OdeTimJson -> topic.DeduplicatedOdeTimJson -- topic.OdeRawEncodedTIMJson -> topic.DeduplicatedOdeRawEncodedTIMJson -- topic.OdeBsmJson -> topic.DeduplicatedOdeBsmJson -- topic.ProcessedSpat -> topic.DeduplicatedProcessedSpat - -### Deduplication Config - -When running the jpo-deduplication as a submodule in jpo-utils, the deduplicator will automatically configure an algorithm as enabled or disabled depending on if the corresponding subcomponent is also active. For example if the KAFKA_TOPIC_CREATE_GEOJSONCONVERTER environment variable is set to true, the deduplicator will start performing deduplication for ProcessedMap, ProcessedMapWKT, and ProcessedSpat data. If the KAFKA_TOPIC_CREATE_GEOJSONCONVERTER is set to false, the deduplicator will disable deduplication for those same topics. To manually configure deduplication for a topic, the following environment variables can also be used. If no value is passed for a given environment variable, the corresponding deduplication algorithm will default to enabled. - -| Environment Variable | Description | -|---|---| -| `ENABLE_PROCESSED_MAP_DEDUPLICATION` | `true` / `false` - Enable ProcessedMap message Deduplication | -| `ENABLE_PROCESSED_MAP_WKT_DEDUPLICATION` | `true` / `false` - Enable ProcessedMap WKT message Deduplication | -| `ENABLE_ODE_MAP_DEDUPLICATION` | `true` / `false` - Enable ODE MAP message Deduplication | -| `ENABLE_ODE_TIM_DEDUPLICATION` | `true` / `false` - Enable ODE TIM message Deduplication | -| `ENABLE_ODE_RAW_ENCODED_TIM_DEDUPLICATION` | `true` / `false` - Enable ODE Raw Encoded TIM Deduplication | -| `ENABLE_PROCESSED_SPAT_DEDUPLICATION` | `true` / `false` - Enable ProcessedSpat Deduplication | -| `ENABLE_ODE_BSM_DEDUPLICATION` | `true` / `false` - Enable ODE BSM Deduplication | - -### Generate a Github Token - -A GitHub token is required to pull artifacts from GitHub repositories. This is required to obtain the jpo-deduplicator jars and must be done before attempting to build this repository. - -1. Log into GitHub. -2. Navigate to Settings -> Developer settings -> Personal access tokens. -3. Click "New personal access token (classic)". - 1. As of now, GitHub does not support `Fine-grained tokens` for obtaining packages. -4. Provide a name and expiration for the token. -5. Select the `read:packages` scope. -6. Click "Generate token" and copy the token. -7. Copy the token name and token value into your `.env` file. - -For local development the following steps are also required -8. Create a copy of [settings.xml](jpo-deduplicator/jpo-deduplicator/settings.xml) and save it to `~/.m2/settings.xml` -9. Update the variables in your `~/.m2/settings.xml` with the token value and target jpo-ode organization. - -### Quick Run -1. Create a copy of `sample.env` and rename it to `.env`. -2. Update the variable `MAVEN_GITHUB_TOKEN` to a github token used for downloading jar file dependencies. For full instructions on how to generate a token please see here: -3. Set the password for `MONGO_ADMIN_DB_PASS` and `MONGO_READ_WRITE_PASS` environmental variables to a secure password. -4. Set the `COMPOSE_PROFILES` variable to: `kafka,kafka_ui,kafka_setup, jpo-deduplicator` -5. Navigate back to the root directory and run the following command: `docker compose up -d` -6. Produce a sample message to one of the sink topics by using `kafka_ui` by: - 1. Go to `localhost:8001` - 2. Click local -> Topics - 3. Select `topic.OdeMapJson` - 4. Select `Produce Message` - 5. Copy in sample JSON for a Map Message - 6. Click `Produce Message` multiple times -7. View the synced message in `kafka_ui` by: - 1. Go to `localhost:8001` - 2. Click local -> Topics - 3. Select `topic.DeduplicatedOdeMapJson` - 4. You should now see only one copy of the map message sent. - [Back to top](#toc) ## Security Notice diff --git a/docker-compose-deduplicator.yml b/docker-compose-deduplicator.yml deleted file mode 100644 index c1e7410..0000000 --- a/docker-compose-deduplicator.yml +++ /dev/null @@ -1,41 +0,0 @@ -services: - deduplicator: - profiles: - - all - - deduplicator - build: - context: jpo-deduplicator - dockerfile: Dockerfile - args: - MAVEN_GITHUB_TOKEN: ${MAVEN_GITHUB_TOKEN} - MAVEN_GITHUB_ORG: ${MAVEN_GITHUB_ORG} - image: jpo-deduplicator:latest - restart: ${RESTART_POLICY} - environment: - DOCKER_HOST_IP: ${DOCKER_HOST_IP} - KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_BOOTSTRAP_SERVERS} - spring.kafka.bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS} - enableProcessedMapDeduplication: ${ENABLE_PROCESSED_MAP_DEDUPLICATION} - enableProcessedMapWktDeduplication: ${ENABLE_PROCESSED_MAP_WKT_DEDUPLICATION} - enableOdeMapDeduplication: ${ENABLE_ODE_MAP_DEDUPLICATION} - enableOdeTimDeduplication: ${ENABLE_ODE_TIM_DEDUPLICATION} - enableOdeRawEncodedTimDeduplication: ${ENABLE_ODE_RAW_ENCODED_TIM_DEDUPLICATION} - enableProcessedSpatDeduplication: ${ENABLE_PROCESSED_SPAT_DEDUPLICATION} - enableOdeBsmDeduplication: ${ENABLE_ODE_BSM_DEDUPLICATION} - healthcheck: - test: ["CMD", "java", "-version"] - interval: 10s - timeout: 10s - retries: 20 - logging: - options: - max-size: "10m" - max-file: "5" - deploy: - resources: - limits: - memory: 3G - depends_on: - kafka: - condition: service_healthy - required: false diff --git a/docker-compose.yml b/docker-compose.yml index c0719e5..4410b10 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,4 @@ include: - docker-compose-connect.yml - docker-compose-mongo.yml - - docker-compose-kafka.yml - - docker-compose-deduplicator.yml \ No newline at end of file + - docker-compose-kafka.yml \ No newline at end of file diff --git a/docs/Release_notes.md b/docs/Release_notes.md index 40fe69d..6c1a6eb 100644 --- a/docs/Release_notes.md +++ b/docs/Release_notes.md @@ -40,4 +40,5 @@ USDOT PR 23: Adding missing ode topics USDOT PR 24: Index updates CDOT PR 6: Adding MEC Deposit Resources USDOT PR 25: Updating version for kafka ui to latest release -CDOT PR 7: Tim compatibility and CI updates \ No newline at end of file +CDOT PR 7: Tim compatibility and CI updates +CDOT PR 8: Jpo deduplicator removal \ No newline at end of file diff --git a/jpo-deduplicator/.dockerignore b/jpo-deduplicator/.dockerignore deleted file mode 100644 index 1ace176..0000000 --- a/jpo-deduplicator/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -jpo-deduplicator/target/ \ No newline at end of file diff --git a/jpo-deduplicator/Dockerfile b/jpo-deduplicator/Dockerfile deleted file mode 100644 index 2631f79..0000000 --- a/jpo-deduplicator/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM maven:3.8-eclipse-temurin-21-alpine AS builder - -WORKDIR /home - -ARG MAVEN_GITHUB_TOKEN -ARG MAVEN_GITHUB_ORG - -ENV MAVEN_GITHUB_TOKEN=$MAVEN_GITHUB_TOKEN -ENV MAVEN_GITHUB_ORG=$MAVEN_GITHUB_ORG - -RUN test -n "$MAVEN_GITHUB_TOKEN" || (echo "Error: MAVEN_GITHUB_TOKEN cannot be empty" && exit 1) -RUN test -n "$MAVEN_GITHUB_ORG" || (echo "Error: MAVEN_GITHUB_ORG cannot be empty" && exit 1) - -# Copy and Build Deduplicator -WORKDIR /home -COPY ./jpo-deduplicator/pom.xml ./jpo-deduplicator/ -COPY ./jpo-deduplicator/settings.xml ./jpo-deduplicator/ - -WORKDIR /home/jpo-deduplicator -RUN mvn -s settings.xml dependency:resolve - -COPY ./jpo-deduplicator/src ./src -RUN mvn -s settings.xml install -DskipTests - -FROM amazoncorretto:21 - -WORKDIR /home - -COPY --from=builder /home/jpo-deduplicator/src/main/resources/application.yaml /home -COPY --from=builder /home/jpo-deduplicator/src/main/resources/logback.xml /home -COPY --from=builder /home/jpo-deduplicator/target/jpo-deduplicator.jar /home - -#COPY cert.crt /home/cert.crt -#RUN keytool -import -trustcacerts -keystore /usr/local/openjdk-11/lib/security/cacerts -storepass changeit -noprompt -alias mycert -file cert.crt - -ENTRYPOINT ["java", \ - "-Djava.rmi.server.hostname=$DOCKER_HOST_IP", \ - "-Dcom.sun.management.jmxremote.port=9090", \ - "-Dcom.sun.management.jmxremote.rmi.port=9090", \ - "-Dcom.sun.management.jmxremote", \ - "-Dcom.sun.management.jmxremote.local.only=true", \ - "-Dcom.sun.management.jmxremote.authenticate=false", \ - "-Dcom.sun.management.jmxremote.ssl=false", \ - "-Dlogback.configurationFile=/home/logback.xml", \ - "-jar", \ - "/home/jpo-deduplicator.jar"] - -# ENTRYPOINT ["tail", "-f", "/dev/null"] diff --git a/jpo-deduplicator/jpo-deduplicator/LICENSE-2.0.html b/jpo-deduplicator/jpo-deduplicator/LICENSE-2.0.html deleted file mode 100644 index d1055c8..0000000 --- a/jpo-deduplicator/jpo-deduplicator/LICENSE-2.0.html +++ /dev/null @@ -1,228 +0,0 @@ - - -
- - -Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND - DISTRIBUTION
- -"License" shall mean the terms and conditions for use, - reproduction, and distribution as defined by Sections 1 through 9 - of this document.
-"Licensor" shall mean the copyright owner or entity authorized - by the copyright owner that is granting the License.
-"Legal Entity" shall mean the union of the acting entity and - all other entities that control, are controlled by, or are under - common control with that entity. For the purposes of this - definition, "control" means (i) the power, direct or indirect, to - cause the direction or management of such entity, whether by - contract or otherwise, or (ii) ownership of fifty percent (50%) - or more of the outstanding shares, or (iii) beneficial ownership - of such entity.
-"You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License.
-"Source" form shall mean the preferred form for making - modifications, including but not limited to software source code, - documentation source, and configuration files.
-"Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but not - limited to compiled object code, generated documentation, and - conversions to other media types.
-"Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work (an - example is provided in the Appendix below).
-"Derivative Works" shall mean any work, whether in Source or - Object form, that is based on (or derived from) the Work and for - which the editorial revisions, annotations, elaborations, or - other modifications represent, as a whole, an original work of - authorship. For the purposes of this License, Derivative Works - shall not include works that remain separable from, or merely - link (or bind by name) to the interfaces of, the Work and - Derivative Works thereof.
-"Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or - additions to that Work or Derivative Works thereof, that is - intentionally submitted to Licensor for inclusion in the Work by - the copyright owner or by an individual or Legal Entity - authorized to submit on behalf of the copyright owner. For the - purposes of this definition, "submitted" means any form of - electronic, verbal, or written communication sent to the Licensor - or its representatives, including but not limited to - communication on electronic mailing lists, source code control - systems, and issue tracking systems that are managed by, or on - behalf of, the Licensor for the purpose of discussing and - improving the Work, but excluding communication that is - conspicuously marked or otherwise designated in writing by the - copyright owner as "Not a Contribution."
-"Contributor" shall mean Licensor and any individual or Legal - Entity on behalf of whom a Contribution has been received by - Licensor and subsequently incorporated within the Work.
-2. Grant of - Copyright License. Subject to the terms and - conditions of this License, each Contributor hereby grants to You - a perpetual, worldwide, non-exclusive, no-charge, royalty-free, - irrevocable copyright license to reproduce, prepare Derivative - Works of, publicly display, publicly perform, sublicense, and - distribute the Work and such Derivative Works in Source or Object - form.
-3. Grant of Patent - License. Subject to the terms and conditions of this - License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have - made, use, offer to sell, sell, import, and otherwise transfer - the Work, where such license applies only to those patent claims - licensable by such Contributor that are necessarily infringed by - their Contribution(s) alone or by combination of their - Contribution(s) with the Work to which such Contribution(s) was - submitted. If You institute patent litigation against any entity - (including a cross-claim or counterclaim in a lawsuit) alleging - that the Work or a Contribution incorporated within the Work - constitutes direct or contributory patent infringement, then any - patent licenses granted to You under this License for that Work - shall terminate as of the date such litigation is filed.
-4. - Redistribution. You may reproduce and distribute - copies of the Work or Derivative Works thereof in any medium, - with or without modifications, and in Source or Object form, - provided that You meet the following conditions:
-5. - Submission of Contributions. Unless You explicitly - state otherwise, any Contribution intentionally submitted for - inclusion in the Work by You to the Licensor shall be under the - terms and conditions of this License, without any additional - terms or conditions. Notwithstanding the above, nothing herein - shall supersede or modify the terms of any separate license - agreement you may have executed with Licensor regarding such - Contributions.
-6. - Trademarks. This License does not grant permission - to use the trade names, trademarks, service marks, or product - names of the Licensor, except as required for reasonable and - customary use in describing the origin of the Work and - reproducing the content of the NOTICE file.
-7. Disclaimer - of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or - conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or - FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for - determining the appropriateness of using or redistributing the - Work and assume any risks associated with Your exercise of - permissions under this License.
-8. Limitation - of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, - special, incidental, or consequential damages of any character - arising as a result of this License or out of the use or - inability to use the Work (including but not limited to damages - for loss of goodwill, work stoppage, computer failure or - malfunction, or any and all other commercial damages or losses), - even if such Contributor has been advised of the possibility of - such damages.
-9. Accepting - Warranty or Additional Liability. While - redistributing the Work or Derivative Works thereof, You may - choose to offer, and charge a fee for, acceptance of support, - warranty, indemnity, or other liability obligations and/or rights - consistent with this License. However, in accepting such - obligations, You may act only on Your own behalf and on Your sole - responsibility, not on behalf of any other Contributor, and only - if You agree to indemnify, defend, and hold each Contributor - harmless for any liability incurred by, or claims asserted - against, such Contributor by reason of your accepting any such - warranty or additional liability.
-END OF TERMS AND CONDITIONS
-To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a file - or class name and description of purpose be included on the same - "printed page" as the copyright notice for easier identification - within third-party archives.
-Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --