Skip to content

Update the maven snapshot publish endpoint and credential #3806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id: lychee
uses: lycheeverse/lychee-action@master
with:
args: --accept=200,403,429,999 "./**/*.html" "./**/*.md" "./**/*.txt" --exclude "https://aws.oss.sonatype.*|http://localhost.*|https://localhost|https://odfe-node1:9200/|https://community.tableau.com/docs/DOC-17978|.*family.zzz|opensearch*|.*@amazon.com|.*email.com|.*@github.com|http://timestamp.verisign.com/scripts/timstamp.dll"
args: --accept=200,403,429,999 "./**/*.html" "./**/*.md" "./**/*.txt" --exclude "https://aws.oss.sonatype.*|https://central.sonatype.*|http://localhost.*|https://localhost|https://odfe-node1:9200/|https://community.tableau.com/docs/DOC-17978|.*family.zzz|opensearch*|.*@amazon.com|.*email.com|.*@github.com|http://timestamp.verisign.com/scripts/timstamp.dll"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Fail if there were link errors
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 2.*

env:
SNAPSHOT_REPO_URL: https://aws.oss.sonatype.org/content/repositories/snapshots/
SNAPSHOT_REPO_URL: https://central.sonatype.com/repository/maven-snapshots/

jobs:
build-and-publish-snapshots:
Expand All @@ -28,15 +28,16 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1.7.0
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1

- name: get credentials
run: |
# Get credentials for publishing
.github/get-sonatype-credentials.sh
- name: Load secret
uses: 1password/load-secrets-action@v2
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password

- name: publish snapshots to maven
run: |
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/publish-snapshots-and-grammar-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 2.*

env:
SNAPSHOT_REPO_URL: https://aws.oss.sonatype.org/content/repositories/snapshots/
SNAPSHOT_REPO_URL: https://central.sonatype.com/repository/maven-snapshots/

jobs:
publish-grammar-files:
Expand All @@ -31,16 +31,16 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1.7.0
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1

# Get Maven credentials
- name: Setup publishing credentials
id: creds
run: |
.github/get-sonatype-credentials.sh
- name: Load secret
uses: 1password/load-secrets-action@v2
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password

# Extract version information directly from build.gradle
- name: Set version
Expand Down Expand Up @@ -196,16 +196,16 @@ jobs:
distribution: temurin
java-version: 21
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1.7.0
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1

# Get and mask credentials once in a dedicated step
- name: Setup publishing credentials
id: creds
run: |
.github/get-sonatype-credentials.sh
- name: Load secret
uses: 1password/load-secrets-action@v2
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password

# Capture the commit ID for metadata purposes
- name: Set commit ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class SparkConstants {
public static final String PPL_STANDALONE_PACKAGE =
"org.opensearch:opensearch-spark-ppl_2.12:0.3.0-SNAPSHOT";
public static final String AWS_SNAPSHOT_REPOSITORY =
"https://aws.oss.sonatype.org/content/repositories/snapshots";
"https://central.sonatype.com/repository/maven-snapshots/";
public static final String GLUE_HIVE_CATALOG_FACTORY_CLASS =
"com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory";
public static final String FLINT_DELEGATE_CATALOG =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ private String constructExpectedSparkSubmitParameterString(
"spark.hadoop.fs.s3.customAWSCredentialsProvider=com.amazonaws.emr.AssumeRoleAWSCredentialsProvider",
"spark.hadoop.aws.catalog.credentials.provider.factory.class=com.amazonaws.glue.catalog.metastore.STSAssumeRoleSessionCredentialsProviderFactory",
"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",
"spark.jars.repositories=https://aws.oss.sonatype.org/content/repositories/snapshots",
"spark.jars.repositories=https://central.sonatype.com/repository/maven-snapshots/",
"spark.emr-serverless.driverEnv.JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64/",
"spark.executorEnv.JAVA_HOME=/usr/lib/jvm/java-17-amazon-corretto.x86_64/",
"spark.emr-serverless.driverEnv.FLINT_CLUSTER_NAME=TEST_CLUSTER",
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ buildscript {

repositories {
mavenLocal()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
}
Expand All @@ -91,6 +92,7 @@ apply plugin: 'opensearch.java-agent'
// Repository on root level is for dependencies that project code depends on. And this block must be placed after plugins{}
repositories {
mavenLocal()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral() // For Elastic Libs that you can use to get started coding until open OpenSearch libs are available
maven { url 'https://jitpack.io' }
Expand Down Expand Up @@ -155,6 +157,7 @@ allprojects {
subprojects {
repositories {
mavenLocal()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/lucene/" }
Expand Down
2 changes: 1 addition & 1 deletion integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ ext {
noticeFile = rootProject.file('NOTICE')

getSecurityPluginDownloadLink = { ->
var repo = "https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/" +
var repo = "https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/opensearch/plugin/" +
"opensearch-security/$opensearch_build_snapshot/"
var metadataFile = Paths.get(projectDir.toString(), "build", "maven-metadata.xml").toAbsolutePath().toFile()
download.run {
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ publishing {
repositories {
maven {
name = "Snapshots" // optional target repository name
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
url = "https://central.sonatype.com/repository/maven-snapshots/"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
Expand Down
Loading