Skip to content

Commit

Permalink
Merge branch 'main' into do-not-delete-slm-history-indices-in-rest-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 11, 2023
2 parents 2fd0fa6 + 8a6df32 commit cd0b34c
Show file tree
Hide file tree
Showing 157 changed files with 4,336 additions and 2,118 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/intake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ steps:
timeout_in_minutes: 300
matrix:
setup:
BWC_VERSION: ["7.17.14", "8.10.3", "8.11.0", "8.12.0"]
BWC_VERSION: ["7.17.15", "8.10.4", "8.11.0", "8.12.0"]
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
Expand Down
32 changes: 32 additions & 0 deletions .buildkite/pipelines/periodic-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,22 @@ steps:
env:
BWC_VERSION: 7.17.14

- label: "{{matrix.image}} / 7.17.15 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v7.17.15
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: 7.17.15

- label: "{{matrix.image}} / 8.0.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.0.0
timeout_in_minutes: 300
Expand Down Expand Up @@ -1648,6 +1664,22 @@ steps:
env:
BWC_VERSION: 8.10.3

- label: "{{matrix.image}} / 8.10.4 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.10.4
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.10.4

- label: "{{matrix.image}} / 8.11.0 / packaging-tests-upgrade"
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v8.11.0
timeout_in_minutes: 300
Expand Down
20 changes: 20 additions & 0 deletions .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,16 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.14
- label: 7.17.15 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v7.17.15#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: custom-32-98304
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 7.17.15
- label: 8.0.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.0.0#bwcTest
timeout_in_minutes: 300
Expand Down Expand Up @@ -1012,6 +1022,16 @@ steps:
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.10.3
- label: 8.10.4 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.10.4#bwcTest
timeout_in_minutes: 300
agents:
provider: gcp
image: family/elasticsearch-ubuntu-2004
machineType: custom-32-98304
buildDirectory: /dev/shm/bk
env:
BWC_VERSION: 8.10.4
- label: 8.11.0 / bwc
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true v8.11.0#bwcTest
timeout_in_minutes: 300
Expand Down
34 changes: 12 additions & 22 deletions .buildkite/scripts/periodic.trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,23 @@ for BRANCH in "${BRANCHES[@]}"; do
LAST_GOOD_COMMIT=$(echo "${BUILD_JSON}" | jq -r '.commit')

cat <<EOF
- trigger: elasticsearch-periodic
label: Trigger periodic pipeline for $BRANCH
async: true
build:
branch: "$BRANCH"
commit: "$LAST_GOOD_COMMIT"
- trigger: elasticsearch-periodic-packaging
label: Trigger periodic-packaging pipeline for $BRANCH
async: true
build:
branch: "$BRANCH"
commit: "$LAST_GOOD_COMMIT"
- trigger: elasticsearch-periodic-platform-support
label: Trigger periodic-platform-support pipeline for $BRANCH
async: true
build:
branch: "$BRANCH"
commit: "$LAST_GOOD_COMMIT"
EOF

### Only platform-support enabled for right now
# cat <<EOF
# - trigger: elasticsearch-periodic
# label: Trigger periodic pipeline for $BRANCH
# async: true
# build:
# branch: "$BRANCH"
# commit: "$LAST_GOOD_COMMIT"
# - trigger: elasticsearch-periodic-packaging
# label: Trigger periodic-packaging pipeline for $BRANCH
# async: true
# build:
# branch: "$BRANCH"
# commit: "$LAST_GOOD_COMMIT"
# - trigger: elasticsearch-periodic-platform-support
# label: Trigger periodic-platform-support pipeline for $BRANCH
# async: true
# build:
# branch: "$BRANCH"
# commit: "$LAST_GOOD_COMMIT"
# EOF
done
2 changes: 2 additions & 0 deletions .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ BWC_VERSION:
- "7.17.12"
- "7.17.13"
- "7.17.14"
- "7.17.15"
- "8.0.0"
- "8.0.1"
- "8.1.0"
Expand Down Expand Up @@ -100,5 +101,6 @@ BWC_VERSION:
- "8.10.1"
- "8.10.2"
- "8.10.3"
- "8.10.4"
- "8.11.0"
- "8.12.0"
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- job:
name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-arm
display-name: "elastic / elasticsearch # %BRANCH% - arm compatibility"
description: "Elasticsearch %BRANCH% ARM (aarch64) compatibility testing.\n"
description: "This job has been migrated to Buildkite.\n"
disabled: true
child-workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+multijob+platform-support-arm"
project-type: matrix
node: master
Expand All @@ -20,14 +21,14 @@
type: user-defined
name: GRADLE_TASK
values:
- 'checkPart1'
- 'checkPart2'
- 'checkPart3'
- 'bwcTestSnapshots'
- 'checkRestCompat'
- "checkPart1"
- "checkPart2"
- "checkPart3"
- "bwcTestSnapshots"
- "checkRestCompat"
builders:
- inject:
properties-file: '.ci/java-versions-aarch64.properties'
properties-file: ".ci/java-versions-aarch64.properties"
properties-content: |
COMPOSE_HTTP_TIMEOUT=120
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- job:
name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-unix
display-name: "elastic / elasticsearch # %BRANCH% - unix compatibility"
description: "Elasticsearch %BRANCH% unix compatibility testing.\n"
description: "This job has been migrated to Buildkite.\n"
disabled: true
project-type: matrix
node: master
child-workspace: "/var/lib/jenkins/workspace/elastic+elasticsearch+%BRANCH%+multijob+platform-support-unix"
Expand Down Expand Up @@ -34,7 +35,7 @@
- "almalinux-8&&immutable"
builders:
- inject:
properties-file: '.ci/java-versions.properties'
properties-file: ".ci/java-versions.properties"
properties-content: |
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
JAVA11_HOME=$HOME/.java/java11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- job:
name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-windows
display-name: "elastic / elasticsearch # %BRANCH% - windows compatibility"
description: "Elasticsearch %BRANCH% Windows compatibility testing.\n"
description: "This job has been migrated to Buildkite.\n"
disabled: true
project-type: matrix
node: master
# Use a hard-coded workspace directory to avoid hitting file path limits with auto-generated workspace path
Expand All @@ -25,14 +26,14 @@
type: user-defined
name: GRADLE_TASK
values:
- 'checkPart1'
- 'checkPart2'
- 'checkPart3'
- 'bwcTestSnapshots'
- 'checkRestCompat'
- "checkPart1"
- "checkPart2"
- "checkPart3"
- "bwcTestSnapshots"
- "checkRestCompat"
builders:
- inject:
properties-file: '.ci/java-versions.properties'
properties-file: ".ci/java-versions.properties"
properties-content: |
JAVA_HOME=$USERPROFILE\\.java\\$ES_BUILD_JAVA
JAVA11_HOME=$USERPROFILE\\.java\\java11
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
- job:
name: elastic+elasticsearch+%BRANCH%+periodic+platform-support
display-name: "elastic / elasticsearch # %BRANCH% - platform support"
description: "Testing of the Elasticsearch %BRANCH% branch platform support tests.\n"
description: "This job has been migrated to Buildkite.\n"
disabled: true
project-type: multijob
node: master
vault: []
Expand Down
4 changes: 2 additions & 2 deletions .ci/snapshotBwcVersions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BWC_VERSION:
- "7.17.14"
- "8.10.3"
- "7.17.15"
- "8.10.4"
- "8.11.0"
- "8.12.0"
4 changes: 2 additions & 2 deletions build-tools-internal/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=bb09982fdf52718e4c7b25023d10df6d35a5fff969860bdf5a5bd27a3ab27a9e
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if (buildNumber && performanceTest == null && GradleUtils.isIncludedBuild(projec
include("**/build/test-results/**/*.xml")
include("**/build/testclusters/**")
include("**/build/testrun/*/temp/**")
include("**/build/**/hs_err_pid*.log")
exclude("**/build/testclusters/**/data/**")
exclude("**/build/testclusters/**/distro/**")
exclude("**/build/testclusters/**/repo/**")
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.3
8.4
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider;
import org.elasticsearch.Build;
import org.elasticsearch.Version;
import org.elasticsearch.bootstrap.PluginPolicyInfo;
import org.elasticsearch.bootstrap.PolicyUtil;
import org.elasticsearch.cli.ExitCodes;
Expand Down Expand Up @@ -84,6 +83,8 @@
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
Expand Down Expand Up @@ -303,7 +304,7 @@ private Path download(InstallablePlugin plugin, Path tmpDir) throws Exception {
// else carry on to regular download
}

final String url = getElasticUrl(getStagingHash(), Version.CURRENT, isSnapshot(), pluginId, Platforms.PLATFORM_NAME);
final String url = getElasticUrl(getStagingHash(), isSnapshot(), pluginId, Platforms.PLATFORM_NAME);
terminal.println(logPrefix + "Downloading " + pluginId + " from elastic");
return downloadAndValidate(url, tmpDir, true);
}
Expand Down Expand Up @@ -341,7 +342,7 @@ private Path getPluginArchivePath(String pluginId, String pluginArchiveDir) thro
if (Files.isDirectory(path) == false) {
throw new UserException(ExitCodes.CONFIG, "Location in ES_PLUGIN_ARCHIVE_DIR is not a directory");
}
return PathUtils.get(pluginArchiveDir, pluginId + "-" + Version.CURRENT + (isSnapshot() ? "-SNAPSHOT" : "") + ".zip");
return PathUtils.get(pluginArchiveDir, pluginId + "-" + Build.current().qualifiedVersion() + ".zip");
}

// pkg private so tests can override
Expand All @@ -356,25 +357,30 @@ boolean isSnapshot() {
/**
* Returns the url for an official elasticsearch plugin.
*/
private String getElasticUrl(
final String stagingHash,
final Version version,
final boolean isSnapshot,
final String pluginId,
final String platform
) throws IOException, UserException {
private String getElasticUrl(final String stagingHash, final boolean isSnapshot, final String pluginId, final String platform)
throws IOException, UserException {
final String baseUrl;
if (isSnapshot && stagingHash == null) {
throw new UserException(
ExitCodes.CONFIG,
"attempted to install release build of official plugin on snapshot build of Elasticsearch"
);
}
// assumption: we will only be publishing plugins to snapshot or staging when they're versioned
String semanticVersion = getSemanticVersion(Build.current().version());
if (semanticVersion == null) {
throw new UserException(
ExitCodes.CONFIG,
"attempted to download a plugin for a non-semantically-versioned build of Elasticsearch: ["
+ Build.current().version()
+ "]"
);
}
if (stagingHash != null) {
if (isSnapshot) {
baseUrl = nonReleaseUrl("snapshots", version, stagingHash, pluginId);
baseUrl = nonReleaseUrl("snapshots", semanticVersion, stagingHash, pluginId);
} else {
baseUrl = nonReleaseUrl("staging", version, stagingHash, pluginId);
baseUrl = nonReleaseUrl("staging", semanticVersion, stagingHash, pluginId);
}
} else {
baseUrl = String.format(Locale.ROOT, "https://artifacts.elastic.co/downloads/elasticsearch-plugins/%s", pluginId);
Expand All @@ -393,7 +399,7 @@ private String getElasticUrl(
return String.format(Locale.ROOT, "%s/%s-%s.zip", baseUrl, pluginId, Build.current().qualifiedVersion());
}

private static String nonReleaseUrl(final String hostname, final Version version, final String stagingHash, final String pluginId) {
private static String nonReleaseUrl(final String hostname, final String version, final String stagingHash, final String pluginId) {
return String.format(
Locale.ROOT,
"https://%s.elastic.co/%s-%s/downloads/elasticsearch-plugins/%s",
Expand Down Expand Up @@ -1088,4 +1094,9 @@ private static void setFileAttributes(final Path path, final Set<PosixFilePermis
public void close() throws IOException {
IOUtils.rm(pathsToDeleteOnShutdown.toArray(new Path[0]));
}

static String getSemanticVersion(String version) {
Matcher matcher = Pattern.compile("^(\\d+\\.\\d+\\.\\d+)\\D?.*").matcher(version);
return matcher.matches() ? matcher.group(1) : null;
}
}
Loading

0 comments on commit cd0b34c

Please sign in to comment.