Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 本地GitLab运行程序冻结,而共享GitLab.com运行程序成功_Python_Gitlab_Conda_Gitlab Ci_Gitlab Ci Runner - Fatal编程技术网

Python 本地GitLab运行程序冻结,而共享GitLab.com运行程序成功

Python 本地GitLab运行程序冻结,而共享GitLab.com运行程序成功,python,gitlab,conda,gitlab-ci,gitlab-ci-runner,Python,Gitlab,Conda,Gitlab Ci,Gitlab Ci Runner,编辑:正如Rekovni指出的,在Windows机器上使用带有Docker的GitLab runner是一个问题在基于Linux的虚拟机中安装runner解决了问题。 我正在使用conda环境开发一个Python程序。它托管在GitLab.com上,我正在使用GitLab CI生成文档 我为它配置了以下.gitlab ci.yml文件: 图像:continuMio/miniconda3:最新版本 在脚本之前: #更新conda并创建环境,然后激活该环境。 -康达更新-vvv-y-c康达锻造康达

编辑:正如Rekovni指出的,在Windows机器上使用带有Docker的GitLab runner是一个问题在基于Linux的虚拟机中安装runner解决了问题。


我正在使用conda环境开发一个Python程序。它托管在GitLab.com上,我正在使用GitLab CI生成文档

我为它配置了以下
.gitlab ci.yml
文件:

图像:continuMio/miniconda3:最新版本
在脚本之前:
#更新conda并创建环境,然后激活该环境。
-康达更新-vvv-y-c康达锻造康达
-conda env create-f helpers/NAME.yml
-源激活名称
#正确安装。
-康达安装-q-y gsl=2.2.1
页:
脚本:
#安装make。
-apt获取更新
-apt-get-install-q-y-build-sential
#安装与Spinx相关的软件包。
-康达安装-q-y斯芬克斯斯芬克斯主题
#创建文档。
-cd回购/文件
-斯芬克斯apidoc-o来源/。/REPO——强制——分离
-制作html
#将文档转移到公用页文件夹。
-mv build/html/./../public/
人工产品:
路径:
-公开的
#仅:
#-主人
使用GitLab.com提供的共享GitLab runner运行此脚本会起作用,文档会生成并放置在公用文件夹中

对于未来的单元测试(需要更长的时间),我想在我的网络中的Win10机器上提供一个本地运行程序。为此,我安装了
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 
    
    向协调器添加跟踪
    向协调器提交作业
    的切换似乎发生在作业卡住的前后。 在这之后,1。未更新任何进一步信息和2。卡在向协调员提交作业的
    循环中

    有谁知道:

  • 本地运行程序失败的原因可能是什么(当同一脚本与共享运行程序一起工作时)
  • 我能做些什么来调试这个问题
  • 谢谢你,祝你一切顺利,
    Thomas

    GitLab CI目前没有提供在Windows环境下使用runner with Docker的解决方案,但是目前有一个解决方案正在跟踪这方面的进展

    在epic的其中一个版本中,一位贡献者设法获得了一个使用Docker for Windows的gitlab runner的工作版本,通过该版本可以找到更多详细信息

    在Windows环境中使用Docker的一种更常见(而且可能更容易)的方法是将gitlab runner安装为Shell runner,并手动调用Docker命令来运行测试


    相反,如果您只想继续使用相同的CI脚本,您可以在Windows 10计算机上安装Linux虚拟机,并让该主机运行docker runner

    非常感谢您提供的信息。可以肯定的是,您的意思是,目前在Windows机器上运行GitLab Runner和Docker是一个问题。这与Docker映像本身无关-正确吗?。因为在我的情况下,只有Windows是机器。Docker映像是基于Linux的。好吧,这可能是一个完全独立的问题,值得一读:正如你所建议的,我用Ubuntu客户端托管了一个VM。在其中,我安装了GitLab runner。这似乎奏效了。