Skip to content

Commit ea91d8b

Browse files
committed
Merge branch 'main' into ppl-projection-command
2 parents 85ed116 + 98579e1 commit ea91d8b

File tree

87 files changed

+3820
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3820
-119
lines changed

.github/workflows/stalled.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Label Stalled PRs
2+
on:
3+
schedule:
4+
- cron: '15 15 * * *' # Run every day at 15:15 UTC / 7:15 PST / 8:15 PDT
5+
permissions:
6+
pull-requests: write
7+
jobs:
8+
stale:
9+
if: github.repository == 'opensearch-project/opensearch-spark'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: GitHub App token
13+
id: github_app_token
14+
uses: tibdex/[email protected]
15+
with:
16+
app_id: ${{ secrets.APP_ID }}
17+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
18+
installation_id: 22958780
19+
- name: Stale PRs
20+
uses: actions/stale@v9
21+
with:
22+
repo-token: ${{ steps.github_app_token.outputs.token }}
23+
stale-pr-label: 'stalled'
24+
stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity.'
25+
days-before-pr-stale: 30
26+
days-before-issue-stale: -1
27+
days-before-pr-close: -1
28+
days-before-issue-close: -1

build.sbt

+22-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ lazy val testScalastyle = taskKey[Unit]("testScalastyle")
5555
// - .inAll applies the rule to all dependencies, not just direct dependencies
5656
val packagesToShade = Seq(
5757
"com.amazonaws.cloudwatch.**",
58-
"com.fasterxml.jackson.core.**",
59-
"com.fasterxml.jackson.dataformat.**",
60-
"com.fasterxml.jackson.databind.**",
6158
"com.google.**",
6259
"com.sun.jna.**",
6360
"com.thoughtworks.paranamer.**",
@@ -325,6 +322,28 @@ lazy val integtest = (project in file("integ-test"))
325322
lazy val integration = taskKey[Unit]("Run integration tests")
326323
lazy val awsIntegration = taskKey[Unit]("Run AWS integration tests")
327324

325+
lazy val e2etest = (project in file("e2e-test"))
326+
.dependsOn(flintCommons % "test->package", flintSparkIntegration % "test->package", pplSparkIntegration % "test->package", sparkSqlApplication % "test->package")
327+
.settings(
328+
commonSettings,
329+
name := "e2e-test",
330+
scalaVersion := scala212,
331+
libraryDependencies ++= Seq(
332+
"org.scalatest" %% "scalatest" % "3.2.15" % "test",
333+
"org.apache.spark" %% "spark-connect-client-jvm" % "3.5.3" % "test",
334+
"com.amazonaws" % "aws-java-sdk-s3" % "1.12.568" % "test",
335+
"com.softwaremill.sttp.client3" %% "core" % "3.10.2" % "test",
336+
"com.softwaremill.sttp.client3" %% "play2-json" % "3.10.2",
337+
"com.typesafe.play" %% "play-json" % "2.9.2" % "test",
338+
),
339+
libraryDependencies ++= deps(sparkVersion),
340+
javaOptions ++= Seq(
341+
s"-DappJar=${(sparkSqlApplication / assembly).value.getAbsolutePath}",
342+
s"-DextensionJar=${(flintSparkIntegration / assembly).value.getAbsolutePath}",
343+
s"-DpplJar=${(pplSparkIntegration / assembly).value.getAbsolutePath}",
344+
)
345+
)
346+
328347
lazy val standaloneCosmetic = project
329348
.settings(
330349
name := "opensearch-spark-standalone",

docker/integ-test/.env

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ MASTER_UI_PORT=8080
55
MASTER_PORT=7077
66
UI_PORT=4040
77
SPARK_CONNECT_PORT=15002
8-
PPL_JAR=../../ppl-spark-integration/target/scala-2.12/ppl-spark-integration-assembly-0.7.0-SNAPSHOT.jar
9-
FLINT_JAR=../../flint-spark-integration/target/scala-2.12/flint-spark-integration-assembly-0.7.0-SNAPSHOT.jar
8+
PPL_JAR=./ppl-spark-integration/target/scala-2.12/ppl-spark-integration-assembly-0.7.0-SNAPSHOT.jar
9+
FLINT_JAR=./flint-spark-integration/target/scala-2.12/flint-spark-integration-assembly-0.7.0-SNAPSHOT.jar
10+
SQL_APP_JAR=./spark-sql-application/target/scala-2.12/sql-job-assembly-0.7.0-SNAPSHOT.jar
1011
OPENSEARCH_NODE_MEMORY=512m
1112
OPENSEARCH_ADMIN_PASSWORD=C0rrecthorsebatterystaple.
1213
OPENSEARCH_PORT=9200
14+
OPENSEARCH_PA_PORT=9600
1315
OPENSEARCH_DASHBOARDS_PORT=5601
16+
S3_ACCESS_KEY=Vt7jnvi5BICr1rkfsheT
17+
S3_SECRET_KEY=5NK3StGvoGCLUWvbaGN0LBUf9N6sjE94PEzLdqwO
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/bin/sh
2+
3+
# Copyright OpenSearch Contributors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
# Login to Minio
7+
curl -q \
8+
-c /tmp/minio-cookies.txt \
9+
-H 'Content-Type: application/json' \
10+
-d '{"accessKey": "minioadmin", "secretKey": "minioadmin"}' \
11+
http://minio-S3:9001/api/v1/login
12+
# Delete the test bucket
13+
curl -b /tmp/minio-cookies.txt \
14+
-X DELETE \
15+
http://minio-S3:9001/api/v1/buckets/test
16+
# Create the integ-test bucket
17+
curl -q \
18+
-b /tmp/minio-cookies.txt \
19+
-X POST \
20+
-H 'Content-Type: application/json' \
21+
-d '{"name": "integ-test", "versioning": {"enabled": true, "excludePrefixes": [], "excludeFolders": false}, "locking": true}' \
22+
http://minio-S3:9001/api/v1/buckets
23+
# Create the test-resources bucket
24+
curl -q \
25+
-b /tmp/minio-cookies.txt \
26+
-X POST \
27+
-H 'Content-Type: application/json' \
28+
-d '{"name": "test-resources", "versioning": {"enabled": false, "excludePrefixes": [], "excludeFolders": false}, "locking": true}' \
29+
http://minio-S3:9001/api/v1/buckets
30+
# Create the access key
31+
curl -q \
32+
-b /tmp/minio-cookies.txt \
33+
-X GET
34+
"http://minio-S3:9001/api/v1/service-accounts/${S3_ACCESS_KEY}"
35+
if [ "$?" -ne "0" ]; then
36+
curl -q \
37+
-b /tmp/minio-cookies.txt \
38+
-X POST \
39+
-H 'Content-Type: application/json' \
40+
-d "{\"policy\": \"\", \"accessKey\": \"${S3_ACCESS_KEY}\", \"secretKey\": \"${S3_SECRET_KEY}\", \"description\": \"\", \"comment\": \"\", \"name\": \"\", \"expiry\": null}" \
41+
http://minio-S3:9001/api/v1/service-account-credentials
42+
fi
43+
44+
# Login to OpenSearch Dashboards
45+
echo ">>> Login to OpenSearch dashboards"
46+
curl -q \
47+
-c /tmp/opensearch-cookies.txt \
48+
-X POST \
49+
-H 'Content-Type: application/json' \
50+
-H 'Osd-Version: 2.18.0' \
51+
-H 'Osd-Xsrf: fetch' \
52+
-d "{\"username\": \"admin\", \"password\": \"${OPENSEARCH_ADMIN_PASSWORD}\"}" \
53+
'http://opensearch-dashboards:5601/auth/login?dataSourceId='
54+
if [ "$?" -eq "0" ]; then
55+
echo " >>> Login successful"
56+
else
57+
echo " >>> Login failed"
58+
fi
59+
60+
# Create the S3/Glue datasource
61+
curl -q \
62+
-b /tmp/opensearch-cookies.txt \
63+
-X GET \
64+
http://localhost:5601/api/directquery/dataconnections/mys3
65+
if [ "$?" -ne "0" ]; then
66+
echo ">>> Creating datasource"
67+
curl -q \
68+
-b /tmp/opensearch-cookies.txt \
69+
-X POST \
70+
-H 'Content-Type: application/json' \
71+
-H 'Osd-Version: 2.18.0' \
72+
-H 'Osd-Xsrf: fetch' \
73+
-d "{\"name\": \"mys3\", \"allowedRoles\": [], \"connector\": \"s3glue\", \"properties\": {\"glue.auth.type\": \"iam_role\", \"glue.auth.role_arn\": \"arn:aws:iam::123456789012:role/S3Access\", \"glue.indexstore.opensearch.uri\": \"http://opensearch:9200\", \"glue.indexstore.opensearch.auth\": \"basicauth\", \"glue.indexstore.opensearch.auth.username\": \"admin\", \"glue.indexstore.opensearch.auth.password\": \"${OPENSEARCH_ADMIN_PASSWORD}\"}}" \
74+
http://opensearch-dashboards:5601/api/directquery/dataconnections
75+
if [ "$?" -eq "0" ]; then
76+
echo " >>> S3 datasource created"
77+
else
78+
echo " >>> Failed to create S3 datasource"
79+
fi
80+
81+
echo ">>> Setting cluster settings"
82+
curl -v \
83+
-u "admin:${OPENSEARCH_ADMIN_PASSWORD}" \
84+
-X PUT \
85+
-H 'Content-Type: application/json' \
86+
-d '{"persistent": {"plugins.query.executionengine.spark.config": "{\"applicationId\":\"integ-test\",\"executionRoleARN\":\"arn:aws:iam::xxxxx:role/emr-job-execution-role\",\"region\":\"us-west-2\", \"sparkSubmitParameters\": \"--conf spark.dynamicAllocation.enabled=false\"}"}}' \
87+
http://opensearch:9200/_cluster/settings
88+
if [ "$?" -eq "0" ]; then
89+
echo " >>> Successfully set cluster settings"
90+
else
91+
echo " >>> Failed to set cluster settings"
92+
fi
93+
fi

0 commit comments

Comments
 (0)