opensearch-project / data-prepper

Data Prepper is a component of the OpenSearch project that accepts, filters, transforms, enriches, and routes data at scale.
https://opensearch.org/docs/latest/clients/data-prepper/index/
Apache License 2.0
259 stars 190 forks source link

[RFC] New Gradle project directory structure #1503

Open dlvenable opened 2 years ago

dlvenable commented 2 years ago

Motivation

Data Prepper has an upcoming directory structure change (#305) which is conducive to having multiple jar files. Along with this, the data-prepper-core project can be split into multiple Jar files. These jar files can even be deployed to Maven Central.

Also, many of the projects, have the data-prepper- prefix. We may want to consider renaming the artifact and project names.

Current Structure

data-prepper-api/
data-prepper-benchmarks/
data-prepper-core/
data-prepper-expression/
data-prepper-logstash-configuration/
data-prepper-plugins/
    aggregate-processor/
    common/
    grok-processor/
    ...
data-prepper-test-common/
release/
e2e-test/
performance-test/

Proposed Solution

Re-organize the project structure along the lines of the following:

common/
  data-prepper-api/
  data-prepper-configuration-converter-api/
core/
  data-prepper-core/
  data-prepper-main/
  data-prepper-expression/
  data-prepper-configuration-converter/
  data-prepper-pipeline/
  ...
plugins/
  (existing plugins)
test/
  data-prepper-test-common/
release/
e2e-test/
performance-test/

Common Components

These are components which are used by both Data Prepper Core Components and Plugins. These projects are located in the common/ directory.

Core Components

Most components here have the Maven groupId: org.opensearch.dataprepper.core. The are located in the core/ directory in the project structure.

There may be more ways to break down the core project. This can happen iteratively as well. But, by having this structure, the project will be in a better position to split them.

Plugins

This will be the same directory currently named data-prepper-plugins, but renamed to just plugins. The projects will not deploy to Maven Central.

Test

Any projects related to common testing libraries. There is only one library now, but we may find value in adding more to make integration testing easier. The Maven groupId is org.opensearch.dataprepper.test.

Other Projects

This proposal currently does not modify: release, e2e-test, performance-test.

Out of Scope

This restructure does not include any work toward having bundled/core plugins versus optional plugins. Thus, the plugins project is mostly left as-is.

This does not include the location of the scripts to start Data Prepper in the new directory structure. This issue is focused mainly on the Gradle project structure.

Questions

Tasks

dlvenable commented 2 years ago

This change is not a breaking change for users downloading Data Prepper, so it doesn't have to come in 2.0. I'm pushing this out to after our 2.0 release.