This is an automated email from the ASF dual-hosted git repository. jstastnycz pushed a commit to branch kie-issues_747 in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git
commit b93d69a288de78bf6bf9ef30f921b20e65406b83 Author: jstastny-cz <[email protected]> AuthorDate: Wed Dec 6 19:30:43 2023 +0100 kie-issues#747: adjust kogito-ci-build image to remove jenkins consistency error --- apache-nodes/entrypoint.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/apache-nodes/entrypoint.sh b/apache-nodes/entrypoint.sh index a1247741..b8d4ee07 100755 --- a/apache-nodes/entrypoint.sh +++ b/apache-nodes/entrypoint.sh @@ -1,20 +1,25 @@ #!/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" +# To make jenkins docker plugin happy container is supposed to process command passed to it and not perform entrypoint first. +# https://github.com/docker-library/official-images#consistency +# Start docker if a shell is opened or docker cmd passed directly +if [[ $# -eq 0 ]] || [[ "$1" = @(sh|bash|docker) ]]; then + # 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 + + # Start docker + start-docker.sh fi -if [ $# -gt 0 ]; then - exec "$@" -fi \ No newline at end of file +# process the command passed, only for some (if above) docker is started before +exec "$@" --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
