Skip to content

Commit

Permalink
Merge branch 'master' into has-root
Browse files Browse the repository at this point in the history
  • Loading branch information
narph authored Feb 23, 2021
2 parents 62e4317 + 9e6b676 commit 87e5a50
Show file tree
Hide file tree
Showing 899 changed files with 90,584 additions and 20,430 deletions.
2 changes: 1 addition & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"upstream": "elastic/beats",
"branches": [ { "name": "7.x", "checked": true }, "7.11", "7.10" ],
"branches": [ { "name": "7.x", "checked": true }, "7.12", "7.11" ],
"labels": ["backport"],
"autoAssign": true,
"prTitle": "Cherry-pick to {targetBranch}: {commitMessages}"
Expand Down
4 changes: 2 additions & 2 deletions .ci/apm-beats-update.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ pipeline {
branch "v\\d?"
tag "v\\d+\\.\\d+\\.\\d+*"
allOf {
expression { return env.BEATS_UPDATED != "false" || isCommentTrigger() }
expression { return env.BEATS_UPDATED != "false" || isCommentTrigger() || isUserTrigger() }
changeRequest()
}

}
}
steps {
Expand Down Expand Up @@ -127,6 +126,7 @@ def beatsUpdate() {
git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
go mod edit -replace github.com/elastic/beats/v7=\${GOPATH}/src/github.com/elastic/beats-local
echo '{"name": "${GOPATH}/src/github.com/elastic/beats-local", "licenceType": "Elastic"}' >> \${GOPATH}/src/github.com/elastic/beats-local/dev-tools/notice/overrides.json
make update
git commit -a -m beats-update
Expand Down
86 changes: 54 additions & 32 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pipeline {
JOB_GCS_BUCKET = 'beats-ci-artifacts'
JOB_GCS_BUCKET_STASH = 'beats-ci-temp'
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
JOB_GCS_EXT_CREDENTIALS = 'beats-ci-gcs-plugin-file-credentials'
DOCKERELASTIC_SECRET = 'secret/observability-team/ci/docker-registry/prod'
DOCKER_REGISTRY = 'docker.elastic.co'
GITHUB_CHECK_E2E_TESTS_NAME = 'E2E Tests'
Expand Down Expand Up @@ -151,7 +152,9 @@ pipeline {
withGithubNotify(context: "Packaging Linux ${BEATS_FOLDER}") {
deleteDir()
release()
pushCIDockerImages()
dir("${BASE_DIR}"){
pushCIDockerImages(arch: 'amd64')
}
}
prepareE2ETestForPackage("${BEATS_FOLDER}")
}
Expand Down Expand Up @@ -203,6 +206,7 @@ pipeline {
'metricbeat',
'packetbeat',
'x-pack/auditbeat',
'x-pack/dockerlogbeat',
'x-pack/elastic-agent',
'x-pack/filebeat',
'x-pack/heartbeat',
Expand Down Expand Up @@ -232,7 +236,9 @@ pipeline {
withGithubNotify(context: "Packaging linux/arm64 ${BEATS_FOLDER}") {
deleteWorkspace()
release()
pushCIDockerImages()
dir("${BASE_DIR}"){
pushCIDockerImages(arch: 'arm64')
}
}
}
post {
Expand Down Expand Up @@ -268,27 +274,37 @@ pipeline {
}
}

def pushCIDockerImages(){
/**
* @param arch what architecture
*/
def pushCIDockerImages(Map args = [:]) {
def arch = args.get('arch', 'amd64')
catchError(buildResult: 'UNSTABLE', message: 'Unable to push Docker images', stageResult: 'FAILURE') {
if (env?.BEATS_FOLDER?.endsWith('auditbeat')) {
tagAndPush('auditbeat')
tagAndPush(beatName: 'auditbeat', arch: arch)
} else if (env?.BEATS_FOLDER?.endsWith('filebeat')) {
tagAndPush('filebeat')
tagAndPush(beatName: 'filebeat', arch: arch)
} else if (env?.BEATS_FOLDER?.endsWith('heartbeat')) {
tagAndPush('heartbeat')
tagAndPush(beatName: 'heartbeat', arch: arch)
} else if ("${env.BEATS_FOLDER}" == "journalbeat"){
tagAndPush('journalbeat')
tagAndPush(beatName: 'journalbeat', arch: arch)
} else if (env?.BEATS_FOLDER?.endsWith('metricbeat')) {
tagAndPush('metricbeat')
tagAndPush(beatName: 'metricbeat', arch: arch)
} else if ("${env.BEATS_FOLDER}" == "packetbeat"){
tagAndPush('packetbeat')
tagAndPush(beatName: 'packetbeat', arch: arch)
} else if ("${env.BEATS_FOLDER}" == "x-pack/elastic-agent") {
tagAndPush('elastic-agent')
tagAndPush(beatName: 'elastic-agent', arch: arch)
}
}
}

def tagAndPush(beatName){
/**
* @param beatName name of the Beat
* @param arch what architecture
*/
def tagAndPush(Map args = [:]) {
def beatName = args.beatName
def arch = args.get('arch', 'amd64')
def libbetaVer = env.BEAT_VERSION
def aliasVersion = ""
if("${env.SNAPSHOT}" == "true"){
Expand All @@ -305,14 +321,22 @@ def tagAndPush(beatName){

dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")

// supported tags
def tags = [tagName, "${env.GIT_BASE_COMMIT}"]
if (!isPR() && aliasVersion != "") {
tags << aliasVersion
}
// supported image flavours
def variants = ["", "-oss", "-ubi8"]
variants.each { variant ->
doTagAndPush(beatName, variant, libbetaVer, tagName)
doTagAndPush(beatName, variant, libbetaVer, "${env.GIT_BASE_COMMIT}")

if (!isPR() && aliasVersion != "") {
doTagAndPush(beatName, variant, libbetaVer, aliasVersion)
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}-${arch}")
}
}
}
Expand All @@ -323,18 +347,19 @@ def tagAndPush(beatName){
* @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
*/
def doTagAndPush(beatName, variant, sourceTag, targetTag) {
def doTagAndPush(Map args = [:]) {
def beatName = args.beatName
def variant = args.variant
def sourceTag = args.sourceTag
def targetTag = args.targetTag
def sourceName = "${DOCKER_REGISTRY}/beats/${beatName}${variant}:${sourceTag}"
def targetName = "${DOCKER_REGISTRY}/observability-ci/${beatName}${variant}:${targetTag}"

def iterations = 0
retryWithSleep(retries: 3, seconds: 5, backoff: true) {
iterations++
def status = sh(label: "Change tag and push ${targetName}", script: """
docker tag ${sourceName} ${targetName}
docker push ${targetName}
""", returnStatus: true)

def status = sh(label: "Change tag and push ${targetName}",
script: ".ci/scripts/docker-tag-push.sh ${sourceName} ${targetName}",
returnStatus: true)
if ( status > 0 && iterations < 3) {
error("tag and push failed for ${beatName}, retry")
} else if ( status > 0 ) {
Expand Down Expand Up @@ -448,14 +473,11 @@ def publishPackages(baseDir){
uploadPackages("${bucketUri}/${beatsFolderName}", baseDir)
}

def uploadPackages(bucketUri, baseDir){
googleStorageUpload(bucket: bucketUri,
credentialsId: "${JOB_GCS_CREDENTIALS}",
pathPrefix: "${baseDir}/build/distributions/",
pattern: "${baseDir}/build/distributions/**/*",
sharedPublicly: true,
showInline: true
)
def uploadPackages(bucketUri, beatsFolder){
googleStorageUploadExt(bucket: bucketUri,
credentialsId: "${JOB_GCS_EXT_CREDENTIALS}",
pattern: "${beatsFolder}/build/distributions/**/*",
sharedPublicly: true)
}

/**
Expand Down Expand Up @@ -510,4 +532,4 @@ def fixPermissions() {
}
}
}
}
}
12 changes: 12 additions & 0 deletions .ci/scripts/docker-tag-push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -exuo pipefail
MSG="parameter missing."
SOURCE_IMAGE=${1:?$MSG}
TARGET_IMAGE=${2:?$MSG}

if docker image inspect "${SOURCE_IMAGE}" &> /dev/null ; then
docker tag "${SOURCE_IMAGE}" "${TARGET_IMAGE}"
docker push "${TARGET_IMAGE}"
else
echo "docker image ${SOURCE_IMAGE} does not exist"
fi
11 changes: 9 additions & 2 deletions .ci/scripts/install-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ DC_CMD="${HOME}/bin/docker-compose"

mkdir -p "${HOME}/bin"

curl -sSLo "${DC_CMD}" "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)"
chmod +x "${DC_CMD}"
if curl -sSLo "${DC_CMD}" "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" ; then
chmod +x "${DC_CMD}"
else
echo "Something bad with the download, let's delete the corrupted binary"
if [ -e "${DC_CMD}" ] ; then
rm "${DC_CMD}"
fi
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ coverage.out
.python-version
beat.db
*.keystore
go_env.properties
mage_output_file.go
x-pack/functionbeat/*/fields.yml
x-pack/functionbeat/provider/*/functionbeat-*
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.15.7
1.15.8
2 changes: 2 additions & 0 deletions CHANGELOG-developer.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ The list below covers the major changes between 7.0.0-rc2 and master only.
- Update Go version to 1.14.7. {pull}20508[20508]
- Add packaging for docker image based on UBI minimal 8. {pull}20576[20576]
- Make the mage binary used by the build process in the docker container to be statically compiled. {pull}20827[20827]
- Add Pensando distributed firewall module. {pull}21063[21063]
- Update ecszap to v0.3.0 for using ECS 1.6.0 in logs {pull}22267[22267]
- Add support for customized monitoring API. {pull}22605[22605]
- Update Go version to 1.15.7. {pull}22495[22495]
- Update Go version to 1.15.8. {pull}23955[23955]
15 changes: 15 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
:issue: https://github.com/elastic/beats/issues/
:pull: https://github.com/elastic/beats/pull/

[[release-notes-7.11.1]]
=== Beats version 7.11.1
https://github.com/elastic/beats/compare/v7.11.0...v7.11.1[View commits]

==== Bugfixes

*Filebeat*

- Fix goroutines leak with some inputs in autodiscover. {pull}23722[23722]
- Fix various processing errors in the Suricata module. {pull}23236[23236]

*Elastic Logging Plugin*

- Fix out of date CLI flags on docs. {pull}23628[23628]

[[release-notes-7.11.0]]
=== Beats version 7.11.0
https://github.com/elastic/beats/compare/v7.10.2...v7.11.0[View commits]
Expand Down
Loading

0 comments on commit 87e5a50

Please sign in to comment.