Skip to content

Commit

Permalink
Update CI to use jdk-21 (#1288)
Browse files Browse the repository at this point in the history
This updates the CI system to use jdk-21, which is latest LTS supported version.
Coming from opensearch-project/OpenSearch#10334

Signed-off-by: John Mazanec <jmazane@amazon.com>
(cherry picked from commit c72f096)
  • Loading branch information
jmazanec15 authored and github-actions[bot] committed Nov 7, 2023
1 parent 8aad0d2 commit b63ec61
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
Build-k-NN-Linux:
strategy:
matrix:
java: [11, 17]
java: [11, 17, 21]

name: Build and Test k-NN Plugin on Linux
runs-on: ubuntu-latest
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
Build-k-NN-MacOS:
strategy:
matrix:
java: [ 11, 17 ]
java: [ 11, 17, 21 ]

name: Build and Test k-NN Plugin on MacOS
needs: Get-CI-Image-Tag
Expand All @@ -84,7 +84,7 @@ jobs:
Build-k-NN-Windows:
strategy:
matrix:
java: [ 11, 17 ]
java: [ 11, 17, 21 ]

name: Build and Test k-NN Plugin on Windows
needs: Get-CI-Image-Tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
Build-ad:
strategy:
matrix:
java: [ 11,17 ]
java: [ 11,17,21 ]
os: [ubuntu-latest]
fail-fast: true

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ plugins {
id 'java-library'
id 'java-test-fixtures'
id 'idea'
id "com.diffplug.spotless" version "6.3.0" apply false
id "com.diffplug.spotless" version "6.20.0" apply false
id 'io.freefair.lombok' version '8.4'
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/opensearch/knn/indices/ModelDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,9 @@ private void removeModelIdFromGraveyardOnFailure(String modelId, Exception excep
client.execute(
UpdateModelGraveyardAction.INSTANCE,
new UpdateModelGraveyardRequest(modelId, true),
ActionListener.wrap(acknowledgedResponse -> { throw exceptionFromPreviousStep; }, unblockingFailedException -> {
ActionListener.wrap(acknowledgedResponse -> {
throw exceptionFromPreviousStep;
}, unblockingFailedException -> {
// If it fails to remove the modelId from Model Graveyard, then log the error message and
// throw the exception that was passed as a parameter from previous step
String errorMessage = String.format("Failed to remove \" %s \" from Model Graveyard", modelId);
Expand Down
9 changes: 3 additions & 6 deletions src/testFixtures/java/org/opensearch/knn/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,9 @@ public static PriorityQueue<DistVector> computeGroundTruthValues(int k, SpaceTyp
public static float computeDistFromSpaceType(SpaceType spaceType, float[] indexVector, float[] queryVector) {
float dist;
if (spaceType != null) {
dist = KNN_SCORING_SPACE_TYPE.getOrDefault(
spaceType,
(defaultQueryVector, defaultIndexVector) -> {
throw new IllegalArgumentException(String.format("Invalid SpaceType function: \"%s\"", spaceType));
}
).apply(queryVector, indexVector);
dist = KNN_SCORING_SPACE_TYPE.getOrDefault(spaceType, (defaultQueryVector, defaultIndexVector) -> {
throw new IllegalArgumentException(String.format("Invalid SpaceType function: \"%s\"", spaceType));
}).apply(queryVector, indexVector);
} else {
throw new NullPointerException("SpaceType is null. Provide a valid SpaceType.");
}
Expand Down

0 comments on commit b63ec61

Please sign in to comment.