GitLab 作业在具有相同图像的不同(docker)运行器上失败

问题描述 投票:0回答:1

我们通常通过 helm-chart 使用我们自己的 Kubernetes 运行器设置来运行 GitLab。对于特殊工作,我们希望使用具有 ubuntu 22.04lts、dind 权限和更多功能的虚拟机。设置成功,使用我们设置的初始默认图像的作业

python:3.11-alpine
正在按预期运行。但是,其他作业失败,并出现一些随机的文件未找到错误。 例如,yaml-lint 失败并出现以下错误:

Using docker image sha256:68d3b7d6ad2e3001699585e293d0458ca50cd2b2703a3411bcb88f5f56184f43 for cytopia/yamllint:latest with digest cytopia/yamllint@sha256:3e9eb827ab2b12a5ea5f49d4257bb3aca94bba9f1ba427c8bc7f2456385a5204 ...
Traceback (most recent call last):
  File "/usr/bin/yamllint", line 8, in <module>
    sys.exit(run())
  File "/usr/lib/python3.10/site-packages/yamllint/cli.py", line 208, in run
    conf = YamlLintConfig(file=args.config_file)
  File "/usr/lib/python3.10/site-packages/yamllint/config.py", line 41, in __init__
    with open(file) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash \nelif [ -x /usr/bin/bash ]; then\n\texec /usr/bin/bash \nelif [ -x /bin/bash ]; then\n\texec /bin/bash \nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh \nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh \nelif [ -x /bin/sh ]; then\n\texec /bin/sh \nelif [ -x /busybox/sh ]; then\n\texec /busybox/sh \nelse\n\techo shell not found\n\texit 1\nfi\n\n'

对于 selenium 作业,当尝试安装 pip 依赖项时,我们会得到多个

[Errno 13] Permission denied: '/usr/lib/python3/dist-packages/wheel/__pycache__/__init__.cpython-38.pyc.139824642997424'
,最后是
E: Sub-process /usr/bin/dpkg returned an error code (1)

我们尝试更改

config.toml
并更改默认图像,但错误仍然存在。在 Kubernetes 中运行 docker 而不是 VM docker 设置时,路径是否可能不同?

docker kubernetes gitlab kubernetes-helm cicd
1个回答
0
投票

解决方案是卸载docker(snap包)并通过

apt
重新安装。了解为什么会这样以及 snap 包对容器内的权限有影响还是很有趣的。

© www.soinside.com 2019 - 2024. All rights reserved.