Skip to main content

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::pipeline::prelude::*;
7
8// Constants in this file may be added, renamed or deleted, but the values
9// of these constants should not be changed to avoid changing the image to one
10// that may not be present in all of the pools where the constant is used
11// (in both GitHub and ADO).
12pub const WINDOWS_IMAGE_AMD64_V2: &str = "win-amd64-v2";
13pub const WINDOWS_IMAGE_ARM64_V2: &str = "win-arm64-v2";
14pub const LINUX_IMAGE_AMD64: &str = "ubuntu2404-amd64";
15pub const LINUX_IMAGE_ARM64: &str = "ubuntu2404-arm64";
16pub const MSHV_IMAGE_AMD64: &str = "azurelinux3-amd64-dom0";
17
18pub const AMD_V6_POOL_1ES: &str = "openvmm-gh-amd-westus3-v6";
19pub const AMD_V7_POOL_1ES: &str = "openvmm-gh-amd-westus3-v7";
20pub const INTEL_V5_POOL_1ES: &str = "openvmm-gh-intel-westus3";
21pub const INTEL_V6_POOL_1ES: &str = "openvmm-gh-intel-westus3-v6";
22pub const ARM_V5_POOL_1ES: &str = "openvmm-gh-arm-westus2";
23pub const ARM_V6_POOL_1ES: &str = "openvmm-gh-arm-westus3";
24
25fn gh_pool_with_image_1es(pool: &str, image: &str) -> GhRunner {
26    GhRunner::SelfHosted(vec![
27        "self-hosted".to_string(),
28        format!("1ES.Pool={pool}"),
29        format!("1ES.ImageOverride={image}"),
30    ])
31}
32
33pub fn windows_arm_v6_1es() -> GhRunner {
34    gh_pool_with_image_1es(ARM_V6_POOL_1ES, WINDOWS_IMAGE_ARM64_V2)
35}
36
37pub fn windows_amd_v6_1es() -> GhRunner {
38    gh_pool_with_image_1es(AMD_V6_POOL_1ES, WINDOWS_IMAGE_AMD64_V2)
39}
40
41pub fn windows_intel_v6_1es() -> GhRunner {
42    gh_pool_with_image_1es(INTEL_V6_POOL_1ES, WINDOWS_IMAGE_AMD64_V2)
43}
44
45pub fn linux_arm_v5_1es() -> GhRunner {
46    gh_pool_with_image_1es(ARM_V5_POOL_1ES, LINUX_IMAGE_ARM64)
47}
48
49pub fn linux_intel_v6_1es() -> GhRunner {
50    gh_pool_with_image_1es(INTEL_V6_POOL_1ES, LINUX_IMAGE_AMD64)
51}
52
53pub fn linux_amd_v7_1es() -> GhRunner {
54    gh_pool_with_image_1es(AMD_V7_POOL_1ES, LINUX_IMAGE_AMD64)
55}
56
57pub fn linux_mshv_intel_v5_1es() -> GhRunner {
58    gh_pool_with_image_1es(INTEL_V5_POOL_1ES, MSHV_IMAGE_AMD64)
59}
60
61pub fn windows_x64_gh() -> GhRunner {
62    GhRunner::GhHosted(GhRunnerOsLabel::WindowsLatest)
63}
64
65pub fn linux_x64_gh() -> GhRunner {
66    GhRunner::GhHosted(GhRunnerOsLabel::UbuntuLatest)
67}
68
69pub fn windows_arm_gh() -> GhRunner {
70    GhRunner::GhHosted(GhRunnerOsLabel::Windows11Arm)
71}
72
73pub fn linux_arm_gh() -> GhRunner {
74    GhRunner::GhHosted(GhRunnerOsLabel::Ubuntu2404Arm)
75}
76
77pub fn windows_arm_self_hosted_baremetal() -> GhRunner {
78    GhRunner::SelfHosted(vec![
79        "self-hosted".to_string(),
80        "Windows".to_string(),
81        "ARM64".to_string(),
82        "Baremetal".to_string(),
83    ])
84}
85
86pub fn windows_tdx_gnr_self_hosted_baremetal() -> GhRunner {
87    GhRunner::SelfHosted(vec![
88        "self-hosted".to_string(),
89        "Windows".to_string(),
90        "X64".to_string(),
91        "TDX".to_string(),
92        "GNR".to_string(),
93        "Baremetal".to_string(),
94    ])
95}
96
97pub fn windows_snp_self_hosted_baremetal() -> GhRunner {
98    GhRunner::SelfHosted(vec![
99        "self-hosted".to_string(),
100        "Windows".to_string(),
101        "X64".to_string(),
102        "SNP".to_string(),
103        "Baremetal".to_string(),
104    ])
105}
106
107pub fn default_windows() -> GhRunner {
108    windows_intel_v6_1es()
109}
110
111pub fn default_linux() -> GhRunner {
112    linux_amd_v7_1es()
113}