diff --git a/.ci/build.sh b/.ci/build.sh deleted file mode 100755 index 091f9582e0660..0000000000000 --- a/.ci/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# drop page cache and kernel slab objects on linux -[[ -x /usr/local/sbin/drop-caches ]] && sudo /usr/local/sbin/drop-caches - -rm -Rfv ~/.gradle/init.d/init.gradle -mkdir -p ~/.gradle/init.d && cp -v $WORKSPACE/.ci/init.gradle ~/.gradle/init.d - -if [ -f /proc/cpuinfo ] ; then - MAX_WORKERS=`grep '^cpu\scores' /proc/cpuinfo | uniq | sed 's/\s\+//g' | cut -d':' -f 2` -else - if [[ "$OSTYPE" == "darwin"* ]]; then - # Parallel is disabled at this time (eventually set to 1) due to errors on the Mac workers - # We'll have to do more testing to see if this can be re-enabled or what the proper value is. - # MAX_WORKERS=`sysctl -n hw.physicalcpu | sed 's/\s\+//g'` - MAX_WORKERS=2 - else - echo "Unsupported OS Type: $OSTYPE" - exit 1 - fi -fi - -if pwd | grep -v -q ^/dev/shm ; then - echo "Not running on a ramdisk, reducing number of workers" - MAX_WORKERS=$(($MAX_WORKERS*2/3)) -fi - -set -e -./gradlew --parallel --scan \ - -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ \ - --parallel --max-workers=$MAX_WORKERS \ - "$@" diff --git a/.ci/java-versions-aarch64.properties b/.ci/java-versions-aarch64.properties index ccbf32390e45e..2576ce3db704a 100644 --- a/.ci/java-versions-aarch64.properties +++ b/.ci/java-versions-aarch64.properties @@ -5,5 +5,3 @@ # are 'java' or 'openjdk' followed by the major release number. ES_BUILD_JAVA=jdk15 -ES_RUNTIME_JAVA=jdk15 -GRADLE_TASK=build diff --git a/.ci/java-versions.properties b/.ci/java-versions.properties index baea8e80050ec..d2f59b82fcca0 100644 --- a/.ci/java-versions.properties +++ b/.ci/java-versions.properties @@ -6,4 +6,3 @@ ES_BUILD_JAVA=openjdk15 ES_RUNTIME_JAVA=openjdk11 -GRADLE_TASK=build diff --git a/.ci/jobs.t/defaults.yml b/.ci/jobs.t/defaults.yml new file mode 100644 index 0000000000000..71b22e38bba12 --- /dev/null +++ b/.ci/jobs.t/defaults.yml @@ -0,0 +1,88 @@ +--- + +##### GLOBAL METADATA + +- meta: + cluster: elasticsearch-ci + +##### JOB DEFAULTS + +- job: + vault: + url: https://secrets.elastic.co:8200 + role_id: 1ba1ac3e-aee4-d040-d9a3-6ae23bd2b3db + node: "general-purpose" + concurrent: true + logrotate: + daysToKeep: 30 + numToKeep: 90 + artifactDaysToKeep: 7 + parameters: + - string: + name: branch_specifier + default: "refs/heads/%BRANCH%" + description: "the Git branch specifier to build (<branchName>, <tagName>, <commitId>, etc.)\n" + scm: + - git: + name: origin + # master node jenkins user ~/.ssh + credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba + reference-repo: "/var/lib/jenkins/.git-references/elasticsearch.git" + branches: + - "${branch_specifier}" + url: "https://github.com/elastic/elasticsearch.git" + basedir: "" + wipe-workspace: true + triggers: [] + wrappers: + - timeout: + type: absolute + timeout: 480 + fail: true + - ansicolor + - timestamps + - gradle-build-scan + - inject-passwords: + global: false + job-passwords: + - name: VAULT_ADDR + password: https://secrets.elastic.co:8200 + mask-password-params: true + properties: + - github: + url: https://github.com/elastic/elasticsearch/ + - inject: + properties-content: | + HOME=$JENKINS_HOME + GRADLEW=./gradlew --parallel --scan --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ + GRADLEW_BAT=./gradlew.bat --parallel --scan --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ + publishers: + - junit: + results: "**/*Junit/*.xml, **/test-results/*/*.xml" + keep-long-stdio: true + allow-empty-results: true + # Upload additional logs + - google-cloud-storage: + credentials-id: 'elasticsearch-ci-gcs-plugin' + uploads: + - classic: + file-pattern: 'build/*.tar.bz2' + storage-location: 'gs://elasticsearch-ci-artifacts/jobs/$JOB_NAME' + share-publicly: false + upload-for-failed-jobs: true + show-inline: true + # Notify homer + - postbuildscript: + builders: + - role: SLAVE + build-on: + - SUCCESS + - FAILURE + - UNSTABLE + build-steps: + - http-request: + url: https://homer.app.elstc.co/webhook/jenkins/build-finished + mode: GET + custom-headers: + - name: X-Jenkins-Build + value: ${BUILD_URL} diff --git a/.ci/jobs.t/elastic+elasticsearch+branch-consistency.yml b/.ci/jobs.t/elastic+elasticsearch+branch-consistency.yml new file mode 100644 index 0000000000000..4c7cbe414d30d --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+branch-consistency.yml @@ -0,0 +1,15 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+branch-consistency + display-name: "elastic / elasticsearch # %BRANCH% - branch consistency" + description: Testing of the Elasticsearch master branch version consistency. + triggers: + - timed: "H 7 * * *" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh branchConsistency diff --git a/.ci/jobs.t/elastic+elasticsearch+branch-protection.yml b/.ci/jobs.t/elastic+elasticsearch+branch-protection.yml new file mode 100644 index 0000000000000..30e4c1c20dd43 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+branch-protection.yml @@ -0,0 +1,20 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+branch-protection + display-name: "elastic / elasticsearch # %BRANCH% - branch protection" + description: Elasticsearch %BRANCH% branch protection. + node: master + triggers: + - timed: "H 7 * * *" + scm: [] + parameters: [] + builders: + - shell: | + #!/bin/bash + set +x + STATUS=$(curl -s https://api.github.com/repos/elastic/elasticsearch/branches/%BRANCH% | jq '.protected') + echo "Branch %BRANCH% protection status is: $STATUS" + if [[ "$STATUS" == "false" ]]; then + echo "Development branch %BRANCH% is not set as protected in GitHub but should be." + exit 1 + fi diff --git a/.ci/jobs.t/elastic+elasticsearch+folder+pull-request.yml b/.ci/jobs.t/elastic+elasticsearch+folder+pull-request.yml new file mode 100644 index 0000000000000..cef72323297a0 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+folder+pull-request.yml @@ -0,0 +1,4 @@ +- job: + name: elastic+elasticsearch+%BRANCH%+pull-request + display-name: Pull Requests + project-type: folder diff --git a/.ci/jobs.t/elastic+elasticsearch+folder+triggers.yml b/.ci/jobs.t/elastic+elasticsearch+folder+triggers.yml new file mode 100644 index 0000000000000..17febc7648cb1 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+folder+triggers.yml @@ -0,0 +1,4 @@ +- job: + name: elastic+elasticsearch+%BRANCH%+triggers + display-name: Periodic Triggers + project-type: folder diff --git a/.ci/jobs.t/elastic+elasticsearch+intake+multijob+bwc.yml b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+bwc.yml new file mode 100644 index 0000000000000..ab5f17d60b933 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+bwc.yml @@ -0,0 +1,7 @@ +--- +jjbb-template: generic-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+intake+multijob+bwc + - job-display-name: "elastic / elasticsearch # %BRANCH% - intake bwc" + - job-description: Elasticsearch %BRANCH% branch intake backwards compatibility checks. + - gradle-args: "-Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files bwcTestSnapshots" diff --git a/.ci/jobs.t/elastic+elasticsearch+intake+multijob+part1.yml b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+part1.yml new file mode 100644 index 0000000000000..e8a52d7953063 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+part1.yml @@ -0,0 +1,7 @@ +--- +jjbb-template: generic-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+intake+multijob+part1 + - job-display-name: "elastic / elasticsearch # %BRANCH% - intake part 1" + - job-description: Elasticsearch %BRANCH% branch intake check part 1. + - gradle-args: "-Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkPart1" diff --git a/.ci/jobs.t/elastic+elasticsearch+intake+multijob+part2.yml b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+part2.yml new file mode 100644 index 0000000000000..15cb91eea5724 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+part2.yml @@ -0,0 +1,7 @@ +--- +jjbb-template: generic-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+intake+multijob+part2 + - job-display-name: "elastic / elasticsearch # %BRANCH% - intake part 2" + - job-description: Elasticsearch %BRANCH% branch intake check part 2. + - gradle-args: "-Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkPart2" diff --git a/.ci/jobs.t/elastic+elasticsearch+intake+multijob+rest-compat.yml b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+rest-compat.yml new file mode 100644 index 0000000000000..eea1cfecdb126 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+rest-compat.yml @@ -0,0 +1,7 @@ +--- +jjbb-template: generic-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+intake+multijob+rest-compat + - job-display-name: "elastic / elasticsearch # %BRANCH% - intake rest compatibility" + - job-description: Elasticsearch %BRANCH% branch intake REST compatibility checks. + - gradle-args: "-Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkRestCompat" diff --git a/.ci/jobs.t/elastic+elasticsearch+intake+multijob+sanity-check.yml b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+sanity-check.yml new file mode 100644 index 0000000000000..047eca2cf5a4d --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+sanity-check.yml @@ -0,0 +1,7 @@ +--- +jjbb-template: generic-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+intake+multijob+sanity-check + - job-display-name: "elastic / elasticsearch # %BRANCH% - intake sanity check" + - job-description: Elasticsearch %BRANCH% branch intake sanity check. + - gradle-args: "-Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files precommit" diff --git a/.ci/jobs.t/elastic+elasticsearch+intake+multijob+update-last-good-commit.yml b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+update-last-good-commit.yml new file mode 100644 index 0000000000000..2a1d462d9ac89 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake+multijob+update-last-good-commit.yml @@ -0,0 +1,11 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+intake+multijob+update-last-good-commit + display-name: "elastic / elasticsearch # %BRANCH% - update last good commit" + description: Elasticsearch %BRANCH% branch update last good commit in build-stats. + node: light + properties: [] + builders: + - shell: | + #!/usr/local/bin/runbld --job-name elastic+elasticsearch+%BRANCH%+git+push + /usr/bin/true diff --git a/.ci/jobs.t/elastic+elasticsearch+intake.yml b/.ci/jobs.t/elastic+elasticsearch+intake.yml new file mode 100644 index 0000000000000..6da6161c56763 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+intake.yml @@ -0,0 +1,59 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+intake + display-name: "elastic / elasticsearch # %BRANCH% - intake" + description: "Testing of the Elasticsearch %BRANCH% branch on every push.\n" + project-type: multijob + node: master + vault: [] + triggers: + # We use this trigger instead of the provided "github" webhook trigger because it's more robust. + # Here we only trigger builds for pushes to the corresponding branch, rather than a push to any branch of the + # configured git repository. This avoids duplicate builds being triggered when pushes to multiple branches are + # done in quick succession. + - generic-webhook-trigger: + post-content-params: + - type: JSONPath + key: ref + value: '$.ref' + regex-filter-text: '$ref' + regex-filter-expression: "^refs/heads/%BRANCH%$" + cause: Push to GitHub (refs/heads/%BRANCH%) + silent-response: true + scm: + - git: + wipe-workspace: false + builders: + - multijob: + name: Sanity Check + projects: + - name: elastic+elasticsearch+%BRANCH%+intake+multijob+sanity-check + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - multijob: + name: Verification + projects: + - name: elastic+elasticsearch+%BRANCH%+intake+multijob+part1 + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+intake+multijob+part2 + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+intake+multijob+bwc + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+intake+multijob+rest-compat + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - multijob: + name: Update last good commit + projects: + - name: elastic+elasticsearch+%BRANCH%+intake+multijob+update-last-good-commit + kill-phase-on: NEVER + current-parameters: true + git-revision: true diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-unix.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-unix.yml new file mode 100644 index 0000000000000..8d8fd7f6c607f --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-unix.yml @@ -0,0 +1,36 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+packaging-tests-unix + display-name: "elastic / elasticsearch # %BRANCH% - unix packaging tests" + description: "Testing of the Elasticsearch %BRANCH% branch unix packaging test support matrix.\n" + project-type: matrix + node: master + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: label-expression + name: os + values: + - centos-7-packaging + - centos-8-packaging + - debian-9-packaging + - debian-10-packaging + - fedora-32-packaging + - opensuse-15-1-packaging + - oraclelinux-7-packaging + - oraclelinux-8-packaging + - sles-12-packaging + - sles-15-packaging + - ubuntu-18.04-packaging + - ubuntu-20.04-packaging + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + ./.ci/os.sh --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ destructivePackagingTest diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-upgrade.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-upgrade.yml new file mode 100644 index 0000000000000..5693e2a2799d9 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-upgrade.yml @@ -0,0 +1,30 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+packaging-tests-upgrade + display-name: "elastic / elasticsearch # %BRANCH% - packaging upgrade tests" + description: "Testing of the Elasticsearch %BRANCH% branch packaging test upgrade support matrix.\n" + project-type: matrix + node: master + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: label-expression + name: os + values: + - centos-8-packaging + - ubuntu-20.04-packaging + - axis: + type: yaml + filename: ".ci/bwcVersions" + name: BWC_VERSION + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + ./.ci/os.sh --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ destructiveDistroUpgradeTest.v$BWC_VERSION diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-windows.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-windows.yml new file mode 100644 index 0000000000000..35ea30685bbad --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+packaging-tests-windows.yml @@ -0,0 +1,31 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+packaging-tests-windows + display-name: "elastic / elasticsearch # %BRANCH% - windows packaging tests" + description: "Testing of the Elasticsearch %BRANCH% branch windows packaging test support matrix.\n" + project-type: matrix + node: master + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: label-expression + name: os + values: + - "windows-2012-r2" + - "windows-2016" + - "windows-2019" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$USERPROFILE\\.java\\$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$USERPROFILE\\.java\\$ES_RUNTIME_JAVA + - batch: | + del /f /s /q %USERPROFILE%\.gradle\init.d\*.* + mkdir %USERPROFILE%\.gradle\init.d + copy .ci\init.gradle %USERPROFILE%\.gradle\init.d\ + ( + echo powershell.exe .\.ci\os.ps1 ^|^| exit /b 1 + ) | java -jar "C:\Program Files\infra\bin\runbld" --redirect-stderr - diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-arm.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-arm.yml new file mode 100644 index 0000000000000..2051e7bc0b732 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-arm.yml @@ -0,0 +1,27 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-arm + display-name: "elastic / elasticsearch # %BRANCH% - arm compatibility" + description: "Elasticsearch %BRANCH% ARM (aarch64) compatibility testing.\n" + project-type: matrix + node: master + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: label-expression + name: os + values: + - "centos-8-aarch64&&immutable" + - "ubuntu-1804-aarch64&&immutable" + builders: + - inject: + properties-file: '.ci/java-versions-aarch64.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + JAVA15_HOME=$HOME/.java/jdk15 + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true check diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-darwin.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-darwin.yml new file mode 100644 index 0000000000000..2a51898f1e0b7 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-darwin.yml @@ -0,0 +1,15 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-darwin + display-name: "elastic / elasticsearch # %BRANCH% - darwin compatibility" + description: "Elasticsearch %BRANCH% MacOS compatibility testing.\n" + node: "macosx && x86_64" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true check diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-unix.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-unix.yml new file mode 100644 index 0000000000000..faa2cb56c3007 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-unix.yml @@ -0,0 +1,36 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-unix + display-name: "elastic / elasticsearch # %BRANCH% - unix compatibility" + description: "Elasticsearch %BRANCH% unix compatibility testing.\n" + project-type: matrix + node: master + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: label-expression + name: os + values: + - "centos-7&&immutable" + - "centos-8&&immutable" + - "debian-9&&immutable" + - "debian-10&&immutable" + - "fedora-32&&immutable" + - "opensuse-15-1&&immutable" + - "oraclelinux-7&&immutable" + - "oraclelinux-8&&immutable" + - "sles-12&&immutable" + - "sles-15&&immutable" + - "ubuntu-18.04&&immutable" + - "ubuntu-20.04&&immutable" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true check diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-windows.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-windows.yml new file mode 100644 index 0000000000000..03221cbe43c98 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+platform-support-windows.yml @@ -0,0 +1,43 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-windows + display-name: "elastic / elasticsearch # %BRANCH% - windows compatibility" + description: "Elasticsearch %BRANCH% Windows compatibility testing.\n" + project-type: matrix + node: master + # Use a hard-coded workspace directory to avoid hitting file path limits with auto-generated workspace path + child-workspace: "C:\\Users\\jenkins\\workspace\\platform-support\\${BUILD_NUMBER}" + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: label-expression + name: os + values: + - "windows-2012-r2" + - "windows-2016" + - "windows-2019" + # We shred out Windows testing into 4 parallel builds like on intake for expediency. + # Our tests run much slower on Windows so this avoids issues with builds timing out. + - axis: + type: user-defined + name: GRADLE_TASK + values: + - 'checkPart1' + - 'checkPart2' + - 'bwcTestSnapshots' + - 'checkRestCompat' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$USERPROFILE\\.java\\$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$USERPROFILE\\.java\\$ES_RUNTIME_JAVA + - batch: | + del /f /s /q %USERPROFILE%\.gradle\init.d\*.* + mkdir %USERPROFILE%\.gradle\init.d + copy .ci\init.gradle %USERPROFILE%\.gradle\init.d\ + ( + echo call %GRADLEW_BAT% --max-workers=4 -Dbwc.checkout.align=true %GRADLE_TASK% ^|^| exit /b 1 + ) | java -jar "C:\Program Files\infra\bin\runbld" --redirect-stderr - diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-azure-sas.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-azure-sas.yml new file mode 100644 index 0000000000000..4c6bd42b3ced8 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-azure-sas.yml @@ -0,0 +1,27 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-azure-sas + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-azure-sas + display-name: "elastic / elasticsearch # %BRANCH% - third party tests azure - sas token" + description: "Testing of the Elasticsearch %BRANCH% third party tests against Azure using SAS token\n" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + azure_storage_container=elasticsearch-ci-thirdparty-sas + azure_storage_base_path=%BRANCH% + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + set -euo pipefail + set +x + VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) + export VAULT_TOKEN + export data=$(vault read -format=json secret/elasticsearch-ci/azure_thirdparty_sas_test_creds) + export azure_storage_account=$(echo $data | jq -r .data.account_id) + export azure_storage_sas_token=$(echo $data | jq -r .data.account_sas_token) + unset VAULT_TOKEN data + set -x + + $WORKSPACE/.ci/scripts/run-gradle.sh azureThirdPartyTest diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-azure.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-azure.yml new file mode 100644 index 0000000000000..75b634c8e2226 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-azure.yml @@ -0,0 +1,27 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-azure + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-azure + display-name: "elastic / elasticsearch # %BRANCH% - third party tests azure" + description: "Testing of the Elasticsearch %BRANCH% third party tests against Azure\n" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + azure_storage_container=elasticsearch-ci-thirdparty + azure_storage_base_path=%BRANCH% + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + set -euo pipefail + set +x + VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) + export VAULT_TOKEN + export data=$(vault read -format=json secret/elasticsearch-ci/azure_thirdparty_test_creds) + export azure_storage_account=$(echo $data | jq -r .data.account_id) + export azure_storage_key=$(echo $data | jq -r .data.account_key) + unset VAULT_TOKEN data + set -x + + $WORKSPACE/.ci/scripts/run-gradle.sh azureThirdPartyTest diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-gcs.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-gcs.yml new file mode 100644 index 0000000000000..1f1920e484601 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-gcs.yml @@ -0,0 +1,27 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-gcs + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-gcs + display-name: "elastic / elasticsearch # %BRANCH% - third party tests gcs" + description: "Testing of the Elasticsearch %BRANCH% third party tests against GCS\n" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + google_storage_bucket=elasticsearch-ci-thirdparty + google_storage_base_path=%BRANCH% + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + set -euo pipefail + export google_storage_service_account=$(pwd)/gcs_service_account.json + + set +x + VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) + export VAULT_TOKEN + vault read -field=private_key_data gcp-elastic-ci-prod/key/elasticsearch-ci-thirdparty-gcs | base64 --decode > $google_storage_service_account + unset VAULT_TOKEN + set -x + + $WORKSPACE/.ci/scripts/run-gradle.sh gcsThirdPartyTest diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-geoip.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-geoip.yml new file mode 100644 index 0000000000000..b39fc28c41b86 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-geoip.yml @@ -0,0 +1,16 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-geoip + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-geoip + display-name: "elastic / elasticsearch # %BRANCH% - third party tests geoip" + description: "Testing of the Elasticsearch %BRANCH% third party tests against GeoIP database service\n" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + geoip_use_service=true + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh :modules:ingest-geoip:internalClusterTest diff --git a/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-s3.yml b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-s3.yml new file mode 100644 index 0000000000000..2dc45133c0ef1 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+multijob+third-party-tests-s3.yml @@ -0,0 +1,28 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-s3 + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-s3 + display-name: "elastic / elasticsearch # %BRANCH% - third party tests s3" + description: "Testing of the Elasticsearch %BRANCH% third party tests against S3\n" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + amazon_s3_bucket=elasticsearch-ci.us-west-2 + amazon_s3_base_path=%BRANCH% + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + set -euo pipefail + + set +x + VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) + export VAULT_TOKEN + export data=$(vault read -format=json aws-test/creds/elasticsearch-ci-s3) + export amazon_s3_access_key=$(echo $data | jq -r .data.access_key) + export amazon_s3_secret_key=$(echo $data | jq -r .data.secret_key) + unset VAULT_TOKEN data + set -x + + $WORKSPACE/.ci/scripts/run-gradle.sh s3ThirdPartyTest diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+bwc-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+bwc-trigger.yml new file mode 100644 index 0000000000000..291ed41a5facf --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+bwc-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+bwc + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/8 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+bwc.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+bwc.yml new file mode 100644 index 0000000000000..f4cadb7bad693 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+bwc.yml @@ -0,0 +1,9 @@ +--- +jjbb-template: matrix-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+periodic+bwc + - job-display-name: "elastic / elasticsearch # %BRANCH% - backwards compatibility matrix" + - job-description: "Testing of the Elasticsearch %BRANCH% branch backwards compatibility matrix.\n" + - matrix-yaml-file: ".ci/bwcVersions" + - matrix-variable: BWC_VERSION + - gradle-args: "-Dbwc.checkout.align=true v$BWC_VERSION#bwcTest" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+ear-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+ear-trigger.yml new file mode 100644 index 0000000000000..a50a1f96358ad --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+ear-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+ear + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/12 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+ear.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+ear.yml new file mode 100644 index 0000000000000..f925899f0445d --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+ear.yml @@ -0,0 +1,35 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+periodic+ear + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+periodic+ear + display-name: "elastic / elasticsearch # %BRANCH% - encryption at rest" + description: "The Elasticsearch %BRANCH% branch encryption at rest compatibility tests.\n\n" + node: packaging-large + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/bin/bash + # Configure a dm-crypt volume backed by a file + set -e + dd if=/dev/zero of=dm-crypt.img bs=1 count=0 seek=60GB + dd if=/dev/urandom of=key.secret bs=2k count=1 + LOOP=$(losetup -f) + sudo losetup $LOOP dm-crypt.img + sudo cryptsetup luksFormat -q --key-file key.secret "$LOOP" + sudo cryptsetup open --key-file key.secret "$LOOP" secret --verbose + sudo mkfs.ext2 /dev/mapper/secret + sudo mkdir /mnt/secret + sudo mount /dev/mapper/secret /mnt/secret + sudo chown -R jenkins /mnt/secret + cp -r "$WORKSPACE" /mnt/secret + cd /mnt/secret/$(basename "$WORKSPACE") + touch .output.log + rm -Rf "$WORKSPACE" + ln -s "$PWD" "$WORKSPACE" + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true check diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+eql-correctness-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+eql-correctness-trigger.yml new file mode 100644 index 0000000000000..986c52a137de3 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+eql-correctness-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+eql-correctness + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/8 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+eql-correctness.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+eql-correctness.yml new file mode 100644 index 0000000000000..62bd28ce479f6 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+eql-correctness.yml @@ -0,0 +1,23 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+periodic+eql-correctness + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+periodic+eql-correctness + display-name: "elastic / elasticsearch # %BRANCH% - eql correctness tests" + description: "Testing of Elasticsearch %BRANCH% EQL.\n" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + set +x + VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) + export VAULT_TOKEN + export eql_test_credentials_file="$(pwd)/x-pack/plugin/eql/qa/correctness/credentials.gcs.json" + vault read -field=credentials.gcs.json secret/elasticsearch-ci/eql_test_credentials > ${eql_test_credentials_file} + unset VAULT_TOKEN + set -x + + $WORKSPACE/.ci/scripts/run-gradle.sh :x-pack:plugin:eql:qa:correctness:check diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+java-fips-matrix-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+java-fips-matrix-trigger.yml new file mode 100644 index 0000000000000..fb2a23855cc9f --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+java-fips-matrix-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+java-fips-matrix + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/12 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+java-fips-matrix.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+java-fips-matrix.yml new file mode 100644 index 0000000000000..d4fa229963dcb --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+java-fips-matrix.yml @@ -0,0 +1,9 @@ +--- +jjbb-template: matrix-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+periodic+java-fips-matrix + - job-display-name: "elastic / elasticsearch # %BRANCH% - java fips compatibility matrix" + - job-description: "Testing of the Elasticsearch %BRANCH% branch java FIPS compatibility matrix.\n" + - matrix-yaml-file: ".ci/matrix-runtime-javas.yml" + - matrix-variable: ES_RUNTIME_JAVA + - gradle-args: "-Dbwc.checkout.align=true -Dtests.fips.enabled=true check" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+java-matrix-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+java-matrix-trigger.yml new file mode 100644 index 0000000000000..8de3326dd819d --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+java-matrix-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+java-matrix + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/12 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+java-matrix.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+java-matrix.yml new file mode 100644 index 0000000000000..51f7a7bf20878 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+java-matrix.yml @@ -0,0 +1,9 @@ +--- +jjbb-template: matrix-gradle-unix.yml +vars: + - job-name: elastic+elasticsearch+%BRANCH%+periodic+java-matrix + - job-display-name: "elastic / elasticsearch # %BRANCH% - java compatibility matrix" + - job-description: "Testing of the Elasticsearch %BRANCH% branch java compatibility matrix.\n" + - matrix-yaml-file: ".ci/matrix-runtime-javas.yml" + - matrix-variable: ES_RUNTIME_JAVA + - gradle-args: "-Dbwc.checkout.align=true check" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests-trigger.yml new file mode 100644 index 0000000000000..d8c8b557e4514 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+packaging-tests + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/8 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml new file mode 100644 index 0000000000000..a68641f50a174 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml @@ -0,0 +1,27 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+periodic+packaging-tests + display-name: "elastic / elasticsearch # %BRANCH% - packaging tests" + description: "Testing of the Elasticsearch %BRANCH% branch packaging tests.\n" + project-type: multijob + node: master + vault: [] + scm: + - git: + wipe-workspace: false + builders: + - multijob: + name: Packaging tests + projects: + - name: elastic+elasticsearch+%BRANCH%+multijob+packaging-tests-unix + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+packaging-tests-windows + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+packaging-tests-upgrade + kill-phase-on: NEVER + current-parameters: true + git-revision: true diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+platform-support-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+platform-support-trigger.yml new file mode 100644 index 0000000000000..fa99104641db0 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+platform-support-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+platform-support + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/12 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+platform-support.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+platform-support.yml new file mode 100644 index 0000000000000..389c0f82849e4 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+platform-support.yml @@ -0,0 +1,31 @@ +--- +- 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" + project-type: multijob + node: master + vault: [] + scm: + - git: + wipe-workspace: false + builders: + - multijob: + name: Packaging tests + projects: + - name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-darwin + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-unix + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-windows + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+platform-support-arm + kill-phase-on: NEVER + current-parameters: true + git-revision: true diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+release-tests-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+release-tests-trigger.yml new file mode 100644 index 0000000000000..c624c929b3dd6 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+release-tests-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+release-tests + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H/12 * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+release-tests.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+release-tests.yml new file mode 100644 index 0000000000000..34b6363a209b2 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+release-tests.yml @@ -0,0 +1,17 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+periodic+release-tests + workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+periodic+release-tests + display-name: "elastic / elasticsearch # %BRANCH% - release tests" + description: "Release version tests for the Elasticsearch %BRANCH% branch.\n" + node: "general-purpose && docker" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dbuild.snapshot=false \ + -Dtests.jvm.argline=-Dbuild.snapshot=false -Dlicense.key=${WORKSPACE}/x-pack/license-tools/src/test/resources/public.key build diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+third-party-tests.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+third-party-tests.yml new file mode 100644 index 0000000000000..1a52922767156 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+third-party-tests.yml @@ -0,0 +1,35 @@ +--- +- job: + name: elastic+elasticsearch+%BRANCH%+periodic+third-party-tests + display-name: "elastic / elasticsearch # %BRANCH% - third party tests" + description: "Testing of the Elasticsearch %BRANCH% branch against third-party service integrations.\n" + project-type: multijob + node: master + vault: [] + scm: + - git: + wipe-workspace: false + builders: + - multijob: + name: Third party repository compatibility tests + projects: + - name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-azure + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-azure-sas + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-gcs + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-s3 + kill-phase-on: NEVER + current-parameters: true + git-revision: true + - name: elastic+elasticsearch+%BRANCH%+multijob+third-party-tests-geoip + kill-phase-on: NEVER + current-parameters: true + git-revision: true diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+thrid-party-tests-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+thrid-party-tests-trigger.yml new file mode 100644 index 0000000000000..61b249d2903e5 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+periodic+thrid-party-tests-trigger.yml @@ -0,0 +1,6 @@ +--- +jjbb-template: periodic-trigger-lgc.yml +vars: + - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+third-party-tests + - lgc-job: elastic+elasticsearch+%BRANCH%+intake + - cron: "H H * * *" diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+bwc.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+bwc.yml new file mode 100644 index 0000000000000..b3c1281e46d93 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+bwc.yml @@ -0,0 +1,5 @@ +--- +jjbb-template: pull-request-gradle-unix.yml +vars: + - pr-job: "bwc" + - gradle-args: "-Dignore.tests.seed bwcTestSnapshots" diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+docs-check.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+docs-check.yml new file mode 100644 index 0000000000000..7e7f9fcbd0e71 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+docs-check.yml @@ -0,0 +1,30 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+docs-check" + display-name: "elastic / elasticsearch # %BRANCH% - pull request docs-check" + description: "Testing of Elasticsearch pull requests - docs-check" + workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+docs-check" + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/docs-check.*' + github-hooks: true + status-context: elasticsearch-ci/docs-check + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + included-regions: + - ^docs/.* + black-list-labels: + - '>test-mute' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed :docs:check diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+eql-correctness.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+eql-correctness.yml new file mode 100644 index 0000000000000..24747a4b7bdf0 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+eql-correctness.yml @@ -0,0 +1,38 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+eql-correctness" + display-name: "elastic / elasticsearch # %BRANCH% - pull request eql-correctness" + description: "Testing of Elasticsearch pull requests - eql-correctness" + workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+eql-correctness" + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/eql-correctness.*' + github-hooks: true + status-context: elasticsearch-ci/eql-correctness + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + black-list-labels: + - '>test-mute' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + set +x + VAULT_TOKEN=$(vault write -field=token auth/approle/login role_id=$VAULT_ROLE_ID secret_id=$VAULT_SECRET_ID) + export VAULT_TOKEN + export eql_test_credentials_file="$(pwd)/x-pack/plugin/eql/qa/correctness/credentials.gcs.json" + vault read -field=credentials.gcs.json secret/elasticsearch-ci/eql_test_credentials > ${eql_test_credentials_file} + unset VAULT_TOKEN + set -x + + $WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed :x-pack:plugin:eql:qa:correctness:check diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-unix-sample.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-unix-sample.yml new file mode 100644 index 0000000000000..deb712afb0ff3 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-unix-sample.yml @@ -0,0 +1,46 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+packaging-tests-unix-sample" + display-name: "elastic / elasticsearch # %BRANCH% - pull request packaging-tests-unix-sample" + description: "Testing of Elasticsearch pull requests - packaging-tests-unix-sample" + project-type: matrix + node: master + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/packaging-tests-unix-sample.*' + github-hooks: true + status-context: elasticsearch-ci/packaging-tests-unix-sample + cancel-builds-on-update: + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + black-list-labels: + - '>test-mute' + - ':Delivery/Packaging' + axes: + - axis: + type: label-expression + name: os + values: + - centos-8-packaging + - ubuntu-20.04-packaging + - axis: + type: user-defined + name: PACKAGING_TASK + values: + - 'destructiveDistroTest.docker' + - 'destructiveDistroTest.packages' + - 'destructiveDistroTest.archives' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + ./.ci/os.sh --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ $PACKAGING_TASK diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-unix.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-unix.yml new file mode 100644 index 0000000000000..5321a67b413f6 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-unix.yml @@ -0,0 +1,57 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+packaging-tests-unix" + display-name: "elastic / elasticsearch # %BRANCH% - pull request packaging-tests-unix" + description: "Testing of Elasticsearch pull requests - packaging-tests-unix" + project-type: matrix + node: master + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/packaging-tests-unix.*' + github-hooks: true + status-context: elasticsearch-ci/packaging-tests-unix + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + white-list-labels: + - ':Delivery/Packaging' + black-list-labels: + - '>test-mute' + axes: + - axis: + type: label-expression + name: os + values: + - centos-7-packaging + - centos-8-packaging + - debian-9-packaging + - debian-10-packaging + - fedora-32-packaging + - opensuse-15-1-packaging + - oraclelinux-7-packaging + - oraclelinux-8-packaging + - sles-12-packaging + - sles-15-packaging + - ubuntu-18.04-packaging + - ubuntu-20.04-packaging + - axis: + type: user-defined + name: PACKAGING_TASK + values: + - 'destructiveDistroTest.docker' + - 'destructiveDistroTest.packages' + - 'destructiveDistroTest.archives' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + ./.ci/os.sh --build-cache -Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ $PACKAGING_TASK diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-windows-sample.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-windows-sample.yml new file mode 100644 index 0000000000000..e19f420153ebd --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-windows-sample.yml @@ -0,0 +1,50 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+packaging-tests-windows-sample" + display-name: "elastic / elasticsearch # %BRANCH% - pull request packaging-tests-windows-sample" + description: "Testing of Elasticsearch pull requests - packaging-tests-windows-sample" + # We use a hard-coded workspace directory here to avoid hitting windows path length limits + child-workspace: "C:\\Users\\jenkins\\workspace\\pr-packaging-windows\\${BUILD_NUMBER}" + project-type: matrix + node: master + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/packaging-tests-windows-sample.*' + github-hooks: true + status-context: elasticsearch-ci/packaging-tests-windows-sample + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + black-list-labels: + - '>test-mute' + - ':Delivery/Packaging' + axes: + - axis: + type: label-expression + name: os + values: + - "windows-2019" + - axis: + type: user-defined + name: PACKAGING_TASK + values: + - 'default-windows-archive' + - 'default-windows-archive-no-jdk' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$USERPROFILE\\.java\\$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$USERPROFILE\\.java\\$ES_RUNTIME_JAVA + - batch: | + del /f /s /q %USERPROFILE%\.gradle\init.d\*.* + mkdir %USERPROFILE%\.gradle\init.d + copy .ci\init.gradle %USERPROFILE%\.gradle\init.d\ + ( + echo call %GRADLEW_BAT% --max-workers=4 -Dbwc.checkout.align=true %PACKAGING_TASK% ^|^| exit /b 1 + ) | java -jar "C:\Program Files\infra\bin\runbld" --redirect-stderr - diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-windows.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-windows.yml new file mode 100644 index 0000000000000..7d1ec66f46e44 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+packaging-tests-windows.yml @@ -0,0 +1,53 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+packaging-tests-windows" + display-name: "elastic / elasticsearch # %BRANCH% - pull request packaging-tests-windows" + description: "Testing of Elasticsearch pull requests - packaging-tests-windows" + # We use a hard-coded workspace directory here to avoid hitting windows path length limits + child-workspace: "C:\\Users\\jenkins\\workspace\\pr-packaging-windows\\${BUILD_NUMBER}" + project-type: matrix + node: master + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/packaging-tests-windows.*' + github-hooks: true + status-context: elasticsearch-ci/packaging-tests-windows + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + white-list-labels: + - ':Delivery/Packaging' + black-list-labels: + - '>test-mute' + axes: + - axis: + type: label-expression + name: os + values: + - "windows-2012-r2" + - "windows-2016" + - "windows-2019" + - axis: + type: user-defined + name: PACKAGING_TASK + values: + - 'default-windows-archive' + - 'default-windows-archive-no-jdk' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$USERPROFILE\\.java\\$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$USERPROFILE\\.java\\$ES_RUNTIME_JAVA + - batch: | + del /f /s /q %USERPROFILE%\.gradle\init.d\*.* + mkdir %USERPROFILE%\.gradle\init.d + copy .ci\init.gradle %USERPROFILE%\.gradle\init.d\ + ( + echo call %GRADLEW_BAT% --max-workers=4 -Dbwc.checkout.align=true %PACKAGING_TASK% ^|^| exit /b 1 + ) | java -jar "C:\Program Files\infra\bin\runbld" --redirect-stderr - diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+part-1-fips.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-1-fips.yml new file mode 100644 index 0000000000000..e2e25056f7ada --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-1-fips.yml @@ -0,0 +1,32 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+part-1-fips" + display-name: "elastic / elasticsearch # %BRANCH% - pull request part-1 fips" + description: "Testing of Elasticsearch pull requests - part-1 fips" + workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+part-1-fips" + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/part-1-fips.*' + github-hooks: true + status-context: elasticsearch-ci/part-1-fips + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + white-list-labels: + - ':Security/FIPS' + black-list-labels: + - '>test-mute' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed checkPart1 diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+part-1.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-1.yml new file mode 100644 index 0000000000000..8d4f4fbe31678 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-1.yml @@ -0,0 +1,5 @@ +--- +jjbb-template: pull-request-gradle-unix.yml +vars: + - pr-job: "part-1" + - gradle-args: "-Dignore.tests.seed checkPart1" diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+part-2-fips.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-2-fips.yml new file mode 100644 index 0000000000000..c3c21f9862abd --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-2-fips.yml @@ -0,0 +1,32 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+part-2-fips" + display-name: "elastic / elasticsearch # %BRANCH% - pull request part-2 fips" + description: "Testing of Elasticsearch pull requests - part-2 fips" + workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+part-2-fips" + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/part-2-fips.*' + github-hooks: true + status-context: elasticsearch-ci/part-2-fips + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + white-list-labels: + - ':Security/FIPS' + black-list-labels: + - '>test-mute' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed checkPart2 diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+part-2.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-2.yml new file mode 100644 index 0000000000000..b77edcd3759be --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+part-2.yml @@ -0,0 +1,5 @@ +--- +jjbb-template: pull-request-gradle-unix.yml +vars: + - pr-job: "part-2" + - gradle-args: "-Dignore.tests.seed checkPart2" diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+precommit.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+precommit.yml new file mode 100644 index 0000000000000..69fcf9509f6a1 --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+precommit.yml @@ -0,0 +1,30 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+precommit" + display-name: "elastic / elasticsearch # %BRANCH% - pull request precommit" + description: "Testing of Elasticsearch pull requests - precommit" + workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+precommit" + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/precommit.*' + github-hooks: true + status-context: elasticsearch-ci/precommit + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + included-regions: + - ^docs/.* + black-list-labels: + - '>test-mute' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh -Dignore.tests.seed precommit diff --git a/.ci/jobs.t/elastic+elasticsearch+pull-request+rest-compatibility.yml b/.ci/jobs.t/elastic+elasticsearch+pull-request+rest-compatibility.yml new file mode 100644 index 0000000000000..58f2bf302a06f --- /dev/null +++ b/.ci/jobs.t/elastic+elasticsearch+pull-request+rest-compatibility.yml @@ -0,0 +1,5 @@ +--- +jjbb-template: pull-request-gradle-unix.yml +vars: + - pr-job: "rest-compatibility" + - gradle-args: "-Dignore.tests.seed checkRestCompat" diff --git a/.ci/make-branch-config.sh b/.ci/make-branch-config.sh index ecbdfe3f3a9c6..9c1a6eeab9a4e 100755 --- a/.ci/make-branch-config.sh +++ b/.ci/make-branch-config.sh @@ -1,11 +1,15 @@ -#!/bin/bash +#!/bin/bash -if [ -z "$BRANCH" ] ; then +if [ -z "$BRANCH" ] ; then echo "BRANCH is unset" exit 1 -fi +fi -rm -Rf .ci/jobs -cp -r .ci/jobs.t .ci/jobs - -sed -i "s/%BRANCH%/${BRANCH}/g" .ci/jobs/*.yml +folders=("jobs" "templates" "views") +for folder in "${folders[@]}" +do + #rm -Rf .ci/$folder; + #mkdir -p .ci/$folder + cp -r .ci/${folder}.t/* .ci/$folder/ + sed -i "s/%BRANCH%/${BRANCH}/g" .ci/$folder/*.yml +done diff --git a/.ci/matrix-vagrant-packaging.yml b/.ci/matrix-vagrant-packaging.yml deleted file mode 100644 index fdda11ac0ab36..0000000000000 --- a/.ci/matrix-vagrant-packaging.yml +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used as part of a matrix build in Jenkins where the -# values below are included as an axis of the matrix. - -# This axis of the build matrix represents the versions subprojects -# of the :qa:os project which will be tested on a metal CI worker -# for the purposes of verifying of Vagrant-based tooling - -OS: - - centos-7 - - debian-9 - - fedora-28 - - fedora-29 - - oel-7 - - sles-12 - - ubuntu-1804 - - windows-2012r2 - - windows-2016 diff --git a/.ci/scripts/packaging-test.ps1 b/.ci/scripts/packaging-test.ps1 new file mode 100644 index 0000000000000..0fa43c4b250fa --- /dev/null +++ b/.ci/scripts/packaging-test.ps1 @@ -0,0 +1,32 @@ +param($GradleTasks='destructiveDistroTest') + +If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) +{ + # Relaunch as an elevated process: + Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs + exit +} + +$AppProps = ConvertFrom-StringData (Get-Content .ci/java-versions.properties -raw) +$env:ES_BUILD_JAVA=$AppProps.ES_BUILD_JAVA +$env:ES_RUNTIME_JAVA=$AppProps.ES_RUNTIME_JAVA + +$ErrorActionPreference="Stop" +$gradleInit = "C:\Users\$env:username\.gradle\init.d\" +echo "Remove $gradleInit" +Remove-Item -Recurse -Force $gradleInit -ErrorAction Ignore +New-Item -ItemType directory -Path $gradleInit +echo "Copy .ci/init.gradle to $gradleInit" +Copy-Item .ci/init.gradle -Destination $gradleInit + +[Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine") +$env:PATH="C:\Users\jenkins\.java\$env:ES_BUILD_JAVA\bin\;$env:PATH" +$env:JAVA_HOME=$null +$env:SYSTEM_JAVA_HOME="C:\Users\jenkins\.java\$env:ES_RUNTIME_JAVA" +Remove-Item -Recurse -Force \tmp -ErrorAction Ignore +New-Item -ItemType directory -Path \tmp + +$ErrorActionPreference="Continue" +& .\gradlew.bat -g "C:\Users\$env:username\.gradle" --parallel --no-daemon --scan --console=plain $GradleTasks + +exit $LastExitCode diff --git a/.ci/scripts/packaging-test.sh b/.ci/scripts/packaging-test.sh new file mode 100755 index 0000000000000..1509a2091d29b --- /dev/null +++ b/.ci/scripts/packaging-test.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# opensuse 15 has a missing dep for systemd + +if which zypper > /dev/null ; then + sudo zypper install -y insserv-compat +fi + +if [ -e /etc/sysctl.d/99-gce.conf ]; then + # The GCE defaults disable IPv4 forwarding, which breaks the Docker + # build. Workaround this by renaming the file so that it is executed + # earlier than our own overrides. + # + # This ultimately needs to be fixed at the image level - see infra + # issue 15654. + sudo mv /etc/sysctl.d/99-gce.conf /etc/sysctl.d/98-gce.conf +fi + +# Required by bats +sudo touch /etc/is_vagrant_vm +sudo useradd vagrant + +set -e + +. .ci/java-versions.properties +RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA +BUILD_JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + +rm -Rfv $HOME/.gradle/init.d/ && mkdir -p $HOME/.gradle/init.d +cp -v .ci/init.gradle $HOME/.gradle/init.d + +unset JAVA_HOME + +if [ -f "/etc/os-release" ] ; then + cat /etc/os-release + . /etc/os-release + if [[ "$ID" == "debian" || "$ID_LIKE" == "debian" ]] ; then + # FIXME: The base image should not have rpm installed + sudo rm -Rf /usr/bin/rpm + # Work around incorrect lintian version + # https://github.com/elastic/elasticsearch/issues/48573 + if [ $VERSION_ID == 10 ] ; then + sudo apt-get install -y --allow-downgrades lintian=2.15.0 + fi + fi +else + cat /etc/issue || true +fi + +sudo bash -c 'cat > /etc/sudoers.d/elasticsearch_vars' << SUDOERS_VARS + Defaults env_keep += "ES_JAVA_HOME" + Defaults env_keep += "JAVA_HOME" + Defaults env_keep += "SYSTEM_JAVA_HOME" +SUDOERS_VARS +sudo chmod 0440 /etc/sudoers.d/elasticsearch_vars + +# Bats tests still use this locationa +sudo rm -Rf /elasticsearch +sudo mkdir -p /elasticsearch/qa/ && sudo chown jenkins /elasticsearch/qa/ && ln -s $PWD/qa/vagrant /elasticsearch/qa/ + +# sudo sets it's own PATH thus we use env to override that and call sudo annother time so we keep the secure root PATH +# run with --continue to run both bats and java tests even if one fails +# be explicit about Gradle home dir so we use the same even with sudo +sudo -E env \ + PATH=$BUILD_JAVA_HOME/bin:`sudo bash -c 'echo -n $PATH'` \ + RUNTIME_JAVA_HOME=`readlink -f -n $RUNTIME_JAVA_HOME` \ + --unset=ES_JAVA_HOME \ + --unset=JAVA_HOME \ + SYSTEM_JAVA_HOME=`readlink -f -n $RUNTIME_JAVA_HOME` \ + ./gradlew -g $HOME/.gradle --scan --parallel --continue $@ + diff --git a/.ci/teamcity.init.gradle b/.ci/teamcity.init.gradle deleted file mode 100644 index 91436b8805e0c..0000000000000 --- a/.ci/teamcity.init.gradle +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -gradle.settingsEvaluated { settings -> - String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url') - boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false')) - - if (buildCacheUrl) { - settings.buildCache { - local { - // Disable the local build cache in CI since we use ephemeral workers and it incurs an IO penalty - enabled = false - } - remote(HttpBuildCache) { - url = buildCacheUrl - push = buildCachePush -// credentials { -// username = buildCacheCredentials.get("username") -// password = buildCacheCredentials.get("password") -// } - } - } - } - - // Update build configuration parameter with latest published build scan - settings.pluginManager.withPlugin('com.gradle.enterprise') { - settings.gradleEnterprise.buildScan.buildScanPublished { scan -> - println "##teamcity[setParameter name='gradle.build.scan' value='${scan.buildScanUri}']" - } - } -} diff --git a/.ci/templates.t/generic-gradle-unix.yml b/.ci/templates.t/generic-gradle-unix.yml new file mode 100644 index 0000000000000..a5adc34f93204 --- /dev/null +++ b/.ci/templates.t/generic-gradle-unix.yml @@ -0,0 +1,16 @@ +--- +- job: + name: "{job-name}" + display-name: "{job-display-name}" + description: "{job-description}" + workspace: /dev/shm/{job-name} + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + JAVA15_HOME=$HOME/.java/openjdk15 + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh {gradle-args} diff --git a/.ci/templates.t/matrix-gradle-unix.yml b/.ci/templates.t/matrix-gradle-unix.yml new file mode 100644 index 0000000000000..4952a31674ec7 --- /dev/null +++ b/.ci/templates.t/matrix-gradle-unix.yml @@ -0,0 +1,31 @@ +--- +- job: + name: "{job-name}" + display-name: "{job-display-name}" + description: "{job-description}" + project-type: matrix + child-workspace: /dev/shm/{job-name} + node: master + scm: + - git: + wipe-workspace: false + axes: + - axis: + type: slave + name: nodes + values: + - "general-purpose" + - axis: + type: yaml + filename: "{matrix-yaml-file}" + name: "{matrix-variable}" + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + JAVA15_HOME=$HOME/.java/openjdk15 + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh {gradle-args} diff --git a/.ci/templates.t/periodic-trigger-lgc.yml b/.ci/templates.t/periodic-trigger-lgc.yml new file mode 100644 index 0000000000000..1a42bd7472d2a --- /dev/null +++ b/.ci/templates.t/periodic-trigger-lgc.yml @@ -0,0 +1,26 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+triggers/{periodic-job}-trigger" + display-name: "{periodic-job}-trigger" + description: "Scheduled trigger for {periodic-job}" + node: master + scm: [] + properties: [] + parameters: [] + publishers: [] + triggers: + - timed: "{cron}" + builders: + - shell: | + #!/usr/bin/env bash + set -o pipefail + echo "Retrieving last good commit for job '{lgc-job}'" + echo branch_specifier=$(curl -s "${JENKINS_URL}job/{lgc-job}/lastSuccessfulBuild/api/json" | jq -r -e '.actions | map(select(._class == "hudson.plugins.git.util.BuildData")) | .[] | .lastBuiltRevision.SHA1' || echo "refs/heads/%BRANCH%") > trigger.properties + echo "Trigger properties:" $(cat trigger.properties) + - trigger-builds: + - project: "{periodic-job}" + current-parameters: false + git-revision: false + parameter-factories: + - factory: filebuild + file-pattern: trigger.properties diff --git a/.ci/templates.t/pull-request-gradle-unix.yml b/.ci/templates.t/pull-request-gradle-unix.yml new file mode 100644 index 0000000000000..cfb751c7cceeb --- /dev/null +++ b/.ci/templates.t/pull-request-gradle-unix.yml @@ -0,0 +1,31 @@ +--- +- job: + name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+{pr-job}" + display-name: "elastic / elasticsearch # %BRANCH% - pull request {pr-job}" + description: "Testing of Elasticsearch pull requests - {pr-job}" + workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+{pr-job}" + triggers: + - github-pull-request: + org-list: + - elastic + allow-whitelist-orgs-as-admins: true + trigger-phrase: '.*run\W+elasticsearch-ci/{pr-job}.*' + github-hooks: true + status-context: elasticsearch-ci/{pr-job} + cancel-builds-on-update: true + white-list-target-branches: + - %BRANCH% + excluded-regions: + - ^docs/.* + black-list-labels: + - '>test-mute' + builders: + - inject: + properties-file: '.ci/java-versions.properties' + properties-content: | + JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA + RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA + JAVA15_HOME=$HOME/.java/openjdk15 + - shell: | + #!/usr/local/bin/runbld --redirect-stderr + $WORKSPACE/.ci/scripts/run-gradle.sh {gradle-args} diff --git a/.ci/views.t/views.yml b/.ci/views.t/views.yml new file mode 100644 index 0000000000000..6d386193467ce --- /dev/null +++ b/.ci/views.t/views.yml @@ -0,0 +1,4 @@ +- view: + name: "Elasticsearch %BRANCH%" + view-type: list + regex: '^elastic[-+]elasticsearch\+%BRANCH%\+((?!multijob).)*$' diff --git a/.gitignore b/.gitignore index 40cd5bb565620..fd6449f1c7c4c 100644 --- a/.gitignore +++ b/.gitignore @@ -59,8 +59,10 @@ eclipse-build # projects using testfixtures testfixtures_shared/ -# These are generated from .ci/jobs.t +# These are generated from .ci/jobs.t, .ci/templates.t and .ci/views.t .ci/jobs/ +.ci/templates/ +.ci/views/ # Generated checkstyle_ide.xml