本地 GitLab 运行器冻结,而共享 GitLab.com 运行器成功
Local GitLab runner freezes while Shared GitLab.com runner succeeds
编辑:正如 Rekovni 所指出的,在 Windows 机器上使用带有 Docker 的 GitLab runner 是一个问题。 在基于 Linux 的虚拟机中安装运行程序解决了问题。
我正在使用 conda 环境开发 Python 程序。它托管在 GitLab.com 上,我正在使用 GitLab-CI 生成文档。
我为其配置了以下 .gitlab-ci.yml
文件:
image: continuumio/miniconda3:latest
before_script:
# Update conda and create environment, which is then activated.
- conda update -vvv -y -c conda-forge conda
- conda env create -f helpers/NAME.yml
- source activate NAME
# Correct installation.
- conda install -q -y gsl=2.2.1
pages:
script:
# Install make.
- apt-get update
- apt-get install -q -y build-essential
# Install Spinx-related packages.
- conda install -q -y sphinx sphinx_rtd_theme
# Create documentation.
- cd REPO/doc
- sphinx-apidoc -o source/ ../REPO --force --separate
- make html
# Transfer documentation to public pages folder.
- mv build/html/ ../../public/
artifacts:
paths:
- public
# only:
# - master
运行 此脚本与随 GitLab.com 提供的共享 GitLab 运行器一起工作,生成文档并放置在 public 文件夹中。
为了将来的单元测试(需要更长的时间),我想在我网络中的 Win 10 机器上提供一个本地运行器。为此,我安装了 gitlab-runner.exe
和 Docker 桌面。我在 GitLab.com.
上成功向项目注册了跑步者
运行器正在使用以下 config.toml
配置文件:
concurrent = 1
check_interval = 0
log_level = "info"
[session_server]
session_timeout = 1800
[[runners]]
name = "NAME"
url = "https://gitlab.com"
token = "TOKEN"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "alpine:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
现在的问题是本地运行器在执行上述脚本期间冻结,没有产生任何错误消息,我不知道如何调试它。我有的是
- GitLab.com 作业页面上显示的脚本日志;和
gitlab-runner.exe
在本地机器上的控制台输出。
关于1,我明白了
[0KRunning with gitlab-runner 11.10.0 (3001a600)
...
[32;1mChecking out COMMIT_HASH as BRANCH_NAME...[0;m
...
[0K[32;1m$ conda update -vvv -y -c conda-forge conda[0;m
DEBUG conda.gateways.logging:set_verbosity(148): verbosity set to 3
...
...
...
TRACE conda.gateways.disk.update:rename(52): renaming /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_new.html => /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_new.html.c~
TRACE conda.core.path_actions:execute(1041): renaming share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html => share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html.c~
TRACE conda.gateways.disk.update:rename(52): renaming /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html => /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html.c~
TRACE conda.core.path_actions:execute(1041): renaming share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_ctrl.html => share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_ctrl.html.c~
它在没有到达 - conda env create -f helpers/NAME.yml
行的地方突然停止。
关于2,我明白了
C:\GitLab-Runner>gitlab-runner.exe --debug run
Runtime platform arch=amd64 os=windows pid=14116 revision=3001a600 version=11.10.0Starting multi-runner from C:\GitLab-Runner\config.toml ... builds=0
Checking runtime mode GOOS=windows uid=-1
Configuration loaded builds=0
...
Feeding runners to channel builds=0
Checking for jobs... nothing runner=TOKEN
Feeding runners to channel builds=0
Checking for jobs... received job=203033130 repo_url=REPO_URL.git runner=TOKEN
...
Attaching to container HASH ... job=203033130 project=6249897 runner=TOKEN
Starting container HASH ... job=203033130 project=6249897 runner=TOKEN
Waiting for attach to finish HASH ... job=203033130 project=6249897 runner=TOKEN
Waiting for container HASH ... job=203033130 project=6249897 runner=TOKEN
Appending trace to coordinator... ok code=202 job=203033130 job-log=0-10348 job-status=running runner=TOKEN sent-log=1801-10347 status=202 Accepted
Appending trace to coordinator... ok code=202 job=203033130 job-log=0-19445 job-status=running runner=TOKEN sent-log=10348-19444 status=202 Accepted
...
Appending trace to coordinator... ok code=202 job=203033130 job-log=0-933150 job-status=running runner=TOKEN sent-log=241860-933149 status=202 Accepted
Submitting job to coordinator... ok code=200 job=203033130 job-status= runner=TOKEN
Submitting job to coordinator... ok code=200 job=203033130 job-status= runner=TOKEN
从 Appending trace to coordinator
到 Submitting job to coordinator
的切换似乎发生在它卡住的时候。
此后,1. 不再更新任何进一步的信息,2. 陷入 Submitting job to coordinator
循环。
有谁知道:
- 本地运行器失败的原因可能是什么(当同一脚本与共享运行器一起工作时)?
- 我可以做些什么来调试这个问题?
谢谢,祝一切顺利,
托马斯
GitLab CI 目前不提供在 Windows 环境中将其 运行ner 与 Docker 一起使用的解决方案,但是有一个 epic 目前正在跟踪这方面的进展。
在issues of the epic, a contributer has managed to get a working version of a gitlab-runner which uses Docker for Windows, with which more details can be found here之一。
在 Windows 环境中使用 Docker 的一种更常见(并且可能更简单)的方法是将 gitlab-运行ner 安装为 Shell 运行ner,然后手动调用 Docker 命令来 运行 你的测试。
相反,如果您只是想继续使用相同的 CI 脚本,您可以在 Windows 10 机器上安装 Linux VM,并让该主机 docker 运行呐!
编辑:正如 Rekovni 所指出的,在 Windows 机器上使用带有 Docker 的 GitLab runner 是一个问题。 在基于 Linux 的虚拟机中安装运行程序解决了问题。
我正在使用 conda 环境开发 Python 程序。它托管在 GitLab.com 上,我正在使用 GitLab-CI 生成文档。
我为其配置了以下 .gitlab-ci.yml
文件:
image: continuumio/miniconda3:latest
before_script:
# Update conda and create environment, which is then activated.
- conda update -vvv -y -c conda-forge conda
- conda env create -f helpers/NAME.yml
- source activate NAME
# Correct installation.
- conda install -q -y gsl=2.2.1
pages:
script:
# Install make.
- apt-get update
- apt-get install -q -y build-essential
# Install Spinx-related packages.
- conda install -q -y sphinx sphinx_rtd_theme
# Create documentation.
- cd REPO/doc
- sphinx-apidoc -o source/ ../REPO --force --separate
- make html
# Transfer documentation to public pages folder.
- mv build/html/ ../../public/
artifacts:
paths:
- public
# only:
# - master
运行 此脚本与随 GitLab.com 提供的共享 GitLab 运行器一起工作,生成文档并放置在 public 文件夹中。
为了将来的单元测试(需要更长的时间),我想在我网络中的 Win 10 机器上提供一个本地运行器。为此,我安装了 gitlab-runner.exe
和 Docker 桌面。我在 GitLab.com.
运行器正在使用以下 config.toml
配置文件:
concurrent = 1
check_interval = 0
log_level = "info"
[session_server]
session_timeout = 1800
[[runners]]
name = "NAME"
url = "https://gitlab.com"
token = "TOKEN"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "alpine:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
现在的问题是本地运行器在执行上述脚本期间冻结,没有产生任何错误消息,我不知道如何调试它。我有的是
- GitLab.com 作业页面上显示的脚本日志;和
gitlab-runner.exe
在本地机器上的控制台输出。
关于1,我明白了
[0KRunning with gitlab-runner 11.10.0 (3001a600)
...
[32;1mChecking out COMMIT_HASH as BRANCH_NAME...[0;m
...
[0K[32;1m$ conda update -vvv -y -c conda-forge conda[0;m
DEBUG conda.gateways.logging:set_verbosity(148): verbosity set to 3
...
...
...
TRACE conda.gateways.disk.update:rename(52): renaming /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_new.html => /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_new.html.c~
TRACE conda.core.path_actions:execute(1041): renaming share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html => share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html.c~
TRACE conda.gateways.disk.update:rename(52): renaming /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html => /opt/conda/share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_close.html.c~
TRACE conda.core.path_actions:execute(1041): renaming share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_ctrl.html => share/doc/openssl/html/man3/OSSL_STORE_LOADER_set_ctrl.html.c~
它在没有到达 - conda env create -f helpers/NAME.yml
行的地方突然停止。
关于2,我明白了
C:\GitLab-Runner>gitlab-runner.exe --debug run
Runtime platform arch=amd64 os=windows pid=14116 revision=3001a600 version=11.10.0Starting multi-runner from C:\GitLab-Runner\config.toml ... builds=0
Checking runtime mode GOOS=windows uid=-1
Configuration loaded builds=0
...
Feeding runners to channel builds=0
Checking for jobs... nothing runner=TOKEN
Feeding runners to channel builds=0
Checking for jobs... received job=203033130 repo_url=REPO_URL.git runner=TOKEN
...
Attaching to container HASH ... job=203033130 project=6249897 runner=TOKEN
Starting container HASH ... job=203033130 project=6249897 runner=TOKEN
Waiting for attach to finish HASH ... job=203033130 project=6249897 runner=TOKEN
Waiting for container HASH ... job=203033130 project=6249897 runner=TOKEN
Appending trace to coordinator... ok code=202 job=203033130 job-log=0-10348 job-status=running runner=TOKEN sent-log=1801-10347 status=202 Accepted
Appending trace to coordinator... ok code=202 job=203033130 job-log=0-19445 job-status=running runner=TOKEN sent-log=10348-19444 status=202 Accepted
...
Appending trace to coordinator... ok code=202 job=203033130 job-log=0-933150 job-status=running runner=TOKEN sent-log=241860-933149 status=202 Accepted
Submitting job to coordinator... ok code=200 job=203033130 job-status= runner=TOKEN
Submitting job to coordinator... ok code=200 job=203033130 job-status= runner=TOKEN
从 Appending trace to coordinator
到 Submitting job to coordinator
的切换似乎发生在它卡住的时候。
此后,1. 不再更新任何进一步的信息,2. 陷入 Submitting job to coordinator
循环。
有谁知道:
- 本地运行器失败的原因可能是什么(当同一脚本与共享运行器一起工作时)?
- 我可以做些什么来调试这个问题?
谢谢,祝一切顺利, 托马斯
GitLab CI 目前不提供在 Windows 环境中将其 运行ner 与 Docker 一起使用的解决方案,但是有一个 epic 目前正在跟踪这方面的进展。
在issues of the epic, a contributer has managed to get a working version of a gitlab-runner which uses Docker for Windows, with which more details can be found here之一。
在 Windows 环境中使用 Docker 的一种更常见(并且可能更简单)的方法是将 gitlab-运行ner 安装为 Shell 运行ner,然后手动调用 Docker 命令来 运行 你的测试。
相反,如果您只是想继续使用相同的 CI 脚本,您可以在 Windows 10 机器上安装 Linux VM,并让该主机 docker 运行呐!