-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Jenkins scripts for running system tests on s390x nodes #6354
Add Jenkins scripts for running system tests on s390x nodes #6354
Conversation
Signed-off-by: Kun-Lu <[email protected]>
Can one of the admins verify this patch? |
Signed-off-by: Kun-Lu <[email protected]>
ae48d74
to
6ae06c5
Compare
Signed-off-by: Kun-Lu <[email protected]>
ec83560
to
e85a11c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more minor comments, but LGTM otherwise I guess. I have pretty much zero experience with Groovy or Jenkins. So I think the review from @Frawless ill be more important than mine.
.jenkins/Jenkinsfile-s390x
Outdated
OPERATOR_IMAGE_PULL_POLICY = "IfNotPresent" | ||
COMPONENTS_IMAGE_PULL_POLICY = "IfNotPresent" | ||
JAVA_VERSION = "11" | ||
TEST_HELM2_VERSION = "v2.17.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed? I don't think we use Helm 2 for anything anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is not needed. I've removed it.
.jenkins/Jenkinsfile-s390x
Outdated
PATH = "${env.JAVA_HOME}/bin:${env.PATH}" | ||
DOCKER_BUILDX = "buildx" | ||
DOCKER_BUILD_ARGS = "--platform linux/s390x --load" | ||
BRIDGE_IMAGE = "quay.io/strimzi/kafka-bridge:latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this used for? I think the system tests should be normally using the pre-defined bridge version from the installation files and not latest
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used version latest
for testing before Bridge 0.21.4 which supports s390x was released. I've removed this line. Thanks @scholzj !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, makes sense.
Signed-off-by: Kun-Lu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove a lot of duplicated code. For example jenkins-s390x.groovy
contains a lot of code which is the same for x86.
You can also share parts of the pipeline itself and based on the parameter (node label) distinguish it.
.jenkins/Jenkinsfile-s390x
Outdated
failure { | ||
println("Build failed") | ||
script { | ||
lib.sendMail(env.STRIMZI_MAILING_LIST, "failed", env.ghprbPullId, env.ghprbActualCommitAuthor, env.ghprbPullTitle, env.ghprbPullLink, env.BUILD_URL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to set STRIMZI_MAILING_LIST
env in your Jenkins, otherwise it will fail on it I think
Thanks @Frawless ! I'll remove the duplicate code and get back to you soon. |
Signed-off-by: Kun-Lu <[email protected]>
Signed-off-by: Kun-Lu <[email protected]>
Signed-off-by: Kun-Lu <[email protected]>
Hi @Frawless , thanks for your advice! I've refactored the scripts and removed the redundancy. Could you please take a look? Thank you so much! |
Below is the log of running STs in acceptance profile in Jenkins pipeline on s390x after refactoring the scripts: |
Hi @Frawless , hope all is well. Could you please have a look at the code change when you have some time? Thanks! |
@kun-lu20 Jakub is on PTO this and next week. I'm afraid his review is really needed for this (as he is pretty much the only maintainer who knows Jenkins), so we might need to wait. |
@scholzj Got it. Thanks for letting me know! |
.jenkins/Jenkinsfile-pr
Outdated
@@ -7,7 +7,7 @@ def DEFAULT_EXCLUDED_GROUPS = "loadbalancer,networkpolicies" | |||
pipeline { | |||
agent { | |||
node { | |||
label "strimzi-pr" | |||
label "strimzi-pr || strimzi-s390x" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea. Which node will use it when jenkins will have both of the labels configured? I think we should have 2 different pipelines, one for s390x and one for amd64, and change specific parts like call different function to deploy minikube.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Frawless for your time and detailed comments!
OK, I'll adjust the scripts to use 2 different pipelines.
.jenkins/Jenkinsfile-pr
Outdated
if(env.TEST_ARCH.contains('s390x')){ | ||
//Use hardcoding for ghprbCommentBody since we are not setting up GitHub PRB integration. | ||
env.ghprbCommentBody = "ok to test" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so you don't want to run the tests from PR directly? If no, what value does this adds to us? Are you going to run some nightly builds? Is the jenkins instance available for the community to see the results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we were going to run nightly builds. But we could also run the tests from PR directly, I'll make adjustments to the pipeline script. The Jenkins link will be available for the community to see the results.
.jenkins/Jenkinsfile-pr
Outdated
if(env.TEST_ARCH.contains('s390x')){ | ||
env.DOCKER_TAG="latest" | ||
}else{ | ||
env.DOCKER_TAG="pr" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you need to change tag here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we do not need to change tag here since we're going to run the tests from PR directly as mentioned above.
.jenkins/Jenkinsfile-pr
Outdated
if(env.TEST_ARCH.contains('s390x')){ | ||
env.TEST_COUNT_RUNNING_IN_PARALLEL = "1" | ||
}else{ | ||
env.TEST_COUNT_RUNNING_IN_PARALLEL = "3" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We found that when setting this arg to 3, some test cases would become unstable and it will cost extra time to rerun them. Probably it's because that we've set MINIKUBE_MEMORY
to 8192.
So we followed the arg value used in community's Azure Pipelines and the unstable issue disappeared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye, that makes sense. @see-quick jfyi
.jenkins/Jenkinsfile-pr
Outdated
if(env.TEST_ARCH.contains('s390x')){ | ||
sh(script: "minikube stop || true") | ||
sh(script: "minikube delete || true") | ||
sh(script: "docker stop s390x-registry || true") | ||
sh(script: "docker rm s390x-registry || true") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are going to use some static machine that you need this? If so, you should probably also remove all images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we used a static VM to run the Jenkins pipeline. We could switch to run the pipeline in a docker container so that we do not need these commands.
1. Create a separate pipeline to run STs on s390x 2. Run STs in ub worker containers Signed-off-by: Kun-Lu <[email protected]>
Hi @Frawless , I've updated the code as per your review comments. The main changes are:
Thank you so much for taking the time to do the previous review. We appreciate that. Please have a look at the code changes if you have some time. Thanks again! |
.azure/scripts/setup-kubernetes.sh
Outdated
minikube addons enable registry | ||
if [ "$ARCH" = "s390x" ]; then | ||
git clone -b v1.9.11 --depth 1 https://github.com/kubernetes/kubernetes.git | ||
cd kubernetes/cluster/addons/registry/images/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is needed because currently the registry
addon doesn't have s390x support yet, we need to build kube-registry-proxy
image locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the cd
command, wouldn't be better just to use relative path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got it. I've changed the code to use relative path to build kube-registry-proxy
image.
.jenkins/Jenkinsfile-pr-s390x
Outdated
sh(script: "sudo ln -s /opt/apache-maven-3.8.4/bin/mvn /usr/bin/mvn") | ||
sh(script: "sudo ln -s /opt/apache-maven-3.8.4/bin/mvn /usr/local/bin/mvn") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't there some better solution for this? Maybe on container preparation level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've moved this to container preparation level (Dockerfile_base_s390x).
Signed-off-by: Kun-Lu <[email protected]>
Hi @Frawless , I've made code changes as per your review comments. Please take a look when you have some time. Thank you so much! |
.jenkins/Jenkinsfile-pr-s390x
Outdated
if ("${env.TEST_PROFILE}".contains("upgrade")) { | ||
println("[INFO] Update files for upgrade procedure") | ||
sh(script: """ | ||
sed -i 's#:latest#:${env.DOCKER_TAG}#g' ${env.WORKSPACE}/systemtest/src/test/resources/upgrade/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/test/resources/upgrade/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 | ||
""") | ||
sh(script: "cat ${env.WORKSPACE}/systemtest/src/test/resources/upgrade/StrimziUpgradeST.json") | ||
sh(script: "cat ${env.WORKSPACE}/install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can put this into a method and call it in this and in x86 pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@kun-lu20 I think the code is fine now. Now let's talk about access rights: 1 - Can you share jenkins URL? For amd64 we basically have everything on azure that is available to everyone. Comment trigger is available only to maintainers due to security reasons set by azure. |
1. Use relative path when building kube-registry-proxy image 2. Add function prepareUpgradeSTs() in jenkins.groovy for reuse Signed-off-by: Kun-Lu <[email protected]>
Hi @Frawless , thanks very much for your review comments. I've made the code change and here is the reply to your questions: 1 - The Jenkins url is https://148.100.84.136/job/kafka-op-build/job/add_jenkins_scripts_for_s390x/. We're still working on configurations and things might change in the future. 2 - We would like to start with running daily builds on 3 - Our team will be the admin for Jenkins and we'll monitor the s390x builds and listen to community needs. 4 - We'll use PRB Jenkins plugin, I think the same plugin had been used on community's internal Jenkins. 5 - We're currently waiting for some ports to be opened on our vm's network so we don't have email reporting enabled yet. When it's working, can we use the same Strimzi mailing list as you do for internal Jenkins? Also do you think there are ways other than email that you can accept the results? |
1. Replace hard-coded ids with build args in Dockerfile 2. Use $USER instead of env variable $ST_USER Signed-off-by: Kun-Lu <[email protected]>
Hi @Frawless , could you please take a look? Do let me know if you have any further questions. Thank you so much! BTW, the Jenkins url has been changed to https://148.100.84.211/job/strimzi-kafka-operator/job/Strimzi_Kafka_Operator_ST/. Please use this new link when accessing our Jenkins instance. |
@kun-lu20 Code changes are fine from my POV now. I have a few other points. 1 - The link should be available in some readme (I also expect it will be part of the checks on gh, but this is handled by the plugin itself) |
Signed-off-by: Kun-Lu <[email protected]>
Hi @Frawless , according to your questions:
Could you please take a look? Thanks! |
1 - Info about which tests, how and when will be executed will be fine |
Signed-off-by: Kun-Lu <[email protected]>
Thanks @Frawless ! Reg your comments, 1 - Relevant info was added in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, PR looks good to me now. I assume you tried it and it's working without issues.
Yes, we've tried it and it's working fine. Thanks @Frawless ! |
Hi @scholzj , hope all is well. Could you please merge this PR so that we can start to run our Jenkins nightly builds on main branch? Thank you very much! |
Type of change
Select the type of your PR
Description
Please describe your pull request
This PR is to add s390x Jenkins scripts so that system tests could be run on s390x Jenkins nodes.
Currently this PR includes two patches on s390x. However, they will be removed soon once next version of corresponding artifacts are released.
We've run Jenkins pipeline internally for testing. It went smoothly with STs in acceptance and other profiles. The logs are attached below. Also we're making good progress on the public Jenkins set up and will share the link to show live result once we're done.
run_acceptance_profile_on_s390x.log
run_keycloak_related_STs_on_s390x.log
run_azp_kafka_oauth_profile_on_s390x.log
run_azp_operators_profile_on_s390x.log
run_azp_connect_mirrormaker_profile_on_s390x.log
run_azp_rolling_update_bridge_profile_on_s390x.log
run_azp_security_profile_on_s390x.log
run_azp_dynconfig_listeners_tracing_watcher_profile_on_s390x.log
run_azp_remaining_profile_on_s390x.log
Checklist
Please go through this checklist and make sure all applicable tasks have been done