【问题标题】:GitLab Runner Parallels Executor & Windows 10 VM - Stuck "Creating new VM..."GitLab Runner Parallels Executor & Windows 10 VM - 卡住“正在创建新的 VM...”
【发布时间】:2020-01-14 02:47:16
【问题描述】:

总结

嗨,

我最初发布了一个我认为是 GitLab Runner 错误的问题,但遗憾的是在 GitLab-Runner repository 上没有收到任何回复。

我正在使用 Parallels Executor 来测试/构建/部署 Electron+React 应用程序,该应用程序使用预先准备好的 MacOS 和 Windows 10 VM,它们也启用了 SSH 访问(也经过测试)。

在注册跑步者时,我将相关的 SSH 用户和密码详细信息添加到 config.toml

当新版本通过、管道成功时,MacOS 映像工作正常。但是,Windows 10 阶段只是无休止地挂起并超时:
Screenshot of error in the Runner pipeline

Runner 接收作业,Parallels 甚至创建模板 VM 和链接图像。看起来 GitLab Runner 似乎没有收到对此的确认,并且没有做任何事情,这导致工作在多次重新尝试后超时。

很难知道 Windows 是否缺少一些复杂的东西,或者这是否可能是 Gitlab Runner 本身的错误。

有什么想法吗?

重现步骤

  • 创建 Windows 10 Parallels VM 并安装/配置 OpenSSH
  • 使用 Parallels 作为执行器注册一个运行器
  • 编辑config.toml并在[runners.ssh]部分下添加SSH用户和密码
  • 确保 Windows 10 VM 映像已正确关闭(未挂起)
  • 运行构建并观察上述情况发生

Gitlab-ci yaml 文件


stages:
  - test

test-win10:
    stage: test
    tags:
    - windows10
    variables:
      NODE_ENV: "development"
      DEBUG_MODE: 'true'
    script:
      - npm install
      - npm run test

实际行为

Parallels 将根据它创建的模板启动 Windows 10 虚拟机。从那里开始,构建过程将不再继续,您将得到一个愉快地运行的 Windows 10 VM,执行 0。一小时后构建将失败。

预期行为

定义的阶段应该完成!

跑步者输出日志

1 Running with gitlab-runner 12.6.0 (ac8e767a)
2   on [Ravs iMac]Parallels Windows 10 VM rpMNC3Qo
3
Using Parallels 14.1.0 executor...
4 Creating new VM...
5 ERROR: Preparation failed: PrlctlOutput error: 
6 Will be retried in 3s ...
7 Using Parallels 14.1.0 executor...
8 Creating new VM...
9 ERROR: Preparation failed: PrlctlOutput error: 
10 Will be retried in 3s ...
11 Using Parallels 14.1.0 executor...
12 Creating new VM...
13 ERROR: Job failed: execution took longer than 1h0m0s seconds

Config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "[Ravs iMac]Parallels MacOS VM"
  url = "https://gitlab.com/"
  token = "**********"
  executor = "parallels"
  [runners.custom_build_dir]
  [runners.ssh]
    user = "ci"
    password = "password"
    host = "macos-ci.shared"
    port = "22"
  [runners.parallels]
    base_name = "macOS_CI"
    disable_snapshots = false
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

[[runners]]
  name = "[Ravs iMac]Parallels Windows 10 VM"
  url = "https://gitlab.com"
  token = "**********"
  executor = "parallels"
  [runners.custom_build_dir]
  [runners.ssh]
    user = "ci"
    password = "password"
    host = "10.211.55.5"
    port = "22"
  [runners.parallels]
    base_name = "Windows10_CI"
    disable_snapshots = false
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

使用 GitLab Runner 版本

Version:      12.6.0
Git revision: ac8e767a
Git branch:   12-6-stable
GO version:   go1.13.4
Built:        2019-12-22T11:55:34+0000
OS/Arch:      darwin/amd64

Parallels 版本

版本 14.1.0 (45387) 商业版

可能的修复

不适用

【问题讨论】:

    标签: gitlab gitlab-ci gitlab-ci-runner parallels


    【解决方案1】:

    我多年来一直有这个问题。刚刚尝试了一个新的 gitlab-runner 设置(在 Mac 上使用 gitlab-runner,在 Parallels 下使用 Win10),它不起作用。

    gitlab-runner 输出中有一个明显的错误:

    ERROR: Job failed (system failure): IP lease not found for MAC address 001C42C13862 in: /Library/Preferences/Parallels/parallels_dhcp_leases  duration=6m40.688084247s job=1125551877 project=25368177 runner=xz2gps
    

    我(去年)追踪了这一点,结果发现虚拟机的克隆给了它一个新的 MAC 地址,而 gitlab-runner 寻找旧的 MAC 地址(原始虚拟机的,而不是克隆的)。所以 gitlab-runner 认为 VM 还没有启动。

    奇怪的是,我在 MacOS Parallels VM 上完全相同设置相同,而 gitlab-runner 完全没有问题。

    2 年来我一直在寻找解决方案,但没有任何结果。主要是在这里回复老帖,希望哪天有人能找到并贴出解决办法。

    [更新]

    我可能找到了解决方法。问题似乎是克隆的 Windows VM 使用旧的 MAC 地址(来自克隆父),而不是新的。 (所以这与我在上一个答案中的建议相反)。

    解决方法是,在我构建 Windows VM 并关闭它之后,在我运行 gitlab-runner 之前,我更改父 VM 的 Parallels 网络配置,并给它一个新的 MAC 地址和不同类型的网卡.并且永远不要再次运行它。克隆然后会出现并看到一个新的网卡,并获得正确的新 MAC 地址。

    这是否是一个长期的解决方案还有待观察......

    【讨论】:

    • 你不能用你作为另一个答案发布的额外信息来更新这个答案吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-12
    • 2021-12-24
    • 1970-01-01
    相关资源
    最近更新 更多