Skip to content

Commit

Permalink
Merge branch 'master' into poc/ES-1970-agent-with-OPA
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalkraft committed Nov 4, 2021
2 parents 5536d6f + 0e2b165 commit e00333d
Show file tree
Hide file tree
Showing 4,149 changed files with 252,194 additions and 289,199 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 0 additions & 7 deletions .backportrc.json

This file was deleted.

27 changes: 27 additions & 0 deletions .ci/jobs/beats-schedule-daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
- job:
name: beats-schedule-daily
display-name: Jobs scheduled daily (weekdays)
description: Jobs scheduled daily (weekdays)
view: Beats
project-type: pipeline
parameters:
- string:
name: branch_specifier
default: master
description: the Git branch specifier to build
pipeline-scm:
script-path: .ci/schedule-daily.groovy
scm:
- git:
url: git@github.com:elastic/beats.git
refspec: +refs/heads/*:refs/remotes/origin/*
wipe-workspace: 'True'
name: origin
shallow-clone: true
credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba
reference-repo: /var/lib/jenkins/.git-references/beats.git
branches:
- $branch_specifier
triggers:
- timed: 'H H(2-3) * * 1-5'
2 changes: 1 addition & 1 deletion .ci/jobs/beats-schedule-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
branches:
- $branch_specifier
triggers:
- timed: 'H H(1-4) * * 0'
- timed: 'H H(1-2) * * 0'
43 changes: 0 additions & 43 deletions .ci/jobs/golang-crossbuild-mbp.yml

This file was deleted.

51 changes: 17 additions & 34 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ pipeline {
agent { label 'ubuntu-18 && immutable' }
options { skipDefaultCheckout() }
steps {
runE2ETests()
log(level: 'WARN', text: "E2E Tests for Beats are disabled until latest breaking changes in Kibana affecting Package Registry are resolved.")
//runE2ETests()
}
}
}
Expand Down Expand Up @@ -321,26 +322,31 @@ def tagAndPush(Map args = [:]) {
}
// supported image flavours
def variants = ["", "-oss", "-ubi8"]
//

if(beatName == 'elastic-agent'){
variants.add("-complete")
variants.add("-cloud")
}

variants.each { variant ->
// cloud docker images are stored in the private docker namespace.
def sourceNamespace = variant.equals('-cloud') ? 'beats-ci' : 'beats'
tags.each { tag ->
// TODO:
// For backward compatibility let's ensure we tag only for amd64, then E2E can benefit from until
// they support the versioning with the architecture
if ("${arch}" == "amd64") {
doTagAndPush(beatName: beatName, variant: variant, sourceTag: libbetaVer, targetTag: "${tag}")
doTagAndPush(beatName: beatName, variant: variant, sourceTag: libbetaVer, targetTag: "${tag}", sourceNamespace: sourceNamespace)
}
doTagAndPush(beatName: beatName, variant: variant, sourceTag: libbetaVer, targetTag: "${tag}-${arch}")
doTagAndPush(beatName: beatName, variant: variant, sourceTag: libbetaVer, targetTag: "${tag}-${arch}", sourceNamespace: sourceNamespace)
}
}
}

/**
* @param beatName name of the Beat
* @param variant name of the variant used to build the docker image name
* @param sourceNamespace namespace to be used as source for the docker tag command
* @param sourceTag tag to be used as source for the docker tag command, usually under the 'beats' namespace
* @param targetTag tag to be used as target for the docker tag command, usually under the 'observability-ci' namespace
*/
Expand All @@ -349,7 +355,8 @@ def doTagAndPush(Map args = [:]) {
def variant = args.variant
def sourceTag = args.sourceTag
def targetTag = args.targetTag
def sourceName = "${DOCKER_REGISTRY}/beats/${beatName}${variant}:${sourceTag}"
def sourceNamespace = args.sourceNamespace
def sourceName = "${DOCKER_REGISTRY}/${sourceNamespace}/${beatName}${variant}:${sourceTag}"
def targetName = "${DOCKER_REGISTRY}/observability-ci/${beatName}${variant}:${targetTag}"
def iterations = 0
retryWithSleep(retries: 3, seconds: 5, backoff: true) {
Expand Down Expand Up @@ -410,38 +417,14 @@ def runE2ETests(){
};
}

triggerE2ETests(suites)
runE2E(runTestsSuites: suites,
beatVersion: "${env.BEAT_VERSION}-SNAPSHOT",
gitHubCheckName: env.GITHUB_CHECK_E2E_TESTS_NAME,
gitHubCheckRepo: env.REPO,
gitHubCheckSha1: env.GIT_BASE_COMMIT)
}
}

def triggerE2ETests(String suite) {
echo("Triggering E2E tests for PR-${env.CHANGE_ID}. Test suites: ${suite}.")

def branchName = isPR() ? "${env.CHANGE_TARGET}" : "${env.JOB_BASE_NAME}"
def e2eTestsPipeline = "e2e-tests/e2e-testing-mbp/${branchName}"
def beatVersion = "${env.BEAT_VERSION}-SNAPSHOT"

def parameters = [
booleanParam(name: 'forceSkipGitChecks', value: true),
booleanParam(name: 'forceSkipPresubmit', value: true),
booleanParam(name: 'notifyOnGreenBuilds', value: !isPR()),
string(name: 'BEAT_VERSION', value: beatVersion),
string(name: 'runTestsSuites', value: suite),
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_E2E_TESTS_NAME),
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT),
]

build(job: "${e2eTestsPipeline}",
parameters: parameters,
propagate: false,
wait: false
)

def notifyContext = "${env.GITHUB_CHECK_E2E_TESTS_NAME}"
githubNotify(context: "${notifyContext}", description: "${notifyContext} ...", status: 'PENDING', targetUrl: "${env.JENKINS_URL}search/?q=${e2eTestsPipeline.replaceAll('/','+')}")
}

def withMacOSEnv(Closure body){
withEnvMask( vars: [
[var: "KEYCHAIN_PASS", password: getVaultSecret(secret: "secret/jenkins-ci/macos-codesign-keychain").data.password],
Expand Down
39 changes: 39 additions & 0 deletions .ci/schedule-daily.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@Library('apm@current') _

pipeline {
agent none
environment {
NOTIFY_TO = credentials('notify-to')
PIPELINE_LOG_LEVEL = 'INFO'
}
options {
timeout(time: 1, unit: 'HOURS')
buildDiscarder(logRotator(numToKeepStr: '20', artifactNumToKeepStr: '20'))
timestamps()
ansiColor('xterm')
disableResume()
durabilityHint('PERFORMANCE_OPTIMIZED')
}
triggers {
cron('H H(2-3) * * 1-5')
}
stages {
stage('Nighly beats builds') {
steps {
runBuild(quietPeriod: 0, job: 'Beats/beats/master')
runBuild(quietPeriod: 2000, job: 'Beats/beats/7.16')
runBuild(quietPeriod: 4000, job: 'Beats/beats/7.15')
}
}
}
post {
cleanup {
notifyBuildResult(prComment: false)
}
}
}

def runBuild(Map args = [:]) {
def jobName = args.job
build(quietPeriod: args.quietPeriod, job: jobName, parameters: [booleanParam(name: 'macosTest', value: true)], wait: false, propagate: false)
}
14 changes: 10 additions & 4 deletions .ci/schedule-weekly.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ pipeline {
durabilityHint('PERFORMANCE_OPTIMIZED')
}
triggers {
cron('H H(1-4) * * 0')
cron('H H(1-2) * * 0')
}
stages {
stage('Nighly beats builds') {
stage('Weekly beats builds') {
steps {
build(quietPeriod: 0, job: 'Beats/beats/master', parameters: [booleanParam(name: 'awsCloudTests', value: true)], wait: false, propagate: false)
build(quietPeriod: 1000, job: 'Beats/beats/7.x', parameters: [booleanParam(name: 'awsCloudTests', value: true)], wait: false, propagate: false)
runBuild(quietPeriod: 0, job: 'Beats/beats/master')
runBuild(quietPeriod: 1000, job: 'Beats/beats/7.16')
runBuild(quietPeriod: 2000, job: 'Beats/beats/7.15')
}
}
}
Expand All @@ -31,3 +32,8 @@ pipeline {
}
}
}

def runBuild(Map args = [:]) {
def jobName = args.job
build(quietPeriod: args.quietPeriod, job: jobName, parameters: [booleanParam(name: 'awsCloudTests', value: true)], wait: false, propagate: false)
}
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
# Winlogbeat
/x-pack/winlogbeat/ @elastic/security-external-integrations

# Beats Build Specific
/dev-tools/mage/ @elastic/beats
/dev-tools/make/ @elastic/beats
/dev-tools/packaging/ @elastic/beats

# CI Specific
/.ci/ @elastic/observablt-robots
/Jenkinsfile @elastic/observablt-robots
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.6
1.17.2
43 changes: 29 additions & 14 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pull_request_rules:
- name: forward-port patches to master branch
conditions:
- merged
- label=backport-v8.0.0
- label=backport-v8.1.0
actions:
backport:
assignees:
Expand All @@ -26,9 +26,9 @@ pull_request_rules:
git merge upstream/{{base}}
git push upstream {{head}}
```
- name: automatic approval for mergify pull requests with bump updates
- name: automatic approval for automated pull requests with bump updates
conditions:
- author=mergify[bot]
- author=apmmachine
- check-success=beats-ci/pr-merge
- label=automation
- files~=^testing/environments/snapshot.*\.yml$
Expand All @@ -41,10 +41,11 @@ pull_request_rules:
- check-success=beats-ci/pr-merge
- label=automation
- files~=^testing/environments/snapshot.*\.yml$
- "#approved-reviews-by>=1"
actions:
merge:
method: squash
strict: smart+fasttrack
strict: false
- name: delete upstream branch after merging changes on testing/environments/snapshot* or it's closed
conditions:
- or:
Expand Down Expand Up @@ -84,10 +85,11 @@ pull_request_rules:
- label=automation
- files~=^\.mergify\.yml$
- head~=^add-backport-next.*
- "#approved-reviews-by>=1"
actions:
merge:
method: squash
strict: smart+fasttrack
strict: false
- name: delete upstream branch with changes on ^.mergify.yml that has been merged or closed
conditions:
- or:
Expand Down Expand Up @@ -122,42 +124,55 @@ pull_request_rules:
label:
remove:
- backport-skip
- name: backport patches to 7.x branch
- name: backport patches to 7.14 branch
conditions:
- merged
- label=backport-v7.16.0
- label=backport-v7.14.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.x"
- "7.14"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.14 branch
- name: backport patches to 7.15 branch
conditions:
- merged
- label=backport-v7.14.0
- label=backport-v7.15.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.14"
- "7.15"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 7.15 branch
- name: backport patches to 7.16 branch
conditions:
- merged
- label=backport-v7.15.0
- label=backport-v7.16.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "7.15"
- "7.16"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
- name: backport patches to 8.0 branch
conditions:
- merged
- label=backport-v8.0.0
actions:
backport:
assignees:
- "{{ author }}"
branches:
- "8.0"
labels:
- "backport"
title: "[{{ destination_branch }}](backport #{{ number }}) {{ title }}"
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-merge-conflict

- repo: https://github.com/elastic/apm-pipeline-library.git
rev: current
hooks:
- id: check-jenkins-pipelines
files: ^(.ci/(.*\.groovy|Jenkinsfile)|Jenkinsfile)$
- id: check-jjbb
Loading

0 comments on commit e00333d

Please sign in to comment.