Skip to content

Commit

Permalink
Create sle maintenance update pipeline nue (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximenoel8 authored Oct 9, 2024
1 parent 2255b2c commit fa99ee7
Show file tree
Hide file tree
Showing 9 changed files with 543 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def clientTestingStages() {
tests["${node}"] = {
// Generate a temporary list that comprises of all the minions except the one currently undergoing testing.
// This list is utilized to establish an SSH session exclusively with the minion undergoing testing.
def temporaryList = nodesHandler.envVariableList.toList() - node.toUpperCase()
def temporaryList = nodesHandler.envVariableList.toList() - node.replaceAll('sles', 'sle').toUpperCase()
def nodeTag = node.replace('sles1','sle1')
stage("${node}") {
echo "Testing ${node}"
Expand Down Expand Up @@ -532,7 +532,7 @@ def getNodesHandler() {
// This difference will be the nodes to disable
def disabledNodes = nodeList.findAll { !nodesToRun.contains(it) }
// Convert this list to cucumber compatible environment variable
def envVarDisabledNodes = disabledNodes.collect { it.toUpperCase() }
def envVarDisabledNodes = disabledNodes.collect { it.replaceAll('sles', 'sle').toUpperCase() }
// Create a node list without the disabled nodes. ( use to configure the client stage )
def nodeListWithDisabledNodes = nodeList - disabledNodes
// Create a map storing mu synchronization state for each minion.
Expand Down
50 changes: 50 additions & 0 deletions jenkins_pipelines/environments/manager-4.3-qe-sle-update-NUE
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env groovy

node('sumaform-cucumber') {
def minionList = 'sles15sp4_minion'
properties([
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '3')),
disableConcurrentBuilds(),
parameters([
string(name: 'cucumber_gitrepo', defaultValue: 'https://github.com/SUSE/spacewalk.git', description: 'Testsuite Git Repository'),
string(name: 'cucumber_ref', defaultValue: 'Manager-4.3', description: 'Branch prepared for the MU tested'),
string(name: 'tf_file', defaultValue: 'susemanager-ci/terracumber_config/tf_files/SUSEManager-4.3-SLE-update-NUE.tf', description: 'Path to the tf file to be used'),
string(name: 'sumaform_gitrepo', defaultValue: 'https://github.com/uyuni-project/sumaform.git', description: 'Sumaform Git Repository'),
string(name: 'sumaform_ref', defaultValue: 'master', description: 'Sumaform Git reference (branch, tag...)'),
choice(name: 'sumaform_backend', choices: ['libvirt'], description: 'Sumaform backend to be used (see https://github.com/uyuni-project/sumaform#backend-choice)'),
choice(name: 'terraform_bin', choices: ['/usr/bin/terraform'], description: 'Terraform binary path'),
choice(name: 'terraform_bin_plugins', choices: ['/usr/bin'], description: 'Terraform plugins path'),
string(name: 'terraform_parallelism', defaultValue: '', description: 'Advanced: Define the number of parallel resource operations for terraform'),
// Temporary: should move to uyuni-project
string(name: 'terracumber_gitrepo', defaultValue: 'https://github.com/uyuni-project/terracumber.git', description: 'Terracumber Git Repository'),
string(name: 'terracumber_ref', defaultValue: 'master', description: 'Terracumber Git ref (branch, tag...)'),
extendedChoice(name: 'minions_to_run', multiSelectDelimiter: ', ', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_CHECKBOX', visibleItemCount: 15,
value: minionList,
defaultValue: minionList,
description: 'Node list to run during BV'),
// This is different than other pipelines to make it work with the simple proxy_traditional without refactoring all feature files
booleanParam(name: 'use_previous_terraform_state', defaultValue: true, description: 'Use previous Terraform state'),
booleanParam(name: 'must_deploy', defaultValue: true, description: 'Deploy'),
booleanParam(name: 'must_run_core', defaultValue: true, description: 'Run Core features'),
booleanParam(name: 'must_sync', defaultValue: true, description: 'Sync. products and channels'),
booleanParam(name: 'enable_proxy_stages', defaultValue: true, description: 'Run Proxy stages'),
booleanParam(name: 'enable_client_stages', defaultValue: true, description: 'Run Client stages'),
booleanParam(name: 'must_add_MU_repositories', defaultValue: true, description: 'Add MU channels'),
booleanParam(name: 'must_add_non_MU_repositories', defaultValue: true, description: 'Add non MU channels'),
booleanParam(name: 'must_add_keys', defaultValue: true, description: 'Add Activation Keys'),
booleanParam(name: 'must_create_bootstrap_repos', defaultValue: true, description: 'Create bootstrap repositories'),
booleanParam(name: 'must_boot_node', defaultValue: true, description: 'Bootstrap Node'),
booleanParam(name: 'must_run_tests', defaultValue: true, description: 'Run Smoke Tests'),
booleanParam(name: 'must_run_containerization_tests', defaultValue: false, description: 'Run Containerization Tests'),
booleanParam(name: 'confirm_before_continue', defaultValue: false, description: 'Confirmation button between stages'),
text(name: 'custom_repositories', defaultValue: '{}', description: 'Salt & Client Tools SLE Update Repositories for each client, in json format')
])
])

stage('Checkout pipeline') {
checkout scm
}
non_MU_channels_tasks_file = 'susemanager-ci/jenkins_pipelines/data/non_MU_channels_tasks_43.json'
def pipeline = load "jenkins_pipelines/environments/common/pipeline-build-validation.groovy"
pipeline.run(params)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ node('sumaform-cucumber-provo') {
parameters([
string(name: 'cucumber_gitrepo', defaultValue: 'https://github.com/SUSE/spacewalk.git', description: 'Testsuite Git Repository'),
string(name: 'cucumber_ref', defaultValue: 'Manager-4.3', description: 'Branch prepared for the MU tested'),
string(name: 'tf_file', defaultValue: 'susemanager-ci/terracumber_config/tf_files/SUSEManager-4.3-SLE-update.tf', description: 'Path to the tf file to be used'),
string(name: 'tf_file', defaultValue: 'susemanager-ci/terracumber_config/tf_files/SUSEManager-4.3-SLE-update-PRV.tf', description: 'Path to the tf file to be used'),
string(name: 'sumaform_gitrepo', defaultValue: 'https://github.com/uyuni-project/sumaform.git', description: 'Sumaform Git Repository'),
string(name: 'sumaform_ref', defaultValue: 'master', description: 'Sumaform Git reference (branch, tag...)'),
choice(name: 'sumaform_backend', choices: ['libvirt'], description: 'Sumaform backend to be used (see https://github.com/uyuni-project/sumaform#backend-choice)'),
Expand Down
50 changes: 50 additions & 0 deletions jenkins_pipelines/environments/manager-5.0-qe-sle-update-NUE
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env groovy

node('sumaform-cucumber') {
def minionList = 'sles15sp6_minion'
properties([
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '3')),
disableConcurrentBuilds(),
parameters([
string(name: 'cucumber_gitrepo', defaultValue: 'https://github.com/SUSE/spacewalk.git', description: 'Testsuite Git Repository'),
string(name: 'cucumber_ref', defaultValue: 'Manager-5.0', description: 'Branch prepared for the MU tested'),
string(name: 'tf_file', defaultValue: 'susemanager-ci/terracumber_config/tf_files/SUSEManager-5.0-SLE-update-NUE.tf', description: 'Path to the tf file to be used'),
string(name: 'sumaform_gitrepo', defaultValue: 'https://github.com/uyuni-project/sumaform.git', description: 'Sumaform Git Repository'),
string(name: 'sumaform_ref', defaultValue: 'master', description: 'Sumaform Git reference (branch, tag...)'),
choice(name: 'sumaform_backend', choices: ['libvirt'], description: 'Sumaform backend to be used (see https://github.com/uyuni-project/sumaform#backend-choice)'),
choice(name: 'terraform_bin', choices: ['/usr/bin/terraform'], description: 'Terraform binary path'),
choice(name: 'terraform_bin_plugins', choices: ['/usr/bin'], description: 'Terraform plugins path'),
string(name: 'terraform_parallelism', defaultValue: '', description: 'Advanced: Define the number of parallel resource operations for terraform'),
// Temporary: should move to uyuni-project
string(name: 'terracumber_gitrepo', defaultValue: 'https://github.com/uyuni-project/terracumber.git', description: 'Terracumber Git Repository'),
string(name: 'terracumber_ref', defaultValue: 'master', description: 'Terracumber Git ref (branch, tag...)'),
extendedChoice(name: 'minions_to_run', multiSelectDelimiter: ', ', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_CHECKBOX', visibleItemCount: 15,
value: minionList,
defaultValue: minionList,
description: 'Node list to run during BV'),
// This is different than other pipelines to make it work with the simple proxy_traditional without refactoring all feature files
booleanParam(name: 'use_previous_terraform_state', defaultValue: true, description: 'Use previous Terraform state'),
booleanParam(name: 'must_deploy', defaultValue: true, description: 'Deploy'),
booleanParam(name: 'must_run_core', defaultValue: true, description: 'Run Core features'),
booleanParam(name: 'must_sync', defaultValue: true, description: 'Sync. products and channels'),
booleanParam(name: 'enable_proxy_stages', defaultValue: true, description: 'Run Proxy stages'),
booleanParam(name: 'enable_client_stages', defaultValue: true, description: 'Run Client stages'),
booleanParam(name: 'must_add_MU_repositories', defaultValue: true, description: 'Add MU channels'),
booleanParam(name: 'must_add_non_MU_repositories', defaultValue: true, description: 'Add non MU channels'),
booleanParam(name: 'must_add_keys', defaultValue: true, description: 'Add Activation Keys'),
booleanParam(name: 'must_create_bootstrap_repos', defaultValue: true, description: 'Create bootstrap repositories'),
booleanParam(name: 'must_boot_node', defaultValue: true, description: 'Bootstrap Node'),
booleanParam(name: 'must_run_tests', defaultValue: true, description: 'Run Smoke Tests'),
booleanParam(name: 'must_run_containerization_tests', defaultValue: false, description: 'Run Containerization Tests'),
booleanParam(name: 'confirm_before_continue', defaultValue: false, description: 'Confirmation button between stages'),
text(name: 'custom_repositories', defaultValue: '{}', description: 'Salt & Client Tools SLE Update Repositories for each client, in json format')
])
])

stage('Checkout pipeline') {
checkout scm
}
non_MU_channels_tasks_file = 'susemanager-ci/jenkins_pipelines/data/non_MU_channels_tasks_50.json'
def pipeline = load "jenkins_pipelines/environments/common/pipeline-build-validation.groovy"
pipeline.run(params)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ node('sumaform-cucumber-provo') {
parameters([
string(name: 'cucumber_gitrepo', defaultValue: 'https://github.com/SUSE/spacewalk.git', description: 'Testsuite Git Repository'),
string(name: 'cucumber_ref', defaultValue: 'Manager-5.0', description: 'Branch prepared for the MU tested'),
string(name: 'tf_file', defaultValue: 'susemanager-ci/terracumber_config/tf_files/SUSEManager-5.0-SLE-update.tf', description: 'Path to the tf file to be used'),
string(name: 'tf_file', defaultValue: 'susemanager-ci/terracumber_config/tf_files/SUSEManager-5.0-SLE-update-PRV.tf', description: 'Path to the tf file to be used'),
string(name: 'sumaform_gitrepo', defaultValue: 'https://github.com/uyuni-project/sumaform.git', description: 'Sumaform Git Repository'),
string(name: 'sumaform_ref', defaultValue: 'master', description: 'Sumaform Git reference (branch, tag...)'),
choice(name: 'sumaform_backend', choices: ['libvirt'], description: 'Sumaform backend to be used (see https://github.com/uyuni-project/sumaform#backend-choice)'),
Expand Down
216 changes: 216 additions & 0 deletions terracumber_config/tf_files/SUSEManager-4.3-SLE-update-NUE.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
// Mandatory variables for terracumber
variable "URL_PREFIX" {
type = string
default = "https://ci.suse.de/view/Manager/view/Manager-4.3/job/manager-4.3-qe-sle-update-NUE"
}

// Not really used as this is for --runall parameter, and we run cucumber step by step
variable "CUCUMBER_COMMAND" {
type = string
default = "export PRODUCT='SUSE-Manager' && run-testsuite"
}

variable "CUCUMBER_GITREPO" {
type = string
default = "https://github.com/SUSE/spacewalk.git"
}

variable "CUCUMBER_BRANCH" {
type = string
default = "Manager-4.3"
}

variable "CUCUMBER_RESULTS" {
type = string
default = "/root/spacewalk/testsuite"
}

variable "MAIL_SUBJECT" {
type = string
default = "Results 4.3 SLE Update $status: $tests scenarios ($failures failed, $errors errors, $skipped skipped, $passed passed)"
}

variable "MAIL_TEMPLATE" {
type = string
default = "../mail_templates/mail-template-jenkins.txt"
}

variable "MAIL_SUBJECT_ENV_FAIL" {
type = string
default = "Results 4.3 SLE Update: Environment setup failed"
}

variable "MAIL_TEMPLATE_ENV_FAIL" {
type = string
default = "../mail_templates/mail-template-jenkins-env-fail.txt"
}

variable "MAIL_FROM" {
type = string
default = "galaxy-noise@suse.de"
}

variable "MAIL_TO" {
type = string
default = "galaxy-noise@suse.de"
}

// sumaform specific variables
variable "SCC_USER" {
type = string
}

variable "SCC_PASSWORD" {
type = string
}

variable "GIT_USER" {
type = string
default = null
}

variable "GIT_PASSWORD" {
type = string
default = null
}

terraform {
required_version = "1.0.10"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "0.6.3"
}
}
}

provider "libvirt" {
uri = "qemu+tcp://suma-08.mgr.suse.de/system"
}

module "base" {
source = "./modules/base"

cc_username = var.SCC_USER
cc_password = var.SCC_PASSWORD
product_version = "4.3-released"
name_prefix = "suma-su-43-"
use_avahi = false
domain = "mgr.suse.de"
images = [ "sles15sp4o", "opensuse155o" ]

mirror = "minima-mirror-ci-bv.mgr.suse.de"
use_mirror_images = true

testsuite = true

provider_settings = {
pool = "ssd"
bridge = "br1"
}
}

module "server" {
source = "./modules/server"
base_configuration = module.base.configuration
name = "server"
provider_settings = {
mac = "aa:b2:93:01:02:61"
memory = 16384
vcpu = 4
data_pool = "ssd"
}

server_mounted_mirror = "minima-mirror-ci-bv.mgr.suse.de"
repository_disk_size = 1500

auto_accept = false
monitored = true
disable_firewall = false
allow_postgres_connections = false
skip_changelog_import = false
create_first_user = false
mgr_sync_autologin = false
create_sample_channel = false
create_sample_activation_key = false
create_sample_bootstrap_script = false
publish_private_ssl_key = false
use_os_released_updates = true
disable_download_tokens = false
ssh_key_path = "./salt/controller/id_rsa.pub"
from_email = "root@suse.de"
accept_all_ssl_protocols = true

//server_additional_repos

}

module "proxy" {
source = "./modules/proxy"
base_configuration = module.base.configuration
name = "proxy"
provider_settings = {
mac = "aa:b2:93:01:02:62"
memory = 4096
}
server_configuration = {
hostname = "suma-su-43-server.mgr.suse.de"
username = "admin"
password = "admin"
}

auto_register = false
auto_connect_to_master = false
download_private_ssl_key = false
install_proxy_pattern = false
auto_configure = false
generate_bootstrap_script = false
publish_private_ssl_key = false
use_os_released_updates = true
ssh_key_path = "./salt/controller/id_rsa.pub"

}

module "sles15sp4_minion" {
source = "./modules/minion"
base_configuration = module.base.configuration
name = "sles15sp4-minion"
image = "sles15sp4o"
provider_settings = {
mac = "aa:b2:93:01:02:63"
vcpu = 2
memory = 2048
}

auto_connect_to_master = false
use_os_released_updates = false
ssh_key_path = "./salt/controller/id_rsa.pub"
}

module "controller" {
source = "./modules/controller"
base_configuration = module.base.configuration
name = "controller"
provider_settings = {
mac = "aa:b2:93:01:02:60"
memory = 16384
vcpu = 8
}
swap_file_size = null

// Cucumber repository configuration for the controller
git_username = var.GIT_USER
git_password = var.GIT_PASSWORD
git_repo = var.CUCUMBER_GITREPO
branch = var.CUCUMBER_BRANCH

server_configuration = module.server.configuration
proxy_configuration = module.proxy.configuration
sle15sp4_minion_configuration = module.sles15sp4_minion.configuration
}

output "configuration" {
value = {
controller = module.controller.configuration
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ variable "SCC_PASSWORD" {

variable "GIT_USER" {
type = string
default = null // Not needed for master, as it is public
default = null
}

variable "GIT_PASSWORD" {
type = string
default = null // Not needed for master, as it is public
default = null
}

terraform {
Expand Down Expand Up @@ -168,8 +168,6 @@ module "proxy" {
use_os_released_updates = true
ssh_key_path = "./salt/controller/id_rsa.pub"

//proxy_additional_repos

}

module "sles15sp4_minion" {
Expand All @@ -189,8 +187,6 @@ module "sles15sp4_minion" {
use_os_released_updates = false
ssh_key_path = "./salt/controller/id_rsa.pub"

//sle15sp4-minion_additional_repos

}

module "controller" {
Expand Down
Loading

0 comments on commit fa99ee7

Please sign in to comment.