Correct cleanup gitlab-ci
Found the issue on regular testing hosts: [1] Fetching changes... 00:04 Reinitialized existing Git repository in /home/gitlab-runner/builds/zzyC6hh5/0/tarantool/tarantool/.git/ Checking out 8ff7f32c as ... warning: failed to remove CMakeFiles/Makefile.cmake Found the job that saved the directories with root permissions: [2] The issue appeared because the job that saved directories with root permissions used the 'shell' runner to run docker container inside. It caused the gitlab-runner to run the default workspace cleanup outside the docker container. In opposite to it, when 'docker' runner is used, the cleanup routine runs inside the docker container and no fails ever exist, because the root permissions are used in the docker container and this is the same root permissions for the host. As the result using 'shell' runner, cleanup routine failed to remove files created by root inside the docker container and which were shared to global host with the same permissions, because gitlab-runner runs the 'shell' runner by regular 'gitlab-runner' user, but not by root. To fix the issue need to run docker containers using the gitlab-runner only in RO mode with Out-Of-Source builds in it. Either use the 'docker' runners when docker containers are needed. Anyway 'shell' runner jobs with additional calls to docker containers can't be control for the branches of developers, to avoid of it need to make local cleanup routine instead of default to the working paths for each job with 'shell' runners use. Decided to setup gitlab-runner configuration as described in: [3] Also got the issue with left data from previous builds at the submodule pathes, like here: [4] Undefined symbols for architecture x86_64: "_u_isprint_66", referenced from: _yaml_emitter_is_printable in libyaml_static.a(emitter.c.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (...) Also got issues with left files from previously tested branches, like here: [5] [087] small/rlist.test [087] TAP13 parse failed (Missing plan in the TAP source). [087] [087] No result file (small/rlist.result) found. [087] Run the test with --update-result option to write the new result file. [087] [ fail ] [087] small/static.test [087] TAP13 parse failed (Missing plan in the TAP source). [087] [087] No result file (small/static.result) found. [087] Run the test with --update-result option to write the new result file. [087] [ fail ] To fix it was added the command to clean all available git submodules: git submodule foreach git clean -ffdx Closes #5036 1. https://gitlab.com/tarantool/tarantool/-/jobs/577884238#L7 2. https://gitlab.com/tarantool/tarantool/-/jobs/577768553 3. https://docs.gitlab.com/ce/ci/yaml/README.html#git-clean-flags 4. https://gitlab.com/tarantool/tarantool/-/jobs/574199256#L3141 5. https://gitlab.com/tarantool/tarantool/-/jobs/590573606#L3718
Please register or sign in to comment