Skip to content

Commit 1cc9878

Browse files
committed
Move periodic job to ES repo (#48570)
* Move periodic job to ES repo This change kickstarts the process of moving CI job definitions to this repo. * Added a minimal readme to provide pointers to the documentation * Update .ci/README.md Co-Authored-By: Rory Hunter <[email protected]> * Update .ci/README.md Co-Authored-By: Rory Hunter <[email protected]> * point to main repo * PR review * Add link to JJBB
1 parent e92b170 commit 1cc9878

6 files changed

+165
-0
lines changed

.ci/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CI configuration for Elasticsearch
2+
==================================
3+
4+
Layout and Syntax
5+
-----------------
6+
7+
CI is run by Jenkins at [elasticsearch-ci](https://elasticsearch-ci.elastic.co/).
8+
Jobs live in the [jobs.t](jobs.t) directory, these are defined in YML using a syntax
9+
simmilar to [JJB](https://elasticsearch-ci.elastic.co/view/Elasticsearch%20master/).
10+
Macros are not allowed, and each job must be defined in its own file.
11+
Merging of the default configuration is customized so unlike in standard JJB,
12+
it recurses into YML objects.
13+
Further (internal) documentation on the setup
14+
[is available](https://github.com/elastic/infra/blob/master/flavortown/jjbb/README.md)
15+
.
16+

.ci/build.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# drop page cache and kernel slab objects on linux
4+
[[ -x /usr/local/sbin/drop-caches ]] && sudo /usr/local/sbin/drop-caches
5+
6+
rm -Rfv ~/.gradle/init.d/init.gradle
7+
mkdir -p ~/.gradle/init.d && cp -v $WORKSPACE/.ci/init.gradle ~/.gradle/init.d
8+
9+
if [ -f /proc/cpuinfo ] ; then
10+
MAX_WORKERS=`grep '^cpu\scores' /proc/cpuinfo | uniq | sed 's/\s\+//g' | cut -d':' -f 2`
11+
else
12+
if [[ "$OSTYPE" == "darwin"* ]]; then
13+
MAX_WORKERS=`sysctl -n hw.physicalcpu | sed 's/\s\+//g'`
14+
# Looks like it's too much for our workers so reduce it further
15+
MAX_WORKERS=$(($MAX_WORKERS/2))
16+
else
17+
echo "Unsupported OS Type: $OSTYPE"
18+
exit 1
19+
fi
20+
fi
21+
22+
if pwd | grep -v -q ^/dev/shm ; then
23+
echo "Not running on a ramdisk, reducing number of workers"
24+
MAX_WORKERS=$(($MAX_WORKERS*2/3))
25+
fi
26+
27+
export GRADLE_OPTS="-XX:+HeapDumpOnOutOfMemoryError -Xmx128m -Xms128m"
28+
set -e
29+
./gradlew --parallel --scan \
30+
-Dorg.elasticsearch.build.cache.url=https://gradle-enterprise.elastic.co/cache/ \
31+
--parallel --max-workers=$MAX_WORKERS \
32+
"$@"

.ci/jobs.t/defaults.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
3+
##### GLOBAL METADATA
4+
5+
- meta:
6+
cluster: elasticsearch-ci
7+
8+
##### JOB DEFAULTS
9+
10+
- job:
11+
vault:
12+
url: https://secrets.elastic.co:8200
13+
role_id: 1ba1ac3e-aee4-d040-d9a3-6ae23bd2b3db
14+
node: "general-purpose"
15+
concurrent: true
16+
logrotate:
17+
daysToKeep: 30
18+
numToKeep: 90
19+
artifactDaysToKeep: 7
20+
scm:
21+
- git:
22+
name: origin
23+
# master node jenkins user ~/.ssh
24+
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
25+
reference-repo: "/var/lib/jenkins/.git-references/elasticsearch.git"
26+
branches:
27+
- "%BRANCH%"
28+
url: "https://github.com/elastic/elasticsearch.git"
29+
basedir: ""
30+
wipe-workspace: "yes"
31+
wrappers:
32+
- timeout:
33+
type: absolute
34+
timeout: "120"
35+
fail: true
36+
- ansicolor
37+
- timestamps
38+
# TODO: No support un JJBB ?
39+
# - gradle-build-scan
40+
properties:
41+
- github:
42+
url: https://github.com/elastic/elasticsearch/
43+
- inject:
44+
properties-content: |
45+
HOME=$JENKINS_HOME
46+
builders:
47+
- inject:
48+
properties-file: '.ci/java-versions.properties'
49+
properties-content: |
50+
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
51+
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
52+
JAVA7_HOME=$HOME/.java/java7
53+
JAVA8_HOME=$HOME/.java/java8
54+
JAVA9_HOME=$HOME/.java/java9
55+
JAVA10_HOME=$HOME/.java/java10
56+
JAVA11_HOME=$HOME/.java/java11
57+
JAVA12_HOME=$HOME/.java/openjdk12
58+
JAVA13_HOME=$HOME/.java/openjdk13
59+
- shell: |
60+
#!/usr/local/bin/runbld --redirect-stderr --last-good-commit elastic+elasticsearch+%BRANCH%+git+push
61+
.ci/build.sh check
62+
publishers:
63+
- email:
64+
recipients: [email protected]
65+
# Upload additional logs
66+
- google-cloud-storage:
67+
credentials-id: 'elasticsearch-ci-gcs-plugin'
68+
uploads:
69+
- classic:
70+
file-pattern: 'build/*.tar.bz2'
71+
storage-location: 'gs://elasticsearch-ci-artifacts/jobs/$JOB_NAME'
72+
share-publicly: false
73+
upload-for-failed-jobs: true
74+
show-inline: true
75+
# Notify homer
76+
- postbuildscript:
77+
builders:
78+
- role: SLAVE
79+
build-on:
80+
- SUCCESS
81+
- FAILURE
82+
- UNSTABLE
83+
build-steps:
84+
- shell: |
85+
curl -sS -X POST \
86+
-H "Content-Type: text/plain" \
87+
--data "$BUILD_URL" \
88+
"https://homer.app.elstc.co/webhook/jenkins/build-finished" || true
89+
90+
91+
92+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- job:
2+
name: elastic+elasticsearch+%BRANCH%+periodic-next
3+
workspace: /dev/shm/elastic+elasticsearch+%BRANCH%+periodic
4+
display-name: "elastic / elasticsearch # %BRANCH% - periodic (experimental)"
5+
description: "Periodic testing of the Elasticsearch %BRANCH% branch.\n"
6+
triggers:
7+
- timed: "H H/1 * * *"
8+
builders:
9+
- shell: |
10+
#!/usr/local/bin/runbld --redirect-stderr --last-good-commit elastic+elasticsearch+%BRANCH%+git+push
11+
.ci/build.sh -Dbwc.checkout.align=true check

.ci/make-branch-config.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
if [ -z "$BRANCH" ] ; then
4+
echo "BRANCH is unset"
5+
exit 1
6+
fi
7+
8+
rm -Rf .ci/jobs
9+
cp -r .ci/jobs.t .ci/jobs
10+
11+
sed -i "s/%BRANCH%/${BRANCH}/g" .ci/jobs/*.yml

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ eclipse-build
4444

4545
# projects using testfixtures
4646
testfixtures_shared/
47+
48+
# These are generated from .ci/jobs.t
49+
.ci/jobs/

0 commit comments

Comments
 (0)