Skip to content
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

Draft PR for review comments of infraclouds contributions #2

Draft
wants to merge 449 commits into
base: infracloud/cassandra-5.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
449 commits
Select commit Hold shift + click to select a range
7d2b552
updated echo command
richamishra006 Sep 21, 2023
c337a82
Merge branch 'infracloud/cassandra-5.0' of https://github.com/infracl…
richamishra006 Sep 21, 2023
96799ad
updated echo command
richamishra006 Sep 21, 2023
b90db0a
updated file
richamishra006 Sep 22, 2023
9e0848e
updated file
richamishra006 Sep 22, 2023
9d5c38e
updated file
richamishra006 Sep 22, 2023
6a1cdf6
updated file
richamishra006 Sep 22, 2023
66b153d
updated file
richamishra006 Sep 22, 2023
c0b12dc
updated file
richamishra006 Sep 22, 2023
9f86207
updated file
richamishra006 Sep 22, 2023
fae1c01
updated file
richamishra006 Sep 22, 2023
0a5f6af
updated file
richamishra006 Sep 22, 2023
be11cf6
updated image tag added bc and timeout
richamishra006 Sep 22, 2023
f4b7897
updated image tag added bc and timeout
richamishra006 Sep 22, 2023
f5e1ae1
updated file
richamishra006 Sep 22, 2023
82a1589
updated file
richamishra006 Sep 22, 2023
f61f449
uncommented stash unstash block
richamishra006 Sep 25, 2023
e1f2333
uncommented stash unstash block
richamishra006 Sep 25, 2023
bb28801
reverted change
richamishra006 Sep 25, 2023
e2cbcbe
updated stash unstash block
richamishra006 Sep 25, 2023
108d2b0
updated stash unstash block
richamishra006 Sep 25, 2023
24fb78d
updated stash unstash block
richamishra006 Sep 25, 2023
ecd22b2
updated stash unstash block
richamishra006 Sep 25, 2023
3b5eb23
updated stash unstash block
richamishra006 Sep 25, 2023
6ac257f
updated stash unstash block
richamishra006 Sep 25, 2023
647c1c1
updated stash unstash block
richamishra006 Sep 25, 2023
fcf2a7c
updated stash unstash block
richamishra006 Sep 25, 2023
f60f1e8
updated stash unstash block
richamishra006 Sep 25, 2023
9e0633f
updated stash unstash block
richamishra006 Sep 25, 2023
1556417
updated stash unstash block
richamishra006 Sep 25, 2023
7e0d4aa
update pipeline.jenkins file
Nbarola Sep 26, 2023
7f0b241
reverted changes
richamishra006 Sep 26, 2023
10d6323
Merge branch 'infracloud/cassandra-5.0' of https://github.com/infracl…
richamishra006 Sep 26, 2023
e5565f4
update jenkins jenkins file
Nbarola Sep 26, 2023
cb2a0b7
Merge branch 'infracloud/cassandra-5.0' of github.com:infracloudio/ca…
Nbarola Sep 26, 2023
2e8d9e1
update jenkins jenkins file
Nbarola Sep 26, 2023
ae5c475
update jenkins jenkins file
Nbarola Sep 26, 2023
fdbf9cf
reverted changes
richamishra006 Sep 26, 2023
ac463d7
Merge branch 'infracloud/cassandra-5.0' of https://github.com/infracl…
richamishra006 Sep 26, 2023
fa3f81a
updated volume
richamishra006 Sep 27, 2023
d7b7e4d
updated volume name
richamishra006 Sep 27, 2023
446ca14
updated pipeline
richamishra006 Sep 27, 2023
58c36f6
updated pipeline
richamishra006 Sep 27, 2023
431385f
update stash code in jenkins.pipeline
Nbarola Sep 28, 2023
379d325
update stash code in jenkins.pipeline
Nbarola Sep 28, 2023
f1dbace
update stash code in jenkins.pipeline
Nbarola Sep 28, 2023
dcb8726
update stash code in jenkins.pipeline
Nbarola Sep 28, 2023
faac81a
update stash code in jenkins.pipeline
Nbarola Sep 28, 2023
99cc876
update stash code in jenkins.pipeline
Nbarola Sep 28, 2023
61bcad7
updated pipeline
richamishra006 Sep 28, 2023
82224fe
updated pipeline
richamishra006 Sep 28, 2023
3051892
updated pipeline
richamishra006 Sep 28, 2023
499af2f
updated pipeline
richamishra006 Sep 28, 2023
13ff92f
updated pipeline
richamishra006 Sep 28, 2023
23bb558
updated pipeline
richamishra006 Oct 3, 2023
d951683
updated pipeline
richamishra006 Oct 3, 2023
68df97f
updated pipeline
richamishra006 Oct 3, 2023
c3830b3
updated pipeline
richamishra006 Oct 3, 2023
218e983
updated pipeline
richamishra006 Oct 3, 2023
217c0c3
updated pipeline
richamishra006 Oct 3, 2023
bbcb26d
updated pipeline
richamishra006 Oct 3, 2023
08ee5d4
updated pipeline
richamishra006 Oct 3, 2023
87fb545
updated pipeline
richamishra006 Oct 3, 2023
1626567
updated pipeline
richamishra006 Oct 3, 2023
9b10365
updated pipeline
richamishra006 Oct 3, 2023
006c593
updated pipeline
richamishra006 Oct 3, 2023
2bff62b
updated pipeline
richamishra006 Oct 3, 2023
7c48fe3
updated pipeline
richamishra006 Oct 3, 2023
d486827
updated pipeline
richamishra006 Oct 3, 2023
245ed22
update pipeline.jenkins
Nbarola Oct 3, 2023
7b3b36a
updated file
richamishra006 Oct 3, 2023
2fb9d30
added trim
richamishra006 Oct 3, 2023
65a8835
updated pipeline
richamishra006 Oct 3, 2023
bd837ed
updated pipeline
richamishra006 Oct 3, 2023
886d7eb
updated pipeline
richamishra006 Oct 3, 2023
c28eb0a
updated pipeline
richamishra006 Oct 4, 2023
bcba87d
updated pipeline
richamishra006 Oct 4, 2023
0111793
updated pipeline
richamishra006 Oct 4, 2023
1e595bc
updated sleep
richamishra006 Oct 4, 2023
09283df
updated cp command
richamishra006 Oct 4, 2023
c341abc
updated pipeline
richamishra006 Oct 4, 2023
ec091fe
updated pipeline
richamishra006 Oct 4, 2023
3d6e2bd
updated pipeline
richamishra006 Oct 4, 2023
078ca8e
updated pipeline
richamishra006 Oct 4, 2023
395b9be
updated build dir
richamishra006 Oct 5, 2023
f2a2504
updated build dir
richamishra006 Oct 5, 2023
ed247ae
added summary and fqltool
richamishra006 Oct 5, 2023
059b2c7
updated summary
richamishra006 Oct 5, 2023
fbbbbe4
updated pipeline
richamishra006 Oct 5, 2023
d6ec04d
updated pipeline
richamishra006 Oct 5, 2023
0f3e13e
updated pipeline
richamishra006 Oct 5, 2023
04dde10
updated pipeline
richamishra006 Oct 5, 2023
62909cb
update pipeline.jenkins
Nbarola Oct 6, 2023
4ff1bce
update pipeline.jenkins
Nbarola Oct 6, 2023
0bc5d09
update pipeline.jenkins with temp build dir for test jobs
Nbarola Oct 6, 2023
d603628
fix comment in pipeline.jenkins
Nbarola Oct 6, 2023
6e8efd9
fix typo in pipeline.jenkins
Nbarola Oct 6, 2023
c95bd00
provide 1/1 for split for testAxix in pipeline.jenkins
Nbarola Oct 6, 2023
5cf5a81
add create build dir for testAxis() in pipeline.jenkins
Nbarola Oct 6, 2023
7bd388f
update path for docker cp
Nbarola Oct 6, 2023
b73b5d0
update path for docker cp
Nbarola Oct 6, 2023
1adb11c
add DIST dir variable to run the test script in pipeline.jenkins
Nbarola Oct 6, 2023
63694b5
add DIST dir argument to run the test script in pipeline.jenkins
Nbarola Oct 6, 2023
d5db683
add DIST dir argument to run the test script in pipeline.jenkins
Nbarola Oct 6, 2023
e5c45fc
add current_build_dir argument to run the test script in pipeline.jen…
Nbarola Oct 6, 2023
b978768
add current_build_dir argument to run the test script in pipeline.jen…
Nbarola Oct 6, 2023
08189f1
add current_build_dir argument to run the test script in pipeline.jen…
Nbarola Oct 6, 2023
5ca5833
fix current_build_dir argument to run the test script in pipeline.jen…
Nbarola Oct 6, 2023
7d35fb3
fix run-test.sh
Nbarola Oct 6, 2023
bafeb6c
fix run-test.sh
Nbarola Oct 6, 2023
b7405df
added sleep to troubleshoot
richamishra006 Oct 9, 2023
8e3ffd1
add ant opt build dir to .build/run-tests.sh
Nbarola Oct 9, 2023
c6ede46
Merge branch 'infracloud/cassandra-5.0' of github.com:infracloudio/ca…
Nbarola Oct 9, 2023
aef256f
resolved conflicts
richamishra006 Oct 9, 2023
3f37ec5
resolved conflicts
richamishra006 Oct 9, 2023
ffd55f6
updated command
richamishra006 Oct 9, 2023
7e68e82
updated junit command
richamishra006 Oct 9, 2023
7de2a55
updated junit command
richamishra006 Oct 9, 2023
17a797d
updated junit command
richamishra006 Oct 9, 2023
5c0ac21
updated junit command
richamishra006 Oct 9, 2023
1753aa3
updated junit command
richamishra006 Oct 9, 2023
4148183
commented artifacts to troubleshoot
richamishra006 Oct 9, 2023
ff86cf1
commented artifacts to troubleshoot
richamishra006 Oct 9, 2023
68dceab
commented artifacts to troubleshoot
richamishra006 Oct 9, 2023
7d900e8
commented artifacts to troubleshoot
richamishra006 Oct 9, 2023
291c042
commented artifacts to troubleshoot
richamishra006 Oct 9, 2023
729f8cd
commented artifacts to troubleshoot
richamishra006 Oct 9, 2023
b5adf2f
modify pipeline.jenkins for troubleshooting
Nbarola Oct 9, 2023
d822ffe
modify pipeline.jenkins for troubleshooting
Nbarola Oct 9, 2023
5cfd2a9
modify run-tests.sh for troubleshooting
Nbarola Oct 9, 2023
83ba764
modify junit command for troubleshooting
Nbarola Oct 9, 2023
1862029
modify junit with relative path command for troubleshooting
Nbarola Oct 9, 2023
a171ab4
modify piepline.jenkins file
Nbarola Oct 9, 2023
c2d0643
modify piepline.jenkins file
Nbarola Oct 9, 2023
8b2c14d
modify piepline.jenkins file
Nbarola Oct 9, 2023
d08eded
added symlink command
richamishra006 Oct 10, 2023
6d9b24e
added symlink command
richamishra006 Oct 10, 2023
7cf493c
updated symlink command
richamishra006 Oct 10, 2023
8b3eb0d
updated symlink command
richamishra006 Oct 10, 2023
8165818
commented symlink
richamishra006 Oct 10, 2023
c2ef545
commented symlink
richamishra006 Oct 10, 2023
17e1e36
commented symlink
richamishra006 Oct 10, 2023
6e094ac
updated symlink
richamishra006 Oct 10, 2023
bc787be
updated symlink
richamishra006 Oct 10, 2023
5b0a0d9
updated symlink
richamishra006 Oct 10, 2023
0445a3e
updated symlink
richamishra006 Oct 10, 2023
9b51d62
updated symlink
richamishra006 Oct 10, 2023
77e3f44
added sleep for troubleshooting
richamishra006 Oct 10, 2023
420232f
added sleep for troubleshooting
richamishra006 Oct 10, 2023
e957b1a
added sleep for troubleshooting
richamishra006 Oct 10, 2023
579b71b
removed sleep command
richamishra006 Oct 10, 2023
0ee7f7a
added symlink command
richamishra006 Oct 10, 2023
8801460
added sleep
richamishra006 Oct 10, 2023
704b80f
removed security context
richamishra006 Oct 10, 2023
0c3d81a
added sleep
richamishra006 Oct 10, 2023
b380716
added sleep
richamishra006 Oct 10, 2023
d34b6de
added symlink command
richamishra006 Oct 10, 2023
517f17b
added symlink command
richamishra006 Oct 10, 2023
9b2d1f1
added symlink command
richamishra006 Oct 10, 2023
9b4980c
added symlink command
richamishra006 Oct 10, 2023
546cf95
updated
richamishra006 Oct 10, 2023
2109074
updated
richamishra006 Oct 10, 2023
84e6595
updated
richamishra006 Oct 10, 2023
2207f9f
added sleep
richamishra006 Oct 10, 2023
fe31a27
added sleep
richamishra006 Oct 10, 2023
18295df
troubleshooting container
richamishra006 Oct 10, 2023
b4cbd6a
troubleshooting container
richamishra006 Oct 10, 2023
ad4d06a
troubleshooting container
richamishra006 Oct 10, 2023
3f99f2f
added cassandra dir env value
richamishra006 Oct 10, 2023
d98613e
Merge pull request #1 from thelastpickle/mck/license-defaults-precond…
richamishra006 Oct 11, 2023
3d97537
updated script
richamishra006 Oct 11, 2023
98c3ede
updated script
richamishra006 Oct 11, 2023
c3a1a32
updated script
richamishra006 Oct 11, 2023
a59258b
updated script
richamishra006 Oct 11, 2023
8da7257
add mount bind in pipeline.jenkins
Nbarola Oct 11, 2023
1942c8d
add mount bind in pipeline.jenkins
Nbarola Oct 11, 2023
d87111d
add sleep to troubleshoot mount bind in pipeline.jenkins
Nbarola Oct 11, 2023
9112b04
add securityContext as privileged in pipeline.jenkins
Nbarola Oct 11, 2023
238b21d
add securityContext as SYS_ADMIN in pipeline.jenkins
Nbarola Oct 11, 2023
46838ce
add securityContext as root user in pipeline.jenkins
Nbarola Oct 11, 2023
392c486
add securityContext as root user and privileged in pipeline.jenkins
Nbarola Oct 11, 2023
837df0b
remove sleep added previously for troubleshooting in pipeline.jenkins
Nbarola Oct 11, 2023
6ac16ab
add switch user to jenkins in pipeline.jenkins
Nbarola Oct 11, 2023
385eaec
updated init container
richamishra006 Oct 12, 2023
b0f4083
updated init container
richamishra006 Oct 12, 2023
baa58fd
updated init container
richamishra006 Oct 12, 2023
668755b
updated init container
richamishra006 Oct 12, 2023
dd547a6
updated init container
richamishra006 Oct 12, 2023
dd34428
updated init container
richamishra006 Oct 12, 2023
e8377c8
updated init container
richamishra006 Oct 12, 2023
9549f12
updated init container
richamishra006 Oct 12, 2023
3f33e1f
updated init container
richamishra006 Oct 12, 2023
ebd05b3
updated init container
richamishra006 Oct 12, 2023
159e867
updated docker command
richamishra006 Oct 12, 2023
ae5fb90
updated docker command
richamishra006 Oct 12, 2023
a2f5fe7
updated docker command
richamishra006 Oct 12, 2023
4a42255
updated docker command
richamishra006 Oct 12, 2023
b77830b
updated dockerfile
richamishra006 Oct 12, 2023
90937ff
updated pipeline mount command
richamishra006 Oct 12, 2023
ebb332f
updated pipeline mount command
richamishra006 Oct 12, 2023
37d4a19
updated pipeline mount command
richamishra006 Oct 12, 2023
b961834
updated test stage
richamishra006 Oct 12, 2023
3c5840e
updated logfile command
richamishra006 Oct 12, 2023
38eadd2
updated logcommand
richamishra006 Oct 12, 2023
68ededd
add string paramter to pipeline.jenkins to provide which stages to run
Nbarola Oct 13, 2023
6ab307d
add string paramter to pipeline.jenkins to provide which stages to run
Nbarola Oct 13, 2023
7dfb474
remove temp output dir
Nbarola Oct 13, 2023
5a88e4f
remove step within step in pipeline.jenkins
Nbarola Oct 13, 2023
7060a8d
clean build artifact comments in pipeline.jenkins
Nbarola Oct 13, 2023
fb4122b
comment artifact stage for troubleshooting in pipeline.jenkins
Nbarola Oct 13, 2023
d37ffb8
comment artifact stage for troubleshooting in pipeline.jenkins
Nbarola Oct 13, 2023
7773805
all echo for troubleshooting in pipeline.jenkins
Nbarola Oct 13, 2023
d5c0e25
add echo for troubleshooting in pipeline.jenkins
Nbarola Oct 13, 2023
015c9e5
updated pipleine
richamishra006 Oct 13, 2023
c9328f9
updated pipeline
richamishra006 Oct 13, 2023
20eb15a
resolve conflicts
Nbarola Oct 13, 2023
b2e3ab0
revert changes in build-jars.sh
Nbarola Oct 13, 2023
c2974b6
uncomment artifacts build job after troubleshooting in pipeline.jenkins
Nbarola Oct 13, 2023
b1faf35
add default values for include-test-stage variable in run-ci.sh
Nbarola Oct 13, 2023
d43af09
refined jenkinsfile and scripts
richamishra006 Oct 13, 2023
2a3d6c2
changed the mount path
richamishra006 Oct 13, 2023
13b89a5
updated mount path
richamishra006 Oct 13, 2023
4f9f82d
reverted mount path
richamishra006 Oct 13, 2023
45d8aa2
updated job name
richamishra006 Oct 16, 2023
88ad70c
reverted job name
richamishra006 Oct 16, 2023
1862109
add stringParam to pipelineJob in DslJob.jenkins
Nbarola Oct 16, 2023
d6ee789
Merge branch 'infracloud/cassandra-5.0' of github.com:infracloudio/ca…
Nbarola Oct 16, 2023
acaed3e
parameterise repo-url and repo-branch for jenkins-deployment.yaml in …
Nbarola Oct 16, 2023
d84b73b
remove nodeSelector from the k8s agent pod template
Nbarola Oct 17, 2023
38c27a1
updated buildjob command
richamishra006 Oct 17, 2023
d714963
Merge branch 'infracloud/cassandra-5.0' of https://github.com/infracl…
richamishra006 Oct 17, 2023
3e94a1c
reverted buildjob command
richamishra006 Oct 17, 2023
93482ef
updated buildjob command
richamishra006 Oct 17, 2023
a3f7b1a
fixed typo
richamishra006 Oct 17, 2023
2bfe665
reverted changes
richamishra006 Oct 17, 2023
be5f02e
added few changes in script
richamishra006 Oct 17, 2023
49c15df
update jenkins deployment deployment name
Nbarola Oct 17, 2023
742e923
update jenkins deployment name in run-ci.sh
Nbarola Oct 17, 2023
b696aee
add tear-down and portforwarding process termination in run-ci.sh
Nbarola Oct 18, 2023
b8f9e3a
Update the fetch result code in .build/run-ci.sh
Nbarola Oct 18, 2023
9d1765c
remove dsljob and pipelinecopy jenkinsfiles
Nbarola Oct 18, 2023
3490fdd
move agent-build.docker file
Nbarola Oct 18, 2023
80a2e43
move jenkins-deployment.yaml file
Nbarola Oct 18, 2023
fa39706
update tear-down to remove the jenkins operator along with jenkins in…
Nbarola Oct 18, 2023
653e3b1
add k8s sub dir to .jenkins dir
Nbarola Oct 18, 2023
6d47a1e
update comment in --help case in run-ci.sh
Nbarola Oct 18, 2023
c0572a2
parameterise job-name in run-ci.sh
Nbarola Oct 20, 2023
7613a52
update echo statements in run-ci.sh
Nbarola Oct 20, 2023
2b89e51
update sed command in run-ci.sh
Nbarola Oct 20, 2023
3710ca5
add sleep after port-forward in run-ci.sh
Nbarola Oct 20, 2023
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 .build/build-jars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# variables, with defaults
[ "x${CASSANDRA_DIR}" != "x" ] || CASSANDRA_DIR="$(readlink -f $(dirname "$0")/..)"

echo "$CASSANDRA_DIR from build_jar"
# pre-conditions
command -v ant >/dev/null 2>&1 || { echo >&2 "ant needs to be installed"; exit 1; }
[ -d "${CASSANDRA_DIR}" ] || { echo >&2 "Directory ${CASSANDRA_DIR} must exist"; exit 1; }
Expand Down
25 changes: 19 additions & 6 deletions .build/docker/_docker_run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -28,9 +28,10 @@

# variables, with defaults
[ "x${cassandra_dir}" != "x" ] || cassandra_dir="$(readlink -f $(dirname "$0")/../..)"
#[ "x${cassandra_dir}" != "x" ] || cassandra_dir="$(readlink -f $(dirname "$0"))"
[ "x${build_dir}" != "x" ] || build_dir="${cassandra_dir}/build"
[ -d "${build_dir}" ] || { mkdir -p "${build_dir}" ; }

echo "$CASSANDRA_DIR from _docker_run"
java_version_default=`grep 'property\s*name="java.default"' ${cassandra_dir}/build.xml |sed -ne 's/.*value="\([^"]*\)".*/\1/p'`
java_version_supported=`grep 'property\s*name="java.supported"' ${cassandra_dir}/build.xml |sed -ne 's/.*value="\([^"]*\)".*/\1/p'`

Expand Down Expand Up @@ -111,22 +112,34 @@ container_name="cassandra_${dockerfile/.docker/}_${un_script_name}_jdk${java_ver
# change ant's build directory to $DIST_DIR
# set java to java_version
# execute the run_script
# docker_command="export ANT_OPTS=\"-Dbuild.dir=\${DIST_DIR} ${CASSANDRA_DOCKER_ANT_OPTS}\" ; \
# source \${CASSANDRA_DIR}/.build/docker/_set_java.sh ${java_version} ; \
# \${CASSANDRA_DIR}/.build/${run_script} ${@:4} ; exit \$? "

docker_command="export ANT_OPTS=\"-Dbuild.dir=\${DIST_DIR} ${CASSANDRA_DOCKER_ANT_OPTS}\" ; \
source \${CASSANDRA_DIR}/.build/docker/_set_java.sh ${java_version} ; \
\${CASSANDRA_DIR}/.build/${run_script} ${@:4} ; exit \$? "
source /home/build/cassandra/cassandra/.build/docker/_set_java.sh ${java_version} ; \
/home/build/cassandra/.build/${run_script} ${@:4} ; exit \$? "

# run without the default seccomp profile
# re-use the host's maven repository
# container_id=$(docker run --name ${container_name} -d --security-opt seccomp=unconfined --rm \
# -v "${cassandra_dir}":/home/build/cassandra -v ~/.m2/repository/:/home/build/.m2/repository/ -v "${build_dir}":/dist \
# ${docker_volume_opt} \
# ${image_name} sleep 1h)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed now?

container_id=$(docker run --name ${container_name} -d --security-opt seccomp=unconfined --rm \
-v "${cassandra_dir}":/home/build/cassandra -v ~/.m2/repository/:/home/build/.m2/repository/ -v "${build_dir}":/dist \
${docker_volume_opt} \
${image_name} sleep 1h)

echo "Running container ${container_name} ${container_id}"

docker exec --user root ${container_name} bash -c "\${CASSANDRA_DIR}/.build/docker/_create_user.sh build $(id -u) $(id -g)"
echo "Running container ${container_name} ${container_id}"
#sleep 3600
#docker exec --user root ${container_name} bash -c "\${CASSANDRA_DIR}/.build/docker/_create_user.sh build $(id -u) $(id -g)"
docker exec --user root ${container_name} bash -c "/home/build/cassandra/.build/docker/_create_user.sh build $(id -u) $(id -g)"
docker exec --user build ${container_name} bash -c "${docker_command}"
RETURN=$?
current_build_dir=$(basename "${build_dir}")
docker cp ${container_name}:"/home/build/cassandra/build/${current_build_dir}" /home/jenkins/agent/workspace/k8s-e2e/build
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't be doing k8s/jenkins stuff in this script.

Copy link
Member Author

@michaelsembwever michaelsembwever Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything under /dist should already be available at ${build_dir} on the docker host
because of the mount -v "${build_dir}":/dist on this line https://github.com/thelastpickle/cassandra/pull/2/files/04dde10476e61bd9d399e0fdbbf60a1aa1b2177b#diff-e8f0cb5844d900a3d89a43743814930e66575abc2b6731c07d6a691de51a4d65R129-R130

(/home/build/cassandra/build/${current_build_dir} should not be the build directory inside the docker container.)

Remember the newline character breaking the mount from working.

Also, inside the docker container we need to make sure that both ${DIST_DIR} and export ANT_OPTS=\"-Dbuild.dir=\${DIST_DIR} is set. The former is set here: https://github.com/thelastpickle/cassandra/blob/infracloud/cassandra-5.0/.build/docker/bullseye-build.docker#L22. The latter happens here: https://github.com/thelastpickle/cassandra/pull/2/files/04dde10476e61bd9d399e0fdbbf60a1aa1b2177b#diff-e8f0cb5844d900a3d89a43743814930e66575abc2b6731c07d6a691de51a4d65R115

Copy link
Member Author

@michaelsembwever michaelsembwever Oct 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as @Nbarola and @richamishra006 explained today, the problem so far here has been the files can be found in three places.

  • k8s node (which is also the docker host)
  • k8s pod (which is where the jenkins agent, and the jenkins groovy script runs on)
  • docker container (which mounts from the k8s node)

The jenkins script doesn't have access to the build_dir (only the k8s node and docker container has access).

Nishant and Richa are working on how to provide/share/mount the cassandra_dir (which includes all build_dir) from k8s nodes to pods.


docker stop ${container_name} >/dev/null
popd >/dev/null
Expand Down
5 changes: 3 additions & 2 deletions .build/docker/_set_java.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash -e -x
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -24,7 +24,8 @@
# variables, with defaults
[ "x${CASSANDRA_DIR}" != "x" ] || { CASSANDRA_DIR="$(pwd)"; }
[ -d "${CASSANDRA_DIR}" ] || { echo >&2 "Directory ${CASSANDRA_DIR} must exist"; exit 1; }

echo "$CASSANDRA_DIR from _set_java"
echo $(pwd)
# pre-conditions
[ -f "${CASSANDRA_DIR}/build.xml" ] || { echo >&2 "${CASSANDRA_DIR}/build.xml must exist"; exit 1; }

Expand Down
39 changes: 39 additions & 0 deletions .build/docker/agent-build.docker
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this file be under .jenkins/ ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is a docker file, we placed it under the docker dir. If required we can move it under .jenkins

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.jenkins/k8s/ is best, and this relates to first jenkins and second k8s based jenkins.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Use Alpine Linux as the base image
FROM jenkins/inbound-agent:3148.v532a_7e715ee3-4

USER root
RUN apt-get update
RUN apt-get install xz-utils -y
RUN apt-get install bc -y
RUN apt-get update
RUN apt-get install coreutils -y

RUN apt-get update && \
apt-get install -y openjdk-11-jdk openjdk-17-jdk && \
update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java && \
update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac && \
update-alternatives --install /usr/local/bin/jdk_11 java /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1 && \
update-alternatives --install /usr/local/bin/jdk_17 java /usr/lib/jvm/java-17-openjdk-amd64/bin/java 1

# Install Docker
RUN apt-get install -y gnupg
# Install Docker for Debian Bullseye
RUN apt-get update && \
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io

#VOLUME /var/run/docker.sock
RUN usermod -aG docker jenkins
#RUN chown -R 1000:1000 /var/run/docker.sock

USER jenkins







11 changes: 7 additions & 4 deletions .build/docker/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash +x
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -82,7 +82,6 @@ dockerfile="ubuntu2004_test.docker"
image_tag="$(md5sum docker/${dockerfile} | cut -d' ' -f1)"
image_name="apache/cassandra-${dockerfile/.docker/}:${image_tag}"
docker_mounts="-v ${cassandra_dir}:/home/cassandra/cassandra -v "${build_dir}":/home/cassandra/cassandra/build -v ${HOME}/.m2/repository:/home/cassandra/.m2/repository"

# Look for existing docker image, otherwise build
if ! ( [[ "$(docker images -q ${image_name} 2>/dev/null)" != "" ]] ) ; then
# try docker login to increase dockerhub rate limits
Expand Down Expand Up @@ -202,14 +201,18 @@ docker_command="source \${CASSANDRA_DIR}/.build/docker/_set_java.sh ${java_versi
docker_id=$(docker run --name ${container_name} ${docker_flags} ${docker_mounts} ${docker_volume_opt} ${image_name} sleep 4h)

echo "Running container ${container_name} ${docker_id}"
#sleep 600

docker exec --user root ${container_name} bash -c "\${CASSANDRA_DIR}/.build/docker/_create_user.sh cassandra $(id -u) $(id -g)" | tee -a ${logfile}
docker exec --user root ${container_name} update-alternatives --set python /usr/bin/python${python_version} | tee -a ${logfile}

docker cp /home/jenkins/agent/workspace/k8s-e2e/build ${container_name}:/home/cassandra/cassandra
michaelsembwever marked this conversation as resolved.
Show resolved Hide resolved

# capture logs and pid for container
docker exec --user cassandra ${container_name} bash -c "${docker_command}" | tee -a ${logfile}
status=$?

docker cp ${container_name}:/home/cassandra/cassandra/build/test/output /home/jenkins/agent/workspace/k8s-e2e/build/test
docker exec --user cassandra ${container_name} bash -c "mkdir -p /home/cassandra/cassandra/result/1/${target} && cp -r /home/cassandra/cassandra/build/test/output /home/cassandra/cassandra/result/1/${target}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't be doing k8s/jenkins stuff in this script.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if [ "$status" -ne 0 ] ; then
echo "${docker_id} failed (${status}), debug…"
docker inspect ${docker_id}
Expand All @@ -223,7 +226,7 @@ if [ "$status" -ne 0 ] ; then
echo "Failure."
fi
# docker stop in background, ignore errors
( nohup docker stop ${docker_id} >/dev/null 2>/dev/null & )
#( nohup docker stop ${docker_id} >/dev/null 2>/dev/null & )

xz -f ${logfile} 2>/dev/null

Expand Down
112 changes: 112 additions & 0 deletions .build/jenkins-deployment.yaml
Copy link
Member Author

@michaelsembwever michaelsembwever Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file belongs under .jenkins/ ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have run-ci.sh script file under .build and this script file is using the jenkins-deployment.yaml file, so we placed it in the same dir.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put under .jenkins/k8s/

Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: jenkins-operator-user-configuration
data:
1-system-message.yaml: |
tool:
jdk:
installations:
- name: jdk_11_latest
home: "/usr/bin/jdk_11/bin/java"
- name: jdk_17_latest
home: "/usr/bin/jdk_17/bin/java"
---
apiVersion: jenkins.io/v1alpha2
kind: Jenkins
metadata:
name: example
spec:
configurationAsCode:
configurations:
- name: jenkins-operator-user-configuration
secret:
name: ""
groovyScripts:
configurations: []
secret:
name: ""
service:
type: ClusterIP
port: 8080
jenkinsAPISettings:
authorizationStrategy: createUser
master:
plugins:
- name: ws-cleanup
version: "0.45"
- name: javadoc
version: "243.vb_b_503b_b_45537"
- name: description-setter
version: "1.10"
- name: throttle-concurrents
version: "2.14"
- name: test-stability
version: "2.3"
- name: postbuildscript
version: "3.2.0-550.v88192b_d3e922"
- name: github
version: "1.37.3"
- name: timestamper
version: "1.26"
- name: openJDK-native-plugin
version: "1.7"
basePlugins:
- name: kubernetes
version: "4029.v5712230ccb_f8"
- name: workflow-job
version: "1342.v046651d5b_dfe"
- name: workflow-aggregator
version: "596.v8c21c963d92d"
- name: git
version: "5.2.0"
- name: job-dsl
version: "1.84"
- name: configuration-as-code
version: "1700.v6f448841296e"
- name: kubernetes-credentials-provider
version: "1.225.v14f9e6b_28f53"
disableCSRFProtection: false
containers:
- name: jenkins-master
image: jenkins/jenkins:2.414.1-lts-jdk11
# env:
# - name: JAVA_OPTS
# value: "-Dhudson.cli.CLI.HTTPS=true -Djenkins.websocket=false"
imagePullPolicy: Always
livenessProbe:
failureThreshold: 12
httpGet:
path: /login
port: http
scheme: HTTP
initialDelaySeconds: 100
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
failureThreshold: 10
httpGet:
path: /login
port: http
scheme: HTTP
initialDelaySeconds: 80
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 1500m
memory: 3Gi
requests:
cpu: 500m
memory: 500Mi
securityContext:
fsGroup: 1000
runAsUser: 1000
seedJobs:
- id: jenkins-operator
targets: ".jenkins/job/DslJob.jenkins" #"cicd/jobs/k8s.jenkins"
description: "Casandra Repo"
repositoryBranch: infracloud/cassandra-5.0 #master #infracloud/cassandra-5.0 #
repositoryUrl: https://github.com/infracloudio/cassandra.git
michaelsembwever marked this conversation as resolved.
Show resolved Hide resolved
72 changes: 72 additions & 0 deletions .build/run-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Parse command-line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-c|--kubeconfig)
KUBECONFIG="$2" # This sets the KUBECONFIG variable to the next argument.
shift # This shifts the arguments to the left, discarding the current argument and moving to the next one.
shift # This is an additional shift to move to the argument after the option value.
;;
-ctx|--kubecontext)
KUBECONTEXT="$2" # This sets the KUBECONTEXT variable to the next argument.
shift # This shifts the arguments to the left, discarding the current argument and moving to the next one.
shift # This is an additional shift to move to the argument after the option value.
;;
*)
echo "Unknown option: $1"
michaelsembwever marked this conversation as resolved.
Show resolved Hide resolved
exit 1
;;
esac
done

if [ -z "$KUBECONFIG" ] && [ -z "$KUBECONTEXT" ]; then
echo "Please provide either the path to the kubeconfig using -c|--kubeconfig option or the kubecontext using -ctx|--kubecontext option."
exit 1
fi

# This sets the kubeconfig and kubecontext if provided
if [ -n "$KUBECONFIG" ]; then
export KUBECONFIG="$KUBECONFIG"
fi

if [ -n "$KUBECONTEXT" ]; then
kubectl config use-context "$KUBECONTEXT"
fi

# Install Helm

# Check if Helm is already installed
if ! command -v helm &>/dev/null; then
echo "Helm not found. Installing Helm..."
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 # enhance without downloading the script
chmod 700 get_helm.sh
./get_helm.sh
else
echo "Helm is already installed."
fi

# Add Helm Jenkins Operator repository
echo "Adding Helm repository for Jenkins Operator..."
helm repo add jenkins https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart

# Install Jenkins Operator using Helm
echo "Installing Jenkins Operator..."
helm upgrade --install jenkins-operator jenkins/jenkins-operator --set jenkins.enabled=false --set jenkins.backup.enabled=false --version 0.8.0-beta.2

echo "Jenkins Operator installed successfully!" # condition to check if above command was success

# deploy jenkins Instance TODO jenkins file parameter
kubectl apply -f jenkins-deployment.yaml

# TODO wait for job pods
#kubectl rollout wait pod/ [--for=<condition>]

#sleep 120

# get job pod name - TODO parametrise the job name
#jobPodName=$(kubectl get po | grep k8sagent-e2e | cut -d " " -f1)

Copy link
Member Author

@michaelsembwever michaelsembwever Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're missing here the teardown of the jenkins stack.
and this needs to be optional via a parameter.

something along the lines of

# teardown # TODO add option to skip this
kubectl delete --namespace ${KUBE_NS} -f ${CASSANDRA_DIR}/build/jenkins-deployment.yaml
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
[ "default" == "${KUBE_NS}" ] ||  kubectl delete namespace ${KUBE_NS}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can leave this, i will tackle it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since for now, the jenkins deployment is working with default namespace only (the limitation we mentioned earlier), so there is no need to delete the default namespace, we can remove the delete command (for namespace)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have added the teardown code, also parameterised it as well

# get the file - TODO parameterize the path to fetch path
#kubectl exec -n default $jobPodName -- tar cf - /home/jenkins/agent/workspace/k8s-e2e | tar xf - -C .
Loading