Skip to content

Commit

Permalink
Merge branch 'main' into api/timeout_4xx
Browse files Browse the repository at this point in the history
  • Loading branch information
rjernst committed Nov 21, 2024
2 parents 8e4958c + bead248 commit 5207e8e
Show file tree
Hide file tree
Showing 203 changed files with 7,241 additions and 4,792 deletions.
4 changes: 2 additions & 2 deletions .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"upstream" : "elastic/elasticsearch",
"targetBranchChoices" : [ "main", "8.x", "8.16", "8.15", "8.14", "8.13", "8.12", "8.11", "8.10", "8.9", "8.8", "8.7", "8.6", "8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.17", "6.8" ],
"targetBranchChoices" : [ "main", "8.x", "8.17", "8.16", "8.15", "8.14", "8.13", "8.12", "8.11", "8.10", "8.9", "8.8", "8.7", "8.6", "8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.17", "6.8" ],
"targetPRLabels" : [ "backport" ],
"branchLabelMapping" : {
"^v9.0.0$" : "main",
"^v8.17.0$" : "8.x",
"^v8.18.0$" : "8.x",
"^v(\\d+).(\\d+).\\d+(?:-(?:alpha|beta|rc)\\d+)?$" : "$1.$2"
}
}
2 changes: 1 addition & 1 deletion .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ steps:
timeout_in_minutes: 300
matrix:
setup:
BWC_VERSION: ["8.16.1", "8.17.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
22 changes: 19 additions & 3 deletions .buildkite/pipelines/periodic-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ steps:
env:
BWC_VERSION: 8.15.4

- label: "{{matrix.image}} / 8.16.1 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.1
- label: "{{matrix.image}} / 8.16.2 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.16.2
timeout_in_minutes: 300
matrix:
setup:
Expand All @@ -302,7 +302,7 @@ steps:
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.16.1
BWC_VERSION: 8.16.2

- label: "{{matrix.image}} / 8.17.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.17.0
Expand All @@ -320,6 +320,22 @@ steps:
env:
BWC_VERSION: 8.17.0

- label: "{{matrix.image}} / 8.18.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.18.0
timeout_in_minutes: 300
matrix:
setup:
image:
- rocky-8
- ubuntu-2004
agents:
provider: gcp
image: family/elasticsearch-{{matrix.image}}
machineType: custom-16-32768
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.18.0

- label: "{{matrix.image}} / 9.0.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.0
timeout_in_minutes: 300
Expand Down
29 changes: 24 additions & 5 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ steps:
- signal_reason: agent_stop
limit: 3

- label: 8.16.1 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.1#bwcTest
- label: 8.16.2 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.16.2#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
Expand All @@ -316,7 +316,7 @@ steps:
buildDirectory: /dev/shm/bk
preemptible: true
env:
BWC_VERSION: 8.16.1
BWC_VERSION: 8.16.2
retry:
automatic:
- exit_status: "-1"
Expand Down Expand Up @@ -344,6 +344,25 @@ steps:
- signal_reason: agent_stop
limit: 3

- label: 8.18.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.18.0#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: n1-standard-32
buildDirectory: /dev/shm/bk
preemptible: true
env:
BWC_VERSION: 8.18.0
retry:
automatic:
- exit_status: "-1"
limit: 3
signal_reason: none
- signal_reason: agent_stop
limit: 3

- label: 9.0.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v9.0.0#bwcTest
timeout_in_minutes: 300
Expand Down Expand Up @@ -429,7 +448,7 @@ steps:
setup:
ES_RUNTIME_JAVA:
- openjdk21
BWC_VERSION: ["8.16.1", "8.17.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down Expand Up @@ -471,7 +490,7 @@ steps:
ES_RUNTIME_JAVA:
- openjdk21
- openjdk23
BWC_VERSION: ["8.16.1", "8.17.0", "9.0.0"]
BWC_VERSION: ["8.16.2", "8.17.0", "8.18.0", "9.0.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
3 changes: 2 additions & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ BWC_VERSION:
- "8.13.4"
- "8.14.3"
- "8.15.4"
- "8.16.1"
- "8.16.2"
- "8.17.0"
- "8.18.0"
- "9.0.0"
3 changes: 2 additions & 1 deletion .ci/snapshotBwcVersions
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
BWC_VERSION:
- "8.16.1"
- "8.16.2"
- "8.17.0"
- "8.18.0"
- "9.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

package org.elasticsearch.gradle.internal


import spock.lang.Unroll
import com.github.tomakehurst.wiremock.WireMockServer

Expand All @@ -24,22 +23,19 @@ import java.nio.file.Paths
import java.util.regex.Matcher
import java.util.regex.Pattern

import static org.elasticsearch.gradle.internal.JdkDownloadPlugin.VENDOR_ADOPTIUM
import static org.elasticsearch.gradle.internal.JdkDownloadPlugin.VENDOR_OPENJDK
import static org.elasticsearch.gradle.internal.JdkDownloadPlugin.*

class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {

private static final String OPENJDK_VERSION_OLD = "1+99"
private static final String ADOPT_JDK_VERSION = "12.0.2+10"
private static final String ADOPT_JDK_VERSION_11 = "11.0.10+9"
private static final String ADOPT_JDK_VERSION_15 = "15.0.2+7"
private static final String AZUL_JDK_VERSION_8 = "8u302+b08"
private static final String AZUL_8_DISTRO_VERSION = "8.56.0.23"
private static final String OPEN_JDK_VERSION = "12.0.1+99@123456789123456789123456789abcde"
private static final Pattern JDK_HOME_LOGLINE = Pattern.compile("JDK HOME: (.*)")

def setup() {
configurationCacheCompatible = false
}

@Unroll
def "jdk #jdkVendor for #platform#suffix are downloaded and extracted"() {
given:
Expand All @@ -56,14 +52,16 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
version = '$jdkVersion'
platform = "$platform"
architecture = '$arch'
distributionVersion = '$distributionVersion'
}
}
def theJdks = jdks
// def theJdks = jdks
tasks.register("getJdk") {
dependsOn jdks.myJdk
def jdk = jdks.myJdk
doLast {
println "JDK HOME: " + theJdks.myJdk
println "JDK HOME: " + jdk
}
}
"""
Expand All @@ -78,22 +76,23 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
assertExtraction(result.output, expectedJavaBin);

where:
platform | arch | jdkVendor | jdkVersion | expectedJavaBin | suffix
"linux" | "x64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "bin/java" | ""
"linux" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | "bin/java" | ""
"linux" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | "bin/java" | "(old version)"
"windows" | "x64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "bin/java" | ""
"windows" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | "bin/java" | ""
"windows" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | "bin/java" | "(old version)"
"darwin" | "x64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "Contents/Home/bin/java" | ""
"darwin" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | "Contents/Home/bin/java" | ""
"darwin" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | "Contents/Home/bin/java" | "(old version)"
"mac" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | "Contents/Home/bin/java" | ""
"mac" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | "Contents/Home/bin/java" | "(old version)"
"darwin" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "Contents/Home/bin/java" | ""
"linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "bin/java" | ""
"linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION_11 | "bin/java" | "(jdk 11)"
"linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION_15 | "bin/java" | "(jdk 15)"
platform | arch | jdkVendor | jdkVersion | distributionVersion | expectedJavaBin | suffix
"linux" | "x64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | null | "bin/java" | ""
"linux" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | null | "bin/java" | ""
"linux" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | null | "bin/java" | "(old version)"
"windows" | "x64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | null | "bin/java" | ""
"windows" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | null | "bin/java" | ""
"windows" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | null | "bin/java" | "(old version)"
"darwin" | "x64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | null | "Contents/Home/bin/java" | ""
"darwin" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | null | "Contents/Home/bin/java" | ""
"darwin" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | null | "Contents/Home/bin/java" | "(old version)"
"mac" | "x64" | VENDOR_OPENJDK | OPEN_JDK_VERSION | null | "Contents/Home/bin/java" | ""
"mac" | "x64" | VENDOR_OPENJDK | OPENJDK_VERSION_OLD | null | "Contents/Home/bin/java" | "(old version)"
"darwin" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | null | "Contents/Home/bin/java" | ""
"linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | null | "bin/java" | ""
"linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION_11 | null | "bin/java" | "(jdk 11)"
"linux" | "aarch64" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION_15 | null | "bin/java" | "(jdk 15)"
"darwin" | "aarch64" | VENDOR_ZULU | AZUL_JDK_VERSION_8 | AZUL_8_DISTRO_VERSION | "Contents/Home/bin/java" | "(jdk 8)"
}

def "transforms are reused across projects"() {
Expand All @@ -118,9 +117,10 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
}
}
tasks.register("getJdk") {
dependsOn jdks.myJdk
def jdk = jdks.myJdk
dependsOn jdk
doLast {
println "JDK HOME: " + jdks.myJdk
println "JDK HOME: " + jdk
}
}
"""
Expand All @@ -137,7 +137,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
result.output.count("Unpacking linux-12.0.2-x64.tar.gz using ${SymbolicLinkPreservingUntarTransform.simpleName}") == 1

where:
platform | jdkVendor | jdkVersion | expectedJavaBin
platform | jdkVendor | jdkVersion | expectedJavaBin
"linux" | VENDOR_ADOPTIUM | ADOPT_JDK_VERSION | "bin/java"
}

Expand All @@ -159,6 +159,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
vendor = '$VENDOR_ADOPTIUM'
version = '$ADOPT_JDK_VERSION'
platform = "$platform"
distributionVersion = '$ADOPT_JDK_VERSION'
architecture = "x64"
}
}
Expand Down Expand Up @@ -204,6 +205,8 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
assert matcher.find() == true;
String jdkHome = matcher.group(1);
Path javaPath = Paths.get(jdkHome, javaBin);
println "canonical " + javaPath.toFile().getCanonicalPath()
Paths.get(jdkHome).toFile().listFiles().each { println it }
assert Files.exists(javaPath) == true;
true
}
Expand All @@ -221,15 +224,26 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
final String versionPath = isOld ? "jdk1/99" : "jdk12.0.1/123456789123456789123456789abcde/99";
final String filename = "openjdk-" + (isOld ? "1" : "12.0.1") + "_" + effectivePlatform + "-x64_bin." + extension(platform);
return "/java/GA/" + versionPath + "/GPL/" + filename;
} else if (vendor.equals(VENDOR_ZULU)) {
// we only have a single version of zulu currently in the tests
return "/zulu/bin/zulu8.56.0.23-ca-jdk8.0.302-macosx_aarch64.tar.gz"
}
}

private static byte[] filebytes(final String vendor, final String platform) throws IOException {
final String effectivePlatform = getPlatform(vendor, platform);
if (vendor.equals(VENDOR_ADOPTIUM)) {
return JdkDownloadPluginFuncTest.class.getResourceAsStream("fake_adoptium_" + effectivePlatform + "." + extension(platform)).getBytes()
return JdkDownloadPluginFuncTest.class.getResourceAsStream(
"fake_adoptium_" + effectivePlatform + "." + extension(platform)
).getBytes()
} else if (vendor.equals(VENDOR_OPENJDK)) {
JdkDownloadPluginFuncTest.class.getResourceAsStream("fake_openjdk_" + effectivePlatform + "." + extension(platform)).getBytes()
return JdkDownloadPluginFuncTest.class.getResourceAsStream(
"fake_openjdk_" + effectivePlatform + "." + extension(platform)
).getBytes()
} else {
// zulu
String resourcePath = "fake_zulu_" + effectivePlatform + "." + extension(platform)
return JdkDownloadPluginFuncTest.class.getResourceAsStream(resourcePath).getBytes()
}
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ import org.elasticsearch.gradle.internal.test.AntFixture
import org.gradle.api.file.FileSystemOperations
import org.gradle.api.file.ProjectLayout
import org.gradle.api.provider.ProviderFactory
import org.gradle.api.tasks.Internal
import org.gradle.process.ExecOperations

import javax.inject.Inject

abstract class AntFixtureStop extends LoggedExec implements FixtureStop {

@Internal
AntFixture fixture

@Inject
AntFixtureStop(ProjectLayout projectLayout,
ExecOperations execOperations,
Expand All @@ -34,12 +30,12 @@ abstract class AntFixtureStop extends LoggedExec implements FixtureStop {
}

void setFixture(AntFixture fixture) {
assert this.fixture == null
this.fixture = fixture;
final Object pid = "${-> this.fixture.pid}"
onlyIf("pidFile exists") { fixture.pidFile.exists() }
def pidFile = fixture.pidFile
def fixtureName = fixture.name
final Object pid = "${-> Integer.parseInt(pidFile.getText('UTF-8').trim())}"
onlyIf("pidFile exists") { pidFile.exists() }
doFirst {
logger.info("Shutting down ${fixture.name} with pid ${pid}")
logger.info("Shutting down ${fixtureName} with pid ${pid}")
}

if (OS.current() == OS.WINDOWS) {
Expand All @@ -51,9 +47,8 @@ abstract class AntFixtureStop extends LoggedExec implements FixtureStop {
}
doLast {
fileSystemOperations.delete {
it.delete(fixture.pidFile)
it.delete(pidFile)
}
}
this.fixture = fixture
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ import java.nio.charset.Charset
*/
public abstract class AntTask extends DefaultTask {

/**
* A buffer that will contain the output of the ant code run,
* if the output was not already written directly to stdout.
*/
public final ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream()

@Inject
protected FileSystemOperations getFileSystemOperations() {
Expand All @@ -57,6 +52,11 @@ public abstract class AntTask extends DefaultTask {

// otherwise groovy replaces System.out, and you have no chance to debug
// ant.saveStreams = false
/**
* A buffer that will contain the output of the ant code run,
* if the output was not already written directly to stdout.
*/
ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream()

final int outputLevel = logger.isDebugEnabled() ? Project.MSG_DEBUG : Project.MSG_INFO
final PrintStream stream = useStdout() ? System.out : new PrintStream(outputBuffer, true, Charset.defaultCharset().name())
Expand Down
Loading

0 comments on commit 5207e8e

Please sign in to comment.