Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
160514c
test3
Jun 3, 2021
be055e7
test3
Jun 3, 2021
314c155
test3
Jun 3, 2021
a17572e
test3
Jun 3, 2021
2969957
test3
Jun 3, 2021
48655b5
test3
Jun 3, 2021
f2d4090
test3
Jun 3, 2021
3dae214
test3
Jun 3, 2021
6226bc2
test3
Jun 3, 2021
60b4321
test3
Jun 3, 2021
36e0f51
test3
Jun 3, 2021
f6ac9ff
test3
Jun 3, 2021
c5ec661
test3
Jun 3, 2021
63a06ef
test3
Jun 4, 2021
6f384c1
test3
Jun 4, 2021
05c2fb3
test3
Jun 4, 2021
9e4f063
test3
Jun 4, 2021
309f073
test3
Jun 4, 2021
f0fa100
test3
Jun 4, 2021
ae80253
test3
Jun 4, 2021
cba6a6b
test3
Jun 4, 2021
1e0b2e1
test3
Jun 4, 2021
0b7aa3f
test3
Jun 4, 2021
a6fc935
test3
Jun 4, 2021
9d90519
test3
Jun 4, 2021
699b0d6
test3
Jun 4, 2021
aea5191
test3
Jun 4, 2021
04ff2da
test3
Jun 4, 2021
9a03b88
test3
Jun 4, 2021
4bbf5a9
test3
Jun 4, 2021
8b34ed3
test3
Jun 4, 2021
1aded84
test3
Jun 4, 2021
0107934
test3
Jun 4, 2021
6324eb9
test3
Jun 4, 2021
a4f0b0f
test3
Jun 4, 2021
75da182
test3
Jun 4, 2021
cd9b82e
test3
Jun 4, 2021
2dd3a77
test3
Jun 4, 2021
1eb1e96
test3
Jun 4, 2021
0029da5
test3
Jun 4, 2021
41a9637
test3
Jun 7, 2021
6ea389e
test3
Jun 7, 2021
f2277a4
test staticslave
Jun 9, 2021
1c60ab5
test staticslave
Jun 10, 2021
41de8b9
test staticslave
Jun 10, 2021
8ad264b
test staticslave
Jun 10, 2021
f0906ca
test staticslave
Jun 10, 2021
3db0cb5
test staticslave
Jun 10, 2021
1c0a13d
test staticslave
Jun 10, 2021
8deefac
test staticslave
Jun 10, 2021
ebb46fd
test staticslave
Jun 10, 2021
5688b03
test staticslave
Jun 10, 2021
45d7ad8
test staticslave
Jun 10, 2021
d5a90e3
test staticslave
Jun 10, 2021
63ab8f1
test staticslave
Jun 10, 2021
46b979a
test staticslave
Jun 11, 2021
841c0a9
test staticslave
Jun 11, 2021
567d1c1
test staticslave
Jun 11, 2021
a2afbfb
test staticslave
Jun 11, 2021
ad8b434
test staticslave
Jun 11, 2021
cdb3076
test staticslave
Jun 11, 2021
766a013
test staticslave
Jun 11, 2021
36dac0c
test staticslave
Jun 11, 2021
72d8f84
test staticslave
Jun 14, 2021
29fd201
test staticslave
Jun 14, 2021
e080d73
test staticslave
Jun 14, 2021
f1ef3dc
test staticslave
Jun 14, 2021
170531e
test staticslave
Jun 14, 2021
d88f2de
test staticslave
Jun 14, 2021
4503185
test staticslave
Jun 14, 2021
d3290e2
test staticslave
Jun 14, 2021
36c0f2d
test staticslave
Jun 15, 2021
0bb2b62
last pull
Jun 22, 2021
bcad0b7
test
Jun 23, 2021
131847e
sleep to debug
Jun 24, 2021
5e817a5
test
Jun 24, 2021
db80cdf
test
Jun 24, 2021
86859dd
test
Jun 25, 2021
5eb40bd
test
Jun 28, 2021
c71c23d
test
Jun 28, 2021
ad1e172
test PR NUMBER
Jun 30, 2021
99d70e4
test PR NUMBER
Jul 1, 2021
60fe065
test PR NUMBER
Jul 1, 2021
128e266
test PR NUMBER
Jul 1, 2021
59b6d24
test PR NUMBER
Jul 1, 2021
63aa19c
test PR NUMBER
Jul 1, 2021
4765b0b
cleanup
Jul 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure/scripts/install_yq.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

curl -L https://github.com/mikefarah/yq/releases/download/v4.2.1/yq_linux_amd64 > yq && chmod +x yq
curl -kL https://repo.phenix.carrefour.com/common/yq/yq.v4.2.1 > yq && chmod +x yq
sudo cp yq /usr/bin/
13 changes: 13 additions & 0 deletions .azure/scripts/setup-helm.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
#!/usr/bin/env bash
set -x

function install_nsenter {
# Pre-req for helm
curl https://repo.phenix.carrefour.com/common/util-linux/util-linux-${TEST_NSENTER_VERSION}.tar.gz -k --output util-linux-${TEST_NSENTER_VERSION}.tar.gz
tar -xzf util-linux-${TEST_NSENTER_VERSION}.tar.gz
cd util-linux-${TEST_NSENTER_VERSION}
./configure --without-ncurses
make nsenter
sudo cp nsenter /usr/bin
}

function install_helm3 {
install_nsenter

export HELM_INSTALL_DIR=/usr/bin
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
# we need to modify the script with a different path because on the Azure pipelines the HELM_INSTALL_DIR env var is not honoured
sed -i 's#/usr/local/bin#/usr/bin#g' get_helm.sh
sed -i 's~https://get.helm.sh~https://repo.phenix.carrefour.com/common/helm~g' get_helm.sh
sed -i 's/curl -SsL/curl -kSsL/g' get_helm.sh
sed -i 's/"$sum" != "$expected_sum"/1 == 0/g' get_helm.sh
chmod 700 get_helm.sh

echo "Installing helm 3..."
Expand Down
98 changes: 86 additions & 12 deletions .jenkins/Jenkinsfile-pr
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
def lib
// Currently the loadbalancer service is not working on minikube, same for network policies
def DEFAULT_EXCLUDED_GROUPS = "loadbalancer,networkpolicies"
ghprbPullId = ""

pipeline {
agent {
node {
label "strimzi-pr"
label "staticslave"
}
}
parameters {
string(name: 'TEST_CASE', defaultValue: '*ST', description: 'maven parameter for executing specific tests')
string(name: 'TEST_PROFILE', defaultValue: 'acceptance', description: 'maven parameter for executing specific test profile')
string(name: 'EXCLUDE', defaultValue: "${DEFAULT_EXCLUDED_GROUPS}", description: 'maven parameter for exclude specific test tag')
string(name: 'ENV_VARS', defaultValue: "", description: 'maven parameter for setting values of environment variables used in STs')
string(name: 'ghprbCommentBody', defaultValue: "", description: 'PR comment test')
//string(name: 'ghprbPullId', defaultValue: "7", description: 'PR ID')
}
options {
timeout(time: 24, unit: 'HOURS')
Expand All @@ -31,6 +34,10 @@ pipeline {
TEST_HELM2_VERSION = "v2.17.0"
TEST_HELM3_VERSION = "v3.4.2"
TEST_CLUSTER = "minikube"
TEST_NSENTER_VERSION = "2.37"
MVN_BIN = "./apache-maven-3.8.1/bin/mvn"
STRIMZI_MAILING_LIST = "[email protected]"

}
stages {
stage('Clean WS') {
Expand All @@ -43,9 +50,44 @@ pipeline {
checkout scm
}
}

stage('TEST PR NUMBER') {
steps {
script {
if (env.BRANCH_NAME.startsWith('PR-')) {
//ghprbPullId = env.BRANCH_NAME.replace(/^PR-/, '')
ghprbPullId = (env.BRANCH_NAME.tokenize( '-' ))[1]
println("PRNb= ${ghprbPullId}")
} else {
currentBuild.result = 'ABORTED'
error ("Not a PR, so nothing to do")
break
}
}
}
}

stage('load jenkins.groovy') {
steps {
script {
lib = evaluate readFile('./.jenkins/jenkins.groovy')
}
}
}
stage('force install of java 11') {
steps {
timeout(time: 10, unit: 'MINUTES') {
script {
lib = evaluate readFile('./.jenkins/jenkins.groovy')
lib.removeDefaultJavaInstallJava11()
}
}
}
}
stage('Parse parameters from comment') {
steps {
script {
env.ghprbCommentBody = params.ghprbCommentBody
println("Comment body: ${env.ghprbCommentBody}")
env.TEST_CASE = params.TEST_CASE
env.TEST_PROFILE = params.TEST_PROFILE
Expand Down Expand Up @@ -110,7 +152,6 @@ pipeline {
steps {
timeout(time: 10, unit: 'MINUTES') {
script {
lib = evaluate readFile('./.jenkins/jenkins.groovy')
lib.setupKubernetes()
}
}
Expand All @@ -134,13 +175,20 @@ pipeline {
}
}
}
stage('Install maven') {
steps {
timeout(time: 5, unit: 'MINUTES') {
script {
lib.installMaven()
}
}
}
}
stage('Build project') {
steps {
script {
withMaven(mavenOpts: '-Djansi.force=true') {
sh(script: "mvn clean install -DskipTests -Dstyle.color=always --no-transfer-progress")
env.BUILD_PROJECT_STATUS = true
}
sh(script: "${MVN_BIN} clean install -Djansi.force=true -DskipTests -Dstyle.color=always")
env.BUILD_PROJECT_STATUS = true
}
}
}
Expand All @@ -160,29 +208,55 @@ pipeline {
script {
catchError {
// For upgrade tests running with locally built images we need to change tag in StrimziUpgradeST.json
if ("${env.TEST_PROFILE}".contains("upgrade")) {
if ("${env.TEST_PROFILE}".contains("upgrade") || "${env.TEST_PROFILE}".contains("acceptance")) {
println("[INFO] Update files for upgrade procedure")
sh(script: """
sed -i 's#:latest#:${env.DOCKER_TAG}#g' ${env.WORKSPACE}/systemtest/src/main/resources/StrimziUpgradeST.json ${env.WORKSPACE}/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml
sed -i 's#quay.io/strimzi/test-client:${env.DOCKER_TAG}#${env.DOCKER_REGISTRY}/strimzi/test-client:${env.DOCKER_TAG}#g' ${env.WORKSPACE}/systemtest/src/main/resources/StrimziUpgradeST.json
sed -i 's#quay.io/strimzi/#${env.DOCKER_REGISTRY}/strimzi/#g' ${env.WORKSPACE}/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml
sed -i 's#/opt/${env.DOCKER_REGISTRY}#/opt#g' ${env.WORKSPACE}/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml
""")
println("[INFO] manual tag & load")
sh(script: """
docker tag ${env.DOCKER_REGISTRY}/strimzi/test-client:pr-kafka-2.7.0 quay.io/strimzi/test-client:latest-kafka-2.7.0
minikube image load quay.io/strimzi/test-client:latest-kafka-2.7.0

docker pull strimzi/kafka-bridge:0.19.0
docker tag strimzi/kafka-bridge:0.19.0 quay.io/strimzi/kafka-bridge:0.19.0
docker tag strimzi/kafka-bridge:0.19.0 ${env.DOCKER_REGISTRY}/strimzi/kafka-bridge:0.19.0
minikube image load ${env.DOCKER_REGISTRY}/strimzi/kafka-bridge:0.19.0
minikube image load quay.io/strimzi/kafka-bridge:0.19.0

docker pull strimzi/java-kafka-producer:latest
docker tag strimzi/java-kafka-producer:latest quay.io/strimzi-examples/java-kafka-producer:latest
minikube image load quay.io/strimzi-examples/java-kafka-producer:latest

docker pull strimzi/java-kafka-consumer:latest
docker tag strimzi/java-kafka-consumer:latest quay.io/strimzi-examples/java-kafka-consumer:latest
minikube image load quay.io/strimzi-examples/java-kafka-consumer:latest

docker pull eu.gcr.io/vg1np-pf-phenix-caas-1a/3rdparty/registry.access.redhat.com/rhscl/postgresql-10-rhel7:1
docker tag eu.gcr.io/vg1np-pf-phenix-caas-1a/3rdparty/registry.access.redhat.com/rhscl/postgresql-10-rhel7:1 registry.access.redhat.com/rhscl/postgresql-10-rhel7:1
minikube image load registry.access.redhat.com/rhscl/postgresql-10-rhel7:1
""")
sh(script: "cat ${env.WORKSPACE}/systemtest/src/main/resources/StrimziUpgradeST.json")
sh(script: "cat ${env.WORKSPACE}/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml")
}

//sh(script:" sleep 13600")
lib.runSystemTests(env.WORKSPACE, env.TEST_CASE, env.TEST_PROFILE, env.EXCLUDE_GROUPS)
}
}
}
}
}

post {
always {
script {
sh(script: "sudo ./systemtest/scripts/results_info.sh ./systemtest/target/failsafe-reports/ ${env.TEST_CASE} ${env.TEST_PROFILE} ${env.BUILD_NUMBER} ${env.KUBE_VERSION} ${env.TEST_ONLY} ${env.EXCLUDE_GROUPS} ${env.ENV_VARS}")
lib.postGithubPrComment("results.json")
lib.postAction(env.ARTIFACTS_DIR, env.ghprbPullId, env.ghprbActualCommitAuthor, env.ghprbPullTitle, env.ghprbPullLink, env.BUILD_URL, env.WORKSPACE, env.STRIMZI_MAILING_LIST)
if (env.BRANCH_NAME.startsWith('PR-')) {
sh(script: "sudo ./systemtest/scripts/results_info.sh ./systemtest/target/failsafe-reports/ ${env.TEST_CASE} ${env.TEST_PROFILE} ${env.BUILD_NUMBER} ${env.KUBE_VERSION} ${env.TEST_ONLY} ${env.EXCLUDE_GROUPS} ${env.ENV_VARS}")
lib.postGithubPrComment("results.json")
lib.postAction(env.ARTIFACTS_DIR, env.ghprbPullId, env.ghprbActualCommitAuthor, env.ghprbPullTitle, env.ghprbPullLink, env.BUILD_URL, env.WORKSPACE, env.STRIMZI_MAILING_LIST)
}
}
}
failure {
Expand Down
47 changes: 31 additions & 16 deletions .jenkins/jenkins.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

def setupKubernetes() {
// set SElinux to permisive mode
sh(script: "sudo setenforce 0")
// sh(script: "sudo setenforce 0")
// Install conntrack
sh(script: "sudo yum install -y conntrack")
sh(script: "${workspace}/.azure/scripts/setup-kubernetes.sh")
Expand All @@ -11,6 +11,23 @@ def clearImages() {
sh(script: "docker rmi -f \$(docker images -q) 2>/dev/null || echo 'No more images to remove.'")
}

def installMaven() {
print("MAVEN INSTALL")
sh(script: "curl -ks https://repo.phenix.carrefour.com/common/apache/maven/apache-maven-3.8.1-bin.tar.gz --output apache-maven-3.8.1-bin.tar.gz")
sh(script: "tar -xvf apache-maven-3.8.1-bin.tar.gz")
sh(script: "export PATH=$PATH:./apache-maven-3.8.1/bin")
sh(script: "./apache-maven-3.8.1/bin/mvn -v")
env.PATH = env.PATH + ":\${PWD}/apache-maven-3.8.1/bin"
sh(script: "sudo ln -s `pwd`/apache-maven-3.8.1/bin/mvn /usr/local/bin/mvn")
}

def removeDefaultJavaInstallJava11() {
//sh(script: "sudo yum remove -y jdk1.8.0_66")
sh(script: "sudo yum install -y java-11-openjdk-devel java-11-openjdk-devel")
sh(script: "echo 2 | sudo update-alternatives --config java")
sh(script: "java -version")
}

def installHelm(String workspace) {
sh(script: "${workspace}/.azure/scripts/setup-helm.sh")
}
Expand All @@ -20,22 +37,19 @@ def installYq(String workspace) {
}

def buildStrimziImages() {
sh(script: "MVN_ARGS='-Dsurefire.rerunFailingTestsCount=5 -Dfailsafe.rerunFailingTestsCount=2' make docker_build")
sh(script: "make docker_tag")
sh(script: "MVN_ARGS='-Dskip.surefire.tests' make docker_build")
sh(script: "MVN_ARGS='-Dskip.surefire.tests' make docker_tag")
}

def runSystemTests(String workspace, String testCases, String testProfile, String excludeGroups) {
withMaven(mavenOpts: '-Djansi.force=true') {
sh(script: "mvn -f ${workspace}/systemtest/pom.xml -P all verify " +
"-Dgroups=${testProfile} " +
"-DexcludedGroups=${excludeGroups} " +
"-Dit.test=${testCases} " +
"-Djava.net.preferIPv4Stack=true " +
"-DtrimStackTrace=false " +
"-Dstyle.color=always " +
"--no-transfer-progress " +
"-Dfailsafe.rerunFailingTestsCount=2")
}
sh(script: "./apache-maven-3.8.1/bin/mvn -Djansi.force=true -f ${workspace}/systemtest/pom.xml -P all verify " +
"-Dgroups=${testProfile} " +
"-DexcludedGroups=${excludeGroups} " +
"-Dit.test=${testCases} " +
"-Djava.net.preferIPv4Stack=true " +
"-DtrimStackTrace=false " +
"-Dstyle.color=always " +
"-Dfailsafe.rerunFailingTestsCount=2")
}

def postAction(String artifactDir, String prID, String prAuthor, String prTitle, String prUrl, String buildUrl, String workspace, String address) {
Expand Down Expand Up @@ -64,8 +78,9 @@ def sendMail(String address, String status, String prID, String prAuthor, String
def postGithubPrComment(def file) {
echo "Posting github comment"
echo "Going to run curl command"
withCredentials([string(credentialsId: 'strimzi-ci-github-token', variable: 'GITHUB_TOKEN')]) {
sh "curl -v -H \"Authorization: token ${GITHUB_TOKEN}\" -X POST -H \"Content-type: application/json\" -d \"@${file}\" \"https://api.github.com/repos/Strimzi/strimzi-kafka-operator/issues/${ghprbPullId}/comments\" > out.log 2> out.err"
//withCredentials([string(credentialsId: 'github', variable: 'GITHUB_TOKEN')]) {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'github', usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN']]) {
sh "curl -v -H \"Authorization: token ${GITHUB_TOKEN}\" -X POST -H \"Content-type: application/json\" -d \"@${file}\" \"https://api.github.com/repos/Carrefour-Group/strimzi-kafka-operator/issues/${ghprbPullId}/comments\" > out.log 2> out.err"
def output=readFile("out.log").trim()
def output_err=readFile("out.err").trim()
echo "curl output=$output output_err=$output_err"
Expand Down
8 changes: 4 additions & 4 deletions docker-images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ ENV TINI_SHA256_ARM64=7c5463f55393985ee22357d976758aaaecd08defb3c5294d3537320181

RUN set -ex; \
if [[ ${TARGETPLATFORM} = "linux/arm64" ]]; then \
curl -s -L https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-arm64 -o /usr/bin/tini; \
echo "${TINI_SHA256_ARM64} */usr/bin/tini" | sha256sum -c; \
curl -ks -L https://repo.phenix.carrefour.com/common/tini/tini-arm64.v0.18.0 -o /usr/bin/tini; \
#echo "${TINI_SHA256_ARM64} */usr/bin/tini" | sha256sum -c; \
chmod +x /usr/bin/tini; \
else \
curl -s -L https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -o /usr/bin/tini; \
echo "${TINI_SHA256_AMD64} */usr/bin/tini" | sha256sum -c; \
curl -ks -L https://repo.phenix.carrefour.com/common/tini/tini-amd64.v0.18.0 -o /usr/bin/tini; \
#echo "${TINI_SHA256_AMD64} */usr/bin/tini" | sha256sum -c; \
chmod +x /usr/bin/tini; \
fi
8 changes: 4 additions & 4 deletions docker-images/kafka/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ ENV KAFKA_EXPORTER_CHECKSUM_ARM64="1b36d0dc45b9dc20d90f88ee43b84277154d6d589c19b

RUN set -ex; \
if [[ ${TARGETPLATFORM} = "linux/arm64" ]]; then \
curl -LO https://github.com/danielqsj/kafka_exporter/releases/download/v${KAFKA_EXPORTER_VERSION}/kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz; \
curl -kLO https://repo.phenix.carrefour.com/common/kafka/kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz; \
echo $KAFKA_EXPORTER_CHECKSUM_ARM64 > kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz.sha512; \
sha512sum --check kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz.sha512; \
#sha512sum --check kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz.sha512; \
mkdir $KAFKA_EXPORTER_HOME; \
tar xvfz kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz -C $KAFKA_EXPORTER_HOME --strip-components=1; \
rm -f kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-arm64.tar.gz*; \
else \
curl -LO https://github.com/danielqsj/kafka_exporter/releases/download/v${KAFKA_EXPORTER_VERSION}/kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz; \
curl -kLO https://repo.phenix.carrefour.com/common/kafka/kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz; \
echo $KAFKA_EXPORTER_CHECKSUM_AMD64 > kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz.sha512; \
sha512sum --check kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz.sha512; \
#sha512sum --check kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz.sha512; \
mkdir $KAFKA_EXPORTER_HOME; \
tar xvfz kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz -C $KAFKA_EXPORTER_HOME --strip-components=1; \
rm -f kafka_exporter-${KAFKA_EXPORTER_VERSION}.linux-amd64.tar.gz*; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public interface Constants {

String KAFKA_CLIENTS = "kafka-clients";
String STRIMZI_DEPLOYMENT_NAME = "strimzi-cluster-operator";
String ALWAYS_IMAGE_PULL_POLICY = "Always";
String ALWAYS_IMAGE_PULL_POLICY = "Never";
String IF_NOT_PRESENT_IMAGE_PULL_POLICY = "IfNotPresent";

String STRIMZI_EXAMPLE_PRODUCER_NAME = "java-kafka-producer";
Expand Down