{{< details >}}
- Tier: 基础版,专业版,旗舰版
- Offering: JihuLab.com
- Status: Beta
{{< /details >}}
极狐GitLab 托管 runner 在 Windows 上通过在 Google Cloud Platform 上启动虚拟机进行自动扩展。此解决方案使用了极狐GitLab 为 自定义执行器 开发的自动扩展驱动程序。Windows 上的托管 runner 处于 beta 阶段。
我们希望不断迭代,以使 Windows runner 达到稳定状态并 普遍可用。
Windows 可用的机器类型
极狐GitLab 为 Windows 上的托管 runner 提供以下机器类型。
Runner 标签 | vCPUs | 内存 | 存储 |
---|---|---|---|
saas-windows-medium-amd64 |
2 | 7.5 GB | 75 GB |
支持的 Windows 版本
Windows runner 虚拟机实例不使用极狐GitLab Docker 执行器。这意味着您不能在流水线配置中指定 image
或 services
。
您可以在以下 Windows 版本之一中执行您的工作:
版本 | 状态 |
---|---|
Windows 2022 | GA |
支持的 shell
Windows 上的托管 runner 配置了 PowerShell 作为 shell。因此,您的 .gitlab-ci.yml
文件的 script
部分需要 PowerShell 命令。
示例 .gitlab-ci.yml
文件
下面是一个示例 .gitlab-ci.yml
文件,展示了如何开始在 Windows 上使用 runner:
.windows_job:
tags:
- saas-windows-medium-amd64
before_script:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME} / @${GITLAB_USER_LOGIN}"
build:
extends:
- .windows_job
stage: build
script:
- echo "running scripts in the build job"
test:
extends:
- .windows_job
stage: test
script:
- echo "running scripts in the test job"
已知问题
- 有关 beta 功能支持的更多信息,请参阅 beta。
- 新的 Windows 虚拟机 (VM) 的平均配置时间为五分钟,因此在 beta 期间,您可能会注意到 Windows runner 队列上的构建启动时间较慢。建议在未来版本中更新自动扩展程序以启用虚拟机的预配置。此更新旨在显著减少在 Windows 队列上配置 VM 的时间。
- Windows runner 队列可能会因维护或更新而偶尔不可用。
- 该工作可能会比 Linux runner 更长时间处于待处理状态。
- 我们可能会引入破坏性更改,这将需要更新正在使用 Windows runner 队列的流水线。