terraform/hydra: split and refactor

This commit is contained in:
zowoq 2024-10-22 17:58:57 +10:00
parent c24dee8bf9
commit bcef8e52a8
3 changed files with 98 additions and 143 deletions

View file

@ -19,3 +19,7 @@ Built on `nixos-$RELEASE-small` for `x86_64-linux`:
All of the above builds are pushed to the cache.
See [here](./cache.md) for details.
#### Hydra
The hydra configuration for these package sets is managed in this [file](https://github.com/nix-community/infra/blob/master/terraform/hydra-nixpkgs.tf).

View file

@ -0,0 +1,94 @@
locals {
jobset = {
cuda = {
name = "cuda"
description = "Testing CUDA support. Come help the CUDA team! https://nixos.org/community/teams/cuda/"
nixpkgs_channel = "https://github.com/NixOS/nixpkgs.git nixos-unstable-small"
nixpkgs_release_file = "pkgs/top-level/release-cuda.nix"
scheduling_shares = 6000
supported_systems = "[ \"x86_64-linux\" ]"
}
cuda_stable = {
name = "cuda-stable"
description = "Testing CUDA support. Come help the CUDA team! https://nixos.org/community/teams/cuda/"
nixpkgs_channel = "https://github.com/NixOS/nixpkgs.git nixos-24.05-small"
nixpkgs_release_file = "pkgs/top-level/release-cuda.nix"
scheduling_shares = 6000
supported_systems = "[ \"x86_64-linux\" ]"
}
rocm = {
name = "rocm"
description = "Testing ROCm support."
nixpkgs_channel = "https://github.com/NixOS/nixpkgs.git nixos-unstable-small"
nixpkgs_release_file = "pkgs/top-level/release-cuda.nix"
scheduling_shares = 6000
supported_systems = "[ \"x86_64-linux\" ]"
variant = "rocm"
}
}
}
resource "hydra_jobset" "nixpkgs_jobset" {
for_each = local.jobset
project = hydra_project.nixpkgs.name
state = "enabled"
visible = true
name = each.value.name
type = "legacy"
description = each.value.description
nix_expression {
file = each.value.nixpkgs_release_file
input = "nixpkgs"
}
input {
name = "nixpkgs"
type = "git"
value = each.value.nixpkgs_channel
notify_committers = false
}
dynamic "input" {
for_each = [for variant in [lookup(each.value, "variant", null)] : variant if variant != null]
content {
name = "variant"
type = "string"
value = input.value
notify_committers = false
}
}
input {
name = "officialRelease"
type = "boolean"
value = "false"
notify_committers = false
}
input {
name = "supportedSystems"
type = "nix"
value = each.value.supported_systems
notify_committers = false
}
check_interval = 1800
scheduling_shares = each.value.scheduling_shares
keep_evaluations = 1
email_notifications = false
email_override = ""
}
resource "hydra_project" "nixpkgs" {
name = "nixpkgs"
display_name = "nixpkgs"
description = "you know what this is"
homepage = "https://github.com/NixOS/nixpkgs"
owner = "admin"
enabled = true
visible = true
}

View file

@ -69,146 +69,3 @@ resource "hydra_project" "simple_nixos_mailserver" {
value = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver"
}
}
resource "hydra_project" "nixpkgs" {
name = "nixpkgs"
display_name = "nixpkgs"
description = "you know what this is"
homepage = "https://github.com/NixOS/nixpkgs"
owner = "admin"
enabled = true
visible = true
}
resource "hydra_jobset" "nixpkgs_cuda" {
project = hydra_project.nixpkgs.name
state = "enabled"
visible = true
name = "cuda"
type = "legacy"
description = "Testing CUDA support. Come help the CUDA team! https://nixos.org/community/teams/cuda/"
nix_expression {
file = "pkgs/top-level/release-cuda.nix"
input = "nixpkgs"
}
input {
name = "nixpkgs"
type = "git"
value = "https://github.com/NixOS/nixpkgs.git nixos-unstable-small"
notify_committers = false
}
input {
name = "officialRelease"
type = "boolean"
value = "false"
notify_committers = false
}
input {
name = "supportedSystems"
type = "nix"
value = "[ \"x86_64-linux\" ]"
notify_committers = false
}
check_interval = 1800
scheduling_shares = 6000
keep_evaluations = 1
email_notifications = false
email_override = ""
}
resource "hydra_jobset" "nixpkgs_cuda_stable" {
project = hydra_project.nixpkgs.name
state = "enabled"
visible = true
name = "cuda-stable"
type = "legacy"
description = "Testing CUDA support. Come help the CUDA team! https://nixos.org/community/teams/cuda/"
nix_expression {
file = "pkgs/top-level/release-cuda.nix"
input = "nixpkgs"
}
input {
name = "nixpkgs"
type = "git"
value = "https://github.com/NixOS/nixpkgs.git nixos-24.05-small"
notify_committers = false
}
input {
name = "officialRelease"
type = "boolean"
value = "false"
notify_committers = false
}
input {
name = "supportedSystems"
type = "nix"
value = "[ \"x86_64-linux\" ]"
notify_committers = false
}
check_interval = 1800
scheduling_shares = 6000
keep_evaluations = 1
email_notifications = false
email_override = ""
}
resource "hydra_jobset" "nixpkgs_rocm" {
project = hydra_project.nixpkgs.name
state = "enabled"
visible = true
name = "rocm"
type = "legacy"
description = "Testing ROCm support."
nix_expression {
file = "pkgs/top-level/release-cuda.nix"
input = "nixpkgs"
}
input {
name = "variant"
type = "string"
value = "rocm"
notify_committers = false
}
input {
name = "nixpkgs"
type = "git"
value = "https://github.com/NixOS/nixpkgs.git nixos-unstable-small"
notify_committers = false
}
input {
name = "officialRelease"
type = "boolean"
value = "false"
notify_committers = false
}
input {
name = "supportedSystems"
type = "nix"
value = "[ \"x86_64-linux\" ]"
notify_committers = false
}
check_interval = 1800
scheduling_shares = 6000
keep_evaluations = 1
email_notifications = false
email_override = ""
}