Skip to content

Commit 5ad9a04

Browse files
Onboarding new maven snapshots publishing to s3 (sql) (#4588) (#4639)
(cherry picked from commit 279eb67) Signed-off-by: Peter Zhu <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 935ab70 commit 5ad9a04

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

.github/workflows/maven-publish.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
push:
66
branches:
77
- main
8-
- 1.*
9-
- 2.*
8+
- '[0-9]+.[0-9]+'
9+
- '[0-9]+.x'
1010

1111
env:
12-
SNAPSHOT_REPO_URL: https://central.sonatype.com/repository/maven-snapshots/
12+
SNAPSHOT_REPO_URL: https://ci.opensearch.org/ci/dbc/snapshots/maven/
1313

1414
jobs:
1515
build-and-publish-snapshots:
@@ -35,9 +35,13 @@ jobs:
3535
export-env: true
3636
env:
3737
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
38-
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
39-
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
40-
38+
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
39+
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
40+
- name: Configure AWS credentials
41+
uses: aws-actions/configure-aws-credentials@v5
42+
with:
43+
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
44+
aws-region: us-east-1
4145
- name: publish snapshots to maven
4246
run: |
43-
./gradlew publishPluginZipPublicationToSnapshotsRepository
47+
./gradlew publishPluginZipPublicationToSnapshotsRepository

async-query-core/src/main/java/org/opensearch/sql/spark/data/constants/SparkConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class SparkConstants {
7272
public static final String PPL_STANDALONE_PACKAGE =
7373
"org.opensearch:opensearch-spark-ppl_2.12:0.3.0-SNAPSHOT";
7474
public static final String AWS_SNAPSHOT_REPOSITORY =
75-
"https://central.sonatype.com/repository/maven-snapshots/";
75+
"https://ci.opensearch.org/ci/dbc/snapshots/maven/";
7676
public static final String GLUE_HIVE_CATALOG_FACTORY_CLASS =
7777
"com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory";
7878
public static final String FLINT_DELEGATE_CATALOG =

async-query-core/src/test/java/org/opensearch/sql/spark/dispatcher/SparkQueryDispatcherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ private String constructExpectedSparkSubmitParameterString(
981981
"spark.hadoop.fs.s3.customAWSCredentialsProvider=com.amazonaws.emr.AssumeRoleAWSCredentialsProvider",
982982
"spark.hadoop.aws.catalog.credentials.provider.factory.class=com.amazonaws.glue.catalog.metastore.STSAssumeRoleSessionCredentialsProviderFactory",
983983
"spark.jars.packages=org.opensearch:opensearch-spark-standalone_2.12:0.3.0-SNAPSHOT,org.opensearch:opensearch-spark-sql-application_2.12:0.3.0-SNAPSHOT,org.opensearch:opensearch-spark-ppl_2.12:0.3.0-SNAPSHOT",
984-
"spark.jars.repositories=https://central.sonatype.com/repository/maven-snapshots/",
984+
"spark.jars.repositories=https://ci.opensearch.org/ci/dbc/snapshots/maven/",
985985
"spark.emr-serverless.driverEnv.JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64/",
986986
"spark.executorEnv.JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64/",
987987
"spark.emr-serverless.driverEnv.FLINT_CLUSTER_NAME=TEST_CLUSTER",

build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ buildscript {
6767
repositories {
6868
mavenLocal()
6969
mavenCentral()
70-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
71-
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/" }
70+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
7271
}
7372

7473
dependencies {
@@ -93,9 +92,8 @@ apply plugin: 'opensearch.java-agent'
9392
repositories {
9493
mavenLocal()
9594
mavenCentral() // For Elastic Libs that you can use to get started coding until open OpenSearch libs are available
96-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
95+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
9796
maven { url 'https://jitpack.io' }
98-
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/" }
9997
}
10098

10199
spotless {
@@ -158,9 +156,9 @@ subprojects {
158156
repositories {
159157
mavenLocal()
160158
mavenCentral()
161-
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
159+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
160+
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
162161
maven { url 'https://jitpack.io' }
163-
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/" }
164162
}
165163
}
166164

integ-test/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ext {
7070
noticeFile = rootProject.file('NOTICE')
7171

7272
getSecurityPluginDownloadLink = { ->
73-
var repo = "https://central.sonatype.com/repository/maven-snapshots/org/opensearch/plugin/" +
73+
var repo = "https://ci.opensearch.org/ci/dbc/snapshots/maven/org/opensearch/plugin/" +
7474
"opensearch-security/$opensearch_build_snapshot/"
7575
var metadataFile = Paths.get(projectDir.toString(), "build", "maven-metadata.xml").toAbsolutePath().toFile()
7676
download.run {

plugin/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ publishing {
8282
repositories {
8383
maven {
8484
name = "Snapshots" // optional target repository name
85-
url = "https://central.sonatype.com/repository/maven-snapshots/"
86-
credentials {
87-
username System.getenv("SONATYPE_USERNAME")
88-
password System.getenv("SONATYPE_PASSWORD")
85+
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
86+
credentials(AwsCredentials) {
87+
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
88+
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
89+
sessionToken = System.getenv("AWS_SESSION_TOKEN")
8990
}
9091
}
9192
}

0 commit comments

Comments
 (0)