Skip to content

Commit

Permalink
Updated the build to use OpenSearch 1.0.0. Made a change to an integr…
Browse files Browse the repository at this point in the history
…ation test to support OpenSearch. The build is currently using a Sonatype release Maven repository for AWS for the OpenSearch artifacts.

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable committed Sep 1, 2021
1 parent 5deaa48 commit 17a104c
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/opensearch-sink-os-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,15 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# TODO: replace local built OpenSearch artifact with the public artifact
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha2'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha2 -Dbuild.snapshot=false
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run OpenSearch docker
run: |
export version=1.0.0-beta1
docker pull opensearchstaging/opensearch:$version
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -d opensearchstaging/opensearch:$version
export version=1.0.0
docker pull opensearchproject/opensearch:$version
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -d opensearchproject/opensearch:$version
sleep 90
- name: Run OpenSearch tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion build-resources.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ext.versionMap = [
junitJupiter : '5.7.2',
mockito : '3.11.2',
opentelemetryProto : '1.0.1-alpha',
opensearchVersion : '1.0.0-alpha2'
opensearchVersion : '1.0.0'
]

ext.coreProjects = [project(':data-prepper-api'), project(':data-prepper-core'), project('data-prepper-plugins:common')]
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ allprojects {

repositories {
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://jitpack.io' }
}

spotless {
Expand Down
9 changes: 7 additions & 2 deletions data-prepper-core/integrationTest.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ configurations {
}

repositories {
// TODO: replace local built OpenSearch artifact with the public artifact
mavenLocal()
// TODO: Replace with Maven Central once it has synced
maven {
url 'https://aws.oss.sonatype.org/content/repositories/releases/'
content {
includeGroupByRegex 'org\\.opensearch.*'
}
}
}

dependencies {
Expand Down
20 changes: 15 additions & 5 deletions data-prepper-plugins/opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ buildscript {
}

repositories {
maven { url "https://plugins.gradle.org/m2/" }
// TODO: replace local built OpenSearch artifact with the public artifact
mavenLocal()
maven { url 'https://plugins.gradle.org/m2/' }
// TODO: Replace with Maven Central once it has synced
maven {
url 'https://aws.oss.sonatype.org/content/repositories/releases/'
content {
includeGroupByRegex 'org\\.opensearch.*'
}
}
}

dependencies {
Expand Down Expand Up @@ -41,8 +46,13 @@ ext {
}

repositories {
// TODO: replace local built OpenSearch artifact with the public artifact
mavenLocal()
// TODO: Replace with Maven Central once it has synced
maven {
url 'https://aws.oss.sonatype.org/content/repositories/releases/'
content {
includeGroupByRegex 'org\\.opensearch.*'
}
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,9 @@ private String getIndexPolicyId(final String index) throws IOException {
final Response response = client().performRequest(request);
final String responseBody = EntityUtils.toString(response.getEntity());

// TODO: This is a difference between OpenSearch and ODFE
@SuppressWarnings("unchecked") final String policyId = (String) ((Map<String, Object>) createParser(XContentType.JSON.xContent(),
responseBody).map().get(index)).get("index.opendistro.index_state_management.policy_id");
responseBody).map().get(index)).get("index.plugins.index_state_management.policy_id");
return policyId;
}

Expand Down
9 changes: 7 additions & 2 deletions data-prepper-plugins/otel-trace-group-prepper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ ext {
}

repositories {
// TODO: replace local built OpenSearch artifact with the public artifact
mavenLocal()
// TODO: Replace with Maven Central once it has synced
maven {
url 'https://aws.oss.sonatype.org/content/repositories/releases/'
content {
includeGroupByRegex 'org\\.opensearch.*'
}
}
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions examples/dev/k8s/sample-project-applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
value: https://odfe:9200
- name: OPENSEARCH_URL
value: https://odfe:9200
image: opensearchstaging/opensearch-dashboards:1.0.0
image: opensearchproject/opensearch-dashboards:1.0.0
imagePullPolicy: ""
name: opensearch-dashboard
ports:
Expand Down Expand Up @@ -135,7 +135,7 @@ spec:
- env:
- name: discovery.type
value: single-node
image: opensearchstaging/opensearch:1.0.0
image: opensearchproject/opensearch:1.0.0
imagePullPolicy: ""
name: odfe
ports:
Expand Down
7 changes: 1 addition & 6 deletions examples/dev/trace-analytics-sample-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
FROM gradle:jdk14 AS builder
COPY . /home/gradle/src
WORKDIR /home/gradle/src
# TODO: replace local built OpenSearch artifact with the public artifact
RUN tar -xzf opensearch-build-1_0_0-alpha2.tar.gz
RUN mkdir -p ~/.m2/repository/org
RUN mv opensearch-build-1_0_0-alpha2 ~/.m2/repository/org/opensearch
WORKDIR /home/gradle/src/data-prepper-core
RUN gradle clean jar --daemon
RUN gradle -p data-prepper-core clean jar --no-daemon

FROM amazoncorretto:15-al2-full
EXPOSE 21890
Expand Down
4 changes: 2 additions & 2 deletions examples/dev/trace-analytics-sample-app/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ services:

opensearch:
container_name: node-0.example.com
image: opensearchstaging/opensearch:1.0.0
image: opensearchproject/opensearch:1.0.0
ports:
- "9200:9200"
- "9600:9600"
Expand All @@ -87,7 +87,7 @@ services:

opensearch-dashboard:
container_name: opensearch-dashboard
image: opensearchstaging/opensearch-dashboards:1.0.0
image: opensearchproject/opensearch-dashboards:1.0.0
ports:
- 5601:5601
expose:
Expand Down
Binary file removed opensearch-build-1_0_0-alpha2.tar.gz
Binary file not shown.
9 changes: 7 additions & 2 deletions research/zipkin-elastic-to-otel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ sourceCompatibility = 1.8

repositories {
mavenCentral()
// TODO: replace local built OpenSearch artifact with the public artifact
mavenLocal()
// TODO: Replace with Maven Central once it has synced
maven {
url 'https://aws.oss.sonatype.org/content/repositories/releases/'
content {
includeGroupByRegex 'org\\.opensearch.*'
}
}
}

application {
Expand Down

0 comments on commit 17a104c

Please sign in to comment.