flowey_hvlite/pipelines_shared/
gh_pools.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! Centralized list of constants enumerating available GitHub build pools.
5
6use flowey::node::prelude::FlowPlatformLinuxDistro;
7use flowey::pipeline::prelude::*;
8
9pub fn default_x86_pool(platform: FlowPlatform) -> GhRunner {
10    match platform {
11        FlowPlatform::Windows => windows_amd_self_hosted(),
12        FlowPlatform::Linux(FlowPlatformLinuxDistro::Ubuntu) => linux_self_hosted(),
13        platform => panic!("unsupported platform {platform}"),
14    }
15}
16
17pub fn default_gh_hosted(platform: FlowPlatform) -> GhRunner {
18    match platform {
19        FlowPlatform::Windows => gh_hosted_windows(),
20        FlowPlatform::Linux(FlowPlatformLinuxDistro::Ubuntu) => gh_hosted_linux(),
21        platform => panic!("unsupported platform {platform}"),
22    }
23}
24
25pub fn windows_amd_self_hosted() -> GhRunner {
26    GhRunner::SelfHosted(vec![
27        "self-hosted".to_string(),
28        "1ES.Pool=OpenVMM-GitHub-Win-Pool-WestUS3".to_string(),
29    ])
30}
31
32pub fn windows_intel_self_hosted() -> GhRunner {
33    GhRunner::SelfHosted(vec![
34        "self-hosted".to_string(),
35        "1ES.Pool=OpenVMM-GitHub-Win-Pool-Intel-WestUS3".to_string(),
36        "1ES.ImageOverride=HvLite-CI-Win-Ge-Image-256GB".to_string(),
37    ])
38}
39
40/// This overrides the default image with a larger disk image for use with
41/// jobs that require more than the default disk space (e.g. to ensure vmm_tests
42/// have enough space to download test VHDs)
43pub fn windows_amd_self_hosted_largedisk() -> GhRunner {
44    GhRunner::SelfHosted(vec![
45        "self-hosted".to_string(),
46        "1ES.Pool=OpenVMM-GitHub-Win-Pool-WestUS3".to_string(),
47        "1ES.ImageOverride=HvLite-CI-Win-Ge-Image-256GB".to_string(),
48    ])
49}
50
51/// This overrides the default image with a larger disk image for use with
52/// jobs that require more than the default disk space (e.g. to ensure vmm_tests
53/// have enough space to download test VHDs)
54pub fn windows_intel_self_hosted_largedisk() -> GhRunner {
55    GhRunner::SelfHosted(vec![
56        "self-hosted".to_string(),
57        "1ES.Pool=OpenVMM-GitHub-Win-Pool-Intel-WestUS3".to_string(),
58        "1ES.ImageOverride=HvLite-CI-Win-Ge-Image-256GB".to_string(),
59    ])
60}
61
62pub fn linux_self_hosted() -> GhRunner {
63    GhRunner::SelfHosted(vec![
64        "self-hosted".to_string(),
65        "1ES.Pool=OpenVMM-GitHub-Linux-Pool-WestUS3".to_string(),
66        "1ES.ImageOverride=MMSUbuntu22.04-256GB".to_string(),
67    ])
68}
69
70pub fn gh_hosted_windows() -> GhRunner {
71    GhRunner::GhHosted(GhRunnerOsLabel::WindowsLatest)
72}
73
74pub fn gh_hosted_linux() -> GhRunner {
75    GhRunner::GhHosted(GhRunnerOsLabel::UbuntuLatest)
76}
77
78pub fn windows_arm_self_hosted_baremetal() -> GhRunner {
79    GhRunner::SelfHosted(vec![
80        "self-hosted".to_string(),
81        "Windows".to_string(),
82        "ARM64".to_string(),
83        "Baremetal".to_string(),
84    ])
85}
86
87pub fn windows_tdx_self_hosted_baremetal() -> GhRunner {
88    GhRunner::SelfHosted(vec![
89        "self-hosted".to_string(),
90        "Windows".to_string(),
91        "X64".to_string(),
92        "TDX".to_string(),
93        "Baremetal".to_string(),
94    ])
95}