-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kie-issues#710: turn kogito-ci-build to ubuntu dind image (#1125)
* kie-issues#710: turn kogito-ci-build to ubuntu dind image * freeze kogito-ci-build image tag in pr_check.groovy * adjust kogito-ci-build build pipeline * use java 17 --------- Co-authored-by: jstastny-cz <[email protected]>
- Loading branch information
1 parent
4d980a1
commit d1b4108
Showing
5 changed files
with
117 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
set -e | ||
# Start docker | ||
start-docker.sh | ||
|
||
# cgroup v2: enable nesting | ||
if [ -f /sys/fs/cgroup/cgroup.controllers ]; then | ||
echo "in cgroupv2 branch" | ||
# move the processes from the root group to the /init group, | ||
# otherwise writing subtree_control fails with EBUSY. | ||
# An error during moving non-existent process (i.e., "cat") is ignored. | ||
sudo mkdir -p /sys/fs/cgroup/init | ||
sudo bash -c "xargs -rn1 < /sys/fs/cgroup/cgroup.procs > /sys/fs/cgroup/init/cgroup.procs || :" | ||
# enable controllers | ||
sudo bash -c "sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers > /sys/fs/cgroup/cgroup.subtree_control" | ||
fi | ||
|
||
if [ $# -gt 0 ]; then | ||
exec "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
source /opt/bash-utils/logger.sh | ||
|
||
function wait_for_process () { | ||
local max_time_wait=30 | ||
local process_name="$1" | ||
local waited_sec=0 | ||
while ! pgrep "$process_name" >/dev/null && ((waited_sec < max_time_wait)); do | ||
INFO "Process $process_name is not running yet. Retrying in 1 seconds" | ||
INFO "Waited $waited_sec seconds of $max_time_wait seconds" | ||
sleep 1 | ||
((waited_sec=waited_sec+1)) | ||
if ((waited_sec >= max_time_wait)); then | ||
return 1 | ||
fi | ||
done | ||
sudo chown root:docker /var/run/docker.sock | ||
return 0 | ||
} | ||
|
||
INFO "Starting supervisor" | ||
sudo bash -c "/usr/bin/supervisord >> /dev/null 2>&1" & | ||
|
||
INFO "Waiting for docker to be running" | ||
wait_for_process dockerd | ||
if [ $? -ne 0 ]; then | ||
ERROR "dockerd is not running after max time" | ||
exit 1 | ||
else | ||
INFO "dockerd is running" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters