vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 1 | package com.mirantis.mk |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 2 | |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 3 | import static groovy.json.JsonOutput.toJson |
Sergey Lalov | 7865910 | 2024-02-15 16:57:21 +0400 | [diff] [blame] | 4 | import java.util.regex.Pattern |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 5 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 6 | /** |
| 7 | * |
| 8 | * KaaS Component Testing Utilities |
| 9 | * |
| 10 | */ |
| 11 | |
Владислав Наумов | e534581 | 2020-08-12 16:30:20 +0200 | [diff] [blame] | 12 | /** |
| 13 | * Check KaaS Core CICD feature flags |
| 14 | * such triggers can be used in case of switching between pipelines, |
| 15 | * conditions inside pipelines to reduce dependency on jenkins job builder and jenkins job templates itself |
| 16 | * |
| 17 | * @return (map)[ |
| 18 | * ffNameEnabled: (bool) True/False |
| 19 | * ] |
| 20 | */ |
| 21 | def checkCoreCIFeatureFlags() { |
| 22 | def common = new com.mirantis.mk.Common() |
| 23 | def ff = [ |
| 24 | build_artifacts_upgrade: false, |
| 25 | ] |
| 26 | |
| 27 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
| 28 | if (commitMsg ==~ /(?s).*\[ci-build-artifacts-upgrade\].*/) { |
| 29 | ff['build_artifacts_upgrade'] = true |
| 30 | } |
| 31 | |
| 32 | common.infoMsg("Core ci feature flags status: ${ff}") |
| 33 | return ff |
| 34 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 35 | |
| 36 | /** |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 37 | * Determine scope of test suite against per-commit KaaS deployment based on keywords |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 38 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 39 | * |
| 40 | * Used for components team to combine test-suites and forward desired parameters to kaas/core deployment jobs |
| 41 | * Example scheme: |
Владислав Наумов | e534581 | 2020-08-12 16:30:20 +0200 | [diff] [blame] | 42 | * New CR pushed in kubernetes/lcm-ansible -> parsing it'cs commit body and combine test-suite -> trigger deployment jobs from kaas/core |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 43 | * manage test-suite through Jenkins Job Parameters |
| 44 | * |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 45 | * @return (map)[ |
| 46 | * deployChildEnabled: (bool) True if need to deploy child cluster during demo-run |
| 47 | * runUie2eEnabled: (bool) True if need to run ui-e2e cluster during demo-run |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 48 | * ] |
| 49 | */ |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 50 | def checkDeploymentTestSuite() { |
vnaumov | bdb9022 | 2020-05-04 18:25:50 +0200 | [diff] [blame] | 51 | def common = new com.mirantis.mk.Common() |
| 52 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 53 | // Available triggers and its sane defaults |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 54 | def seedMacOs = env.SEED_MACOS ? env.SEED_MACOS.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 55 | def deployChild = env.DEPLOY_CHILD_CLUSTER ? env.DEPLOY_CHILD_CLUSTER.toBoolean() : false |
| 56 | def upgradeChild = env.UPGRADE_CHILD_CLUSTER ? env.UPGRADE_CHILD_CLUSTER.toBoolean() : false |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 57 | def fullUpgradeChild = env.FULL_UPGRADE_CHILD_CLUSTER ? env.FULL_UPGRADE_CHILD_CLUSTER.toBoolean() : false |
Mikhail Ivanov | 38ee438 | 2022-01-27 16:21:51 +0400 | [diff] [blame] | 58 | def mosDeployChild = env.DEPLOY_MOS_CHILD_CLUSTER ? env.DEPLOY_MOS_CHILD_CLUSTER.toBoolean() : false |
| 59 | def mosUpgradeChild = env.UPGRADE_MOS_CHILD_CLUSTER ? env.UPGRADE_MOS_CHILD_CLUSTER.toBoolean() : false |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 60 | def customChildRelease = env.KAAS_CHILD_CLUSTER_RELEASE_NAME ? env.KAAS_CHILD_CLUSTER_RELEASE_NAME : '' |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 61 | def mosTfDeploy = env.MOS_TF_DEPLOY ? env.MOS_TF_DEPLOY.toBoolean() : false |
Владислав Наумов | 0dc9925 | 2020-11-13 13:30:48 +0100 | [diff] [blame] | 62 | def attachBYO = env.ATTACH_BYO ? env.ATTACH_BYO.toBoolean() : false |
Владислав Наумов | cdbd84e | 2020-12-01 16:51:09 +0100 | [diff] [blame] | 63 | def upgradeBYO = env.UPGRADE_BYO ? env.UPGRADE_BYO.toBoolean() : false |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 64 | def runBYOMatrix = env.RUN_BYO_MATRIX ? env.RUN_BYO_MATRIX.toBoolean() : false |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 65 | def defaultBYOOs = env.DEFAULT_BYO_OS ? env.DEFAULT_BYO_OS.toString() : 'ubuntu' |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 66 | def upgradeMgmt = env.UPGRADE_MGMT_CLUSTER ? env.UPGRADE_MGMT_CLUSTER.toBoolean() : false |
slalov | 1202bba | 2022-04-20 22:31:07 +0400 | [diff] [blame] | 67 | def autoUpgradeMgmt = env.AUTO_UPGRADE_MCC ? env.AUTO_UPGRADE_MCC.toBoolean() : false |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 68 | def enableLMALogging = env.ENABLE_LMA_LOGGING ? env.ENABLE_LMA_LOGGING.toBoolean(): false |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 69 | def deployOsOnMos = env.DEPLOY_OS_ON_MOS? env.DEPLOY_OS_ON_MOS.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 70 | def runUie2e = env.RUN_UI_E2E ? env.RUN_UI_E2E.toBoolean() : false |
Mikhail Ivanov | f5e20af | 2022-03-24 15:38:06 +0400 | [diff] [blame] | 71 | def runUie2eNew = env.RUN_UI_E2E_NEW ? env.RUN_UI_E2E_NEW.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 72 | def runMgmtConformance = env.RUN_MGMT_CFM ? env.RUN_MGMT_CFM.toBoolean() : false |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 73 | def runMgmtConformanceNetworkPolicy = env.RUN_MGMT_CFM_NETWORK_POLICY ? env.RUN_MGMT_CFM_NETWORK_POLICY.toBoolean() : false |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 74 | def runLMATest = env.RUN_LMA_TEST ? env.RUN_LMA_TEST.toBoolean() : false |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 75 | def runMgmtUserControllerTest = env.RUN_MGMT_USER_CONTROLLER_TEST ? env.RUN_MGMT_USER_CONTROLLER_TEST.toBoolean() : false |
Mikhail Ivanov | 2907e4d | 2022-04-25 16:41:21 +0400 | [diff] [blame] | 76 | def runProxyChildTest = env.RUN_PROXY_CHILD_TEST ? env.RUN_PROXY_CHILD_TEST.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 77 | def runChildConformance = env.RUN_CHILD_CFM ? env.RUN_CHILD_CFM.toBoolean() : false |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame] | 78 | def runChildStacklightHa = env.RUN_STACKLIGHT_CHILD_HA ? env.RUN_STACKLIGHT_CHILD_HA.toBoolean() : false |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 79 | def runChildConformanceNetworkPolicy = env.RUN_CHILD_CFM_NETWORK_POLICY ? env.RUN_CHILD_CFM_NETWORK_POLICY.toBoolean() : false |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 80 | def runChildHPA = env.RUN_CHILD_HPA ? env.RUN_CHILD_HPA.toBoolean() : false |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 81 | def fetchServiceBinaries = env.FETCH_BINARIES_FROM_UPSTREAM ? env.FETCH_BINARIES_FROM_UPSTREAM.toBoolean() : false |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 82 | def equinixMetalV2ChildDiffMetro = env.EQUINIXMETALV2_CHILD_DIFF_METRO ? env.EQUINIXMETALV2_CHILD_DIFF_METRO.toBoolean() : false |
slalov | 13e579c | 2022-01-31 21:37:02 +0400 | [diff] [blame] | 83 | def runMaintenanceTest = env.RUN_MAINTENANCE_TEST ? env.RUN_MAINTENANCE_TEST.toBoolean() : false |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 84 | def runContainerregistryTest = env.RUN_CONTAINER_REGISTRY_TEST ? env.RUN_CONTAINER_REGISTRY_TEST.toBoolean() : false |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 85 | def runMgmtDeleteMasterTest = env.RUN_MGMT_DELETE_MASTER_TEST ? env.RUN_MGMT_DELETE_MASTER_TEST.toBoolean() : false |
| 86 | def runRgnlDeleteMasterTest = env.RUN_RGNL_DELETE_MASTER_TEST ? env.RUN_RGNL_DELETE_MASTER_TEST.toBoolean() : false |
| 87 | def runChildDeleteMasterTest = env.RUN_CHILD_DELETE_MASTER_TEST ? env.RUN_CHILD_DELETE_MASTER_TEST.toBoolean() : false |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 88 | def runGracefulRebootTest = env.RUN_GRACEFUL_REBOOT_TEST ? env.RUN_GRACEFUL_REBOOT_TEST.toBoolean() : false |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 89 | def pauseForDebug = env.PAUSE_FOR_DEBUG ? env.PAUSE_FOR_DEBUG.toBoolean() : false |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 90 | def runChildMachineDeletionPolicyTest = env.RUN_CHILD_MACHINE_DELETION_POLICY_TEST ? env.RUN_CHILD_MACHINE_DELETION_POLICY_TEST.toBoolean() : false |
Sergey Lalov | d3e030e | 2023-03-16 14:32:47 +0400 | [diff] [blame] | 91 | def runChildCustomCertTest = env.RUN_CHILD_CUSTOM_CERT_TEST ? env.RUN_CHILD_CUSTOM_CERT_TEST.toBoolean() : false |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 92 | def runByoChildCustomCertTest = env.RUN_BYO_CHILD_CUSTOM_CERT_TEST ? env.RUN_BYO_CHILD_CUSTOM_CERT_TEST.toBoolean() : false |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 93 | def runMgmtCustomCacheCertTest = env.RUN_MGMT_CUSTOM_CACHE_CERT_TEST ? env.RUN_MGMT_CUSTOM_CACHE_CERT_TEST.toBoolean() : false |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 94 | def runMkeCustomCertTest = env.RUN_MKE_CUSTOM_CERT_TEST ? env.RUN_MKE_CUSTOM_CERT_TEST.toBoolean() : false |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 95 | def runCustomHostnames = env.RUN_CUSTOM_HOSTNAMES ? env.RUN_CUSTOM_HOSTNAMES.toBoolean() : false |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 96 | def slLatest = env.SL_LATEST ? env.SL_LATEST.toBoolean() : false |
vryzhenkin | a8d74e7 | 2024-02-26 14:59:37 +0400 | [diff] [blame] | 97 | def coreKeycloakLdap = env.CORE_KEYCLOAK_LDAP_ENABLED ? env.CORE_KEYCLOAK_LDAP_ENABLED.toBoolean() : false |
vryzhenkin | e0ff1d8 | 2024-03-18 15:08:09 +0400 | [diff] [blame] | 98 | def configureInternalNTP = env.CORE_KAAS_NTP_ENABLED ? env.CORE_KAAS_NTP_ENABLED.toBoolean() : false |
Sergey Lalov | d7593ab | 2024-01-11 13:40:13 +0400 | [diff] [blame] | 99 | def disableKubeApiAudit = env.DISABLE_KUBE_API_AUDIT ? env.DISABLE_KUBE_API_AUDIT.toBoolean() : false |
Sergey Lalov | f44cbb7 | 2024-03-27 15:19:24 +0400 | [diff] [blame] | 100 | def auditd = env.AUDITD_ENABLE ? env.AUDITD_ENABLE.toBoolean() : false |
Sergey Lalov | 7c2377e | 2023-12-15 23:14:45 +0400 | [diff] [blame] | 101 | def customSlackChannel = env.SLACK_CHANNEL_NOTIFY ? env.SLACK_CHANNEL_NOTIFY : '' |
Viktor Astakhov | adfcfb5 | 2024-05-16 16:56:21 +0400 | [diff] [blame] | 102 | def runNTPUpdateTest = env.RUN_NTP_UPDATE_TEST ? env.RUN_NTP_UPDATE_TEST.toBoolean() : false |
Viktor Astakhov | 8da448c | 2024-06-14 14:59:32 +0400 | [diff] [blame] | 103 | def runMCCMariaBackupRestoreTest = env.RUN_MCC_MARIA_BACKUP_RESTORE_TEST ? env.RUN_MCC_MARIA_BACKUP_RESTORE_TEST.toBoolean() : false |
Viktor Astakhov | 4fda267 | 2024-08-29 16:38:25 +0400 | [diff] [blame] | 104 | def runRuntimeMigrateExtendedTestMgmt = env.RUN_MGMT_RUNTIME_MIGRATE_EXTENDED_TEST ? env.RUN_MGMT_RUNTIME_MIGRATE_EXTENDED_TEST.toBoolean() : false |
| 105 | def runRuntimeMigrateQuickTestMgmt = env.RUN_MGMT_RUNTIME_MIGRATE_QUICK_TEST ? env.RUN_MGMT_RUNTIME_MIGRATE_QUICK_TEST.toBoolean() : false |
| 106 | def runRuntimeMigrateAndRollbackTestMgmt = env.RUN_MGMT_RUNTIME_MIGRATE_AND_ROLLBACK_TEST ? env.RUN_MGMT_RUNTIME_MIGRATE_AND_ROLLBACK_TEST.toBoolean() : false |
| 107 | def runRuntimeMigrateExtendedTestChild = env.RUN_CHILD_RUNTIME_MIGRATE_EXTENDED_TEST ? env.RUN_CHILD_RUNTIME_MIGRATE_EXTENDED_TEST.toBoolean() : false |
| 108 | def runRuntimeMigrateQuickTestChild = env.RUN_CHILD_RUNTIME_MIGRATE_QUICK_TEST ? env.RUN_CHILD_RUNTIME_MIGRATE_QUICK_TEST.toBoolean() : false |
| 109 | def runRuntimeMigrateAndRollbackTestChild = env.RUN_CHILD_RUNTIME_MIGRATE_AND_ROLLBACK_TEST ? env.RUN_CHILD_RUNTIME_MIGRATE_AND_ROLLBACK_TEST.toBoolean() : false |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 110 | // multiregion configuration from env variable: comma-separated string in form $mgmt_provider,$regional_provider |
| 111 | def multiregionalMappings = env.MULTIREGION_SETUP ? multiregionWorkflowParser(env.MULTIREGION_SETUP) : [ |
| 112 | enabled: false, |
| 113 | managementLocation: '', |
| 114 | regionLocation: '', |
| 115 | ] |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 116 | |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 117 | // proxy customization |
| 118 | def proxyConfig = [ |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 119 | mgmtOffline: env.OFFLINE_MGMT_CLUSTER ? env.OFFLINE_MGMT_CLUSTER.toBoolean() : false, |
| 120 | childOffline: env.OFFLINE_CHILD_CLUSTER ? env.OFFLINE_CHILD_CLUSTER.toBoolean() : false, |
Владислав Наумов | 257ea13 | 2021-04-14 14:44:13 +0200 | [diff] [blame] | 121 | childProxy: env.PROXY_CHILD_CLUSTER ? env.PROXY_CHILD_CLUSTER.toBoolean() : false, |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 122 | ] |
| 123 | |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 124 | // optional demo deployment customization |
Владислав Наумов | 905dd36 | 2020-06-08 16:37:01 +0200 | [diff] [blame] | 125 | def awsOnDemandDemo = env.ALLOW_AWS_ON_DEMAND ? env.ALLOW_AWS_ON_DEMAND.toBoolean() : false |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 126 | def equinixOnDemandDemo = env.ALLOW_EQUINIX_ON_DEMAND ? env.ALLOW_EQUINIX_ON_DEMAND.toBoolean() : false |
Владислав Наумов | 82305e9 | 2021-10-14 20:45:20 +0200 | [diff] [blame] | 127 | def equinixMetalV2OnDemandDemo = env.ALLOW_EQUINIXMETALV2_ON_DEMAND ? env.ALLOW_EQUINIXMETALV2_ON_DEMAND.toBoolean() : false |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 128 | def equinixOnAwsDemo = env.EQUINIX_ON_AWS_DEMO ? env.EQUINIX_ON_AWS_DEMO.toBoolean() : false |
| 129 | def azureOnAwsDemo = env.AZURE_ON_AWS_DEMO ? env.AZURE_ON_AWS_DEMO.toBoolean() : false |
| 130 | def azureOnDemandDemo = env.ALLOW_AZURE_ON_DEMAND ? env.ALLOW_AZURE_ON_DEMAND.toBoolean() : false |
Sergey Kolekonov | ad61fed | 2024-08-30 16:13:12 +0500 | [diff] [blame] | 131 | def enableVsphereDemo = env.ALLOW_VSPHERE_ON_DEMAND ? env.ALLOW_VSPHERE_ON_DEMAND.toBoolean() : false |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 132 | def enableOSDemo = true |
azvyagintsev | 1761bdc | 2020-09-04 17:24:12 +0300 | [diff] [blame] | 133 | def enableBMDemo = true |
Sergey Lalov | c62e938 | 2024-01-29 15:19:15 +0400 | [diff] [blame] | 134 | def enablebmCoreDemo = env.ALLOW_BM_CORE_ON_DEMAND ? env.ALLOW_BM_CORE_ON_DEMAND.toBoolean() : false |
Sergey Lalov | ef5c9dc | 2024-03-20 22:30:06 +0400 | [diff] [blame] | 135 | def bmCoreCleanup = env.BM_CORE_CLEANUP ? env.BM_CORE_CLEANUP.toBoolean() : true |
Mikhail Ivanov | bd1a9fd | 2022-03-29 21:36:21 +0400 | [diff] [blame] | 136 | def enableArtifactsBuild = true |
Sergey Lalov | cad9333 | 2024-03-11 16:19:31 +0400 | [diff] [blame] | 137 | def bmDeployType = env.BM_DEPLOY_TYPE ? env.BM_DEPLOY_TYPE.toString() : 'virtual' |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 138 | def openstackIMC = env.OPENSTACK_CLOUD_LOCATION ? env.OPENSTACK_CLOUD_LOCATION : 'us' |
Alexandr Lovtsov | 36473f3 | 2022-04-28 15:46:09 +0300 | [diff] [blame] | 139 | def enableVsphereUbuntu = env.VSPHERE_DEPLOY_UBUNTU ? env.VSPHERE_DEPLOY_UBUNTU.toBoolean() : false |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 140 | def enableVsphereRHEL = env.VSPHERE_DEPLOY_RHEL ? env.VSPHERE_DEPLOY_RHEL.toBoolean() : false |
Sergey Zhemerdeev | e67fb26 | 2022-06-21 00:49:34 +0300 | [diff] [blame] | 141 | def childOsBootFromVolume = env.OPENSTACK_BOOT_FROM_VOLUME ? env.OPENSTACK_BOOT_FROM_VOLUME.toBoolean() : false |
Ivan Berezovskiy | 29e72b7 | 2022-07-12 21:03:24 +0400 | [diff] [blame] | 142 | def bootstrapV2Scenario = env.BOOTSTRAP_V2_ENABLED ? env.BOOTSTRAP_V2_ENABLED.toBoolean() : false |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 143 | def equinixMetalV2Metro = env.EQUINIX_MGMT_METRO ? env.EQUINIX_MGMT_METRO : '' |
Mikhail Ivanov | 3088d3d | 2022-10-24 14:05:46 +0400 | [diff] [blame] | 144 | def enableFips = env.ENABLE_FIPS ? env.ENABLE_FIPS.toBoolean() : false |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 145 | def enableMkeDebug = env.ENABLE_MKE_DEBUG ? env.ENABLE_MKE_DEBUG.toBoolean() : false |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 146 | def aioCluster = env.AIO_CLUSTER ? env.AIO_CLUSTER.toBoolean() : false |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 147 | def useVsphereVvmtObjects = env.VSPHERE_USE_VVMT_OBJECTS ? env.VSPHERE_USE_VVMT_OBJECTS.toBoolean() : false |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 148 | def enableBv2Smoke = true |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 149 | def runCacheWarmup = env.CACHE_WARMUP_ENABLED ? env.CACHE_WARMUP_ENABLED.toBoolean() : false |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 150 | def cveScan = false |
Sergey Kolekonov | 7514843 | 2024-07-16 13:22:36 +0500 | [diff] [blame] | 151 | // Sync to public CDN is triggered automatically for corresponding scenarios |
| 152 | // This trigger is used only for on-demand cases |
| 153 | def publicCISync = false |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 154 | |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 155 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 156 | if (commitMsg ==~ /(?s).*\[mgmt-proxy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-proxy.*/) { |
| 157 | proxyConfig['mgmtOffline'] = true |
Владислав Наумов | 70c0242 | 2021-04-19 14:29:41 +0200 | [diff] [blame] | 158 | common.warningMsg('Forced running offline mgmt deployment, some provider CDN regions for mgmt deployment may be set to *public-ci* to verify proxy configuration') |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 159 | } |
Sergey Kolekonov | 5995dfd | 2023-07-06 16:09:43 +0600 | [diff] [blame] | 160 | if (commitMsg ==~ /(?s).*\[mgmt-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-upgrade.*/) { |
| 161 | upgradeMgmt = true |
| 162 | } |
| 163 | if (commitMsg ==~ /(?s).*\[auto-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*auto-upgrade.*/) { |
| 164 | autoUpgradeMgmt = true |
| 165 | } |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 166 | if (commitMsg ==~ /(?s).*\[seed-macos\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*seed-macos.*/) { |
| 167 | seedMacOs = true |
| 168 | } |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 169 | if (commitMsg ==~ /(?s).*\[child-deploy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-deploy.*/ || |
| 170 | upgradeChild || runChildConformance || runProxyChildTest || runChildHPA || runChildConformanceNetworkPolicy) { |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 171 | deployChild = true |
| 172 | } |
| 173 | if (commitMsg ==~ /(?s).*\[child-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-upgrade.*/) { |
| 174 | deployChild = true |
| 175 | upgradeChild = true |
| 176 | } |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 177 | if (commitMsg ==~ /(?s).*\[child-upgrade-full\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-upgrade-full.*/) { |
| 178 | deployChild = true |
| 179 | upgradeChild = true |
Sergey Lalov | a048df9 | 2023-06-19 19:36:41 +0400 | [diff] [blame] | 180 | common.warningMsg("2-step child updates are not testing (PRODX-33510)") |
| 181 | //TODO: revert after start testing the two-step upgrade again (PRODX-33510) |
| 182 | //fullUpgradeChild = true |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 183 | } |
Sergey Kolekonov | 5995dfd | 2023-07-06 16:09:43 +0600 | [diff] [blame] | 184 | if ((upgradeMgmt || autoUpgradeMgmt) && deployChild) { |
| 185 | upgradeChild = true |
| 186 | common.warningMsg('child upgrade is automatically enabled as mgmt upgrade and child deploy are enabled') |
| 187 | } |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 188 | def childDeployMatches = (commitMsg =~ /(\[child-deploy\s*(\w|\-)+?\])/) |
| 189 | if (childDeployMatches.size() > 0) { |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 190 | // override child version when it set explicitly |
| 191 | deployChild = true |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 192 | customChildRelease = childDeployMatches[0][0].split('child-deploy')[1].replaceAll('[\\[\\]]', '').trim() |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 193 | common.warningMsg("Forced child deployment using custom release version ${customChildRelease}") |
| 194 | } |
Mikhail Ivanov | 38ee438 | 2022-01-27 16:21:51 +0400 | [diff] [blame] | 195 | if (commitMsg ==~ /(?s).*\[mos-child-deploy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mos-child-deploy.*/) { |
| 196 | mosDeployChild = true |
| 197 | } |
| 198 | if (commitMsg ==~ /(?s).*\[mos-child-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mos-child-upgrade.*/) { |
| 199 | mosDeployChild = true |
| 200 | mosUpgradeChild = true |
| 201 | } |
Sergey Kolekonov | 5995dfd | 2023-07-06 16:09:43 +0600 | [diff] [blame] | 202 | if ((upgradeMgmt || autoUpgradeMgmt) && mosDeployChild) { |
| 203 | mosUpgradeChild = true |
| 204 | common.warningMsg('MOSK child upgrade is automatically enabled as mgmt upgrade and MOSK child deploy are enabled') |
| 205 | } |
Владислав Наумов | 0dc9925 | 2020-11-13 13:30:48 +0100 | [diff] [blame] | 206 | if (commitMsg ==~ /(?s).*\[byo-attach\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-attach.*/) { |
| 207 | attachBYO = true |
| 208 | } |
Владислав Наумов | cdbd84e | 2020-12-01 16:51:09 +0100 | [diff] [blame] | 209 | if (commitMsg ==~ /(?s).*\[byo-upgrade\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-upgrade.*/) { |
| 210 | attachBYO = true |
| 211 | upgradeBYO = true |
| 212 | } |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 213 | if (commitMsg ==~ /(?s).*\[ui-test-on-all-providers\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ui-test-on-all-providers.*/) { |
| 214 | enableVsphereDemo = true |
| 215 | enableOSDemo = true |
| 216 | awsOnDemandDemo = true |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 217 | azureOnDemandDemo = true |
| 218 | equinixOnDemandDemo = true |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 219 | equinixMetalV2OnDemandDemo = true |
| 220 | runUie2e = true |
Sergey Lalov | acec3c1 | 2022-07-20 16:00:14 +0400 | [diff] [blame] | 221 | // Edit after fix PRODX-3961 |
| 222 | enableBMDemo = false |
| 223 | } |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 224 | def byoDeployMatches = (commitMsg =~ /(\[run-byo-matrix\s*(ubuntu|centos)\])/) |
| 225 | if (commitMsg ==~ /(?s).*\[run-byo-matrix\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*run-byo-matrix\.*/ || byoDeployMatches.size() > 0) { |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 226 | runBYOMatrix = true |
| 227 | |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 228 | if (byoDeployMatches.size() > 0) { |
| 229 | defaultBYOOs = byoDeployMatches[0][2] |
| 230 | common.warningMsg("Custom BYO OS detected, using ${defaultBYOOs}") |
| 231 | } |
| 232 | |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 233 | common.warningMsg('Forced byo matrix test via run-byo-matrix, all other byo triggers will be skipped') |
| 234 | attachBYO = false |
| 235 | upgradeBYO = false |
| 236 | } |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 237 | if (commitMsg ==~ /(?s).*\[lma-logging\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*lma-logging.*/) { |
| 238 | enableLMALogging = true |
| 239 | } |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 240 | if (commitMsg ==~ /(?s).*\[deploy-os-on-mos\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*deploy-os-on-mos.*/) { |
| 241 | deployOsOnMos = true |
| 242 | mosDeployChild = true |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 243 | } |
Sergey Lalov | d0e2085 | 2023-08-17 19:11:19 +0400 | [diff] [blame] | 244 | |
| 245 | if (commitMsg ==~ /(?s).*\[half-virtual\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*half-virtual.*/ || upgradeMgmt) { |
| 246 | bmDeployType = 'half-virtual' |
| 247 | common.infoMsg('Half-virtual will be deployed by default on upgrade case') |
| 248 | } |
| 249 | |
Sergey Lalov | 9504060 | 2023-03-07 16:42:16 +0400 | [diff] [blame] | 250 | if (commitMsg ==~ /(?s).*\[ui-e2e-nw\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ui-e2e-nw.*/) { |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 251 | runUie2e = true |
| 252 | } |
Sergey Lalov | 9504060 | 2023-03-07 16:42:16 +0400 | [diff] [blame] | 253 | if (commitMsg ==~ /(?s).*\[ui-e2e-pw\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ui-e2e-pw.*/) { |
Mikhail Ivanov | f5e20af | 2022-03-24 15:38:06 +0400 | [diff] [blame] | 254 | runUie2eNew = true |
| 255 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 256 | if (commitMsg ==~ /(?s).*\[mgmt-cfm\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-cfm.*/) { |
| 257 | runMgmtConformance = true |
| 258 | } |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 259 | if (commitMsg ==~ /(?s).*\[mgmt-cfm-netpolicy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-cfm-netpolicy.*/) { |
| 260 | runMgmtConformanceNetworkPolicy = true |
| 261 | } |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 262 | if (commitMsg ==~ /(?s).*\[test-user-controller\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*test-user-controller.*/) { |
| 263 | runMgmtUserControllerTest = true |
| 264 | } |
slalov | 574123e | 2022-04-06 17:24:19 +0400 | [diff] [blame] | 265 | if (commitMsg ==~ /(?s).*\[test-proxy-child\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*test-proxy-child.*/) { |
| 266 | runProxyChildTest = true |
| 267 | deployChild = true |
| 268 | common.infoMsg('Child cluster deployment will be enabled since proxy child test suite will be executed') |
| 269 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 270 | if (commitMsg ==~ /(?s).*\[child-cfm\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-cfm.*/) { |
| 271 | runChildConformance = true |
| 272 | deployChild = true |
| 273 | } |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 274 | if (commitMsg ==~ /(?s).*\[child-cfm-netpolicy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-cfm-netpolicy.*/) { |
| 275 | runChildConformanceNetworkPolicy = true |
| 276 | deployChild = true |
| 277 | } |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 278 | if (commitMsg ==~ /(?s).*\[child-hpa\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-hpa.*/) { |
| 279 | runChildHPA = true |
| 280 | deployChild = true |
| 281 | } |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame] | 282 | if (commitMsg ==~ /(?s).*\[child-sl-ha\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-sl-ha.*/) { |
| 283 | runChildStacklightHa = true |
| 284 | deployChild = true |
| 285 | } |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 286 | if (commitMsg ==~ /(?s).*\[lma-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*lma-test.*/) { |
| 287 | runLMATest = true |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 288 | enableLMALogging = true |
| 289 | common.infoMsg('LMA logging will be enabled since LMA test suite will be executed') |
Victor Ryzhenkin | 1520659 | 2021-06-21 17:38:23 +0400 | [diff] [blame] | 290 | } |
slalov | 13e579c | 2022-01-31 21:37:02 +0400 | [diff] [blame] | 291 | if (commitMsg ==~ /(?s).*\[maintenance-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*maintenance-test.*/) { |
| 292 | runMaintenanceTest = true |
| 293 | } |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 294 | if (commitMsg ==~ /(?s).*\[container-registry-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*container-registry-test.*/) { |
| 295 | runContainerregistryTest = true |
| 296 | } |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 297 | if (commitMsg ==~ /(?s).*\[mgmt-delete-master-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-delete-master-test.*/) { |
| 298 | runMgmtDeleteMasterTest = true |
| 299 | } |
| 300 | if (commitMsg ==~ /(?s).*\[rgnl-delete-master-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*rgnl-delete-master-test.*/) { |
| 301 | runRgnlDeleteMasterTest = true |
| 302 | } |
| 303 | if (commitMsg ==~ /(?s).*\[child-delete-master-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-delete-master-test.*/) { |
Sergey Lalov | 47e2159 | 2023-07-18 23:36:32 +0400 | [diff] [blame] | 304 | if (!mosDeployChild) { |
| 305 | deployChild = true |
| 306 | } |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 307 | runChildDeleteMasterTest = true |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 308 | common.infoMsg('Child cluster deployment will be enabled since delete child master node test suite will be executed') |
| 309 | } |
| 310 | if (commitMsg ==~ /(?s).*\[child-machine-deletion-policy-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-machine-deletion-policy-test.*/) { |
| 311 | runChildMachineDeletionPolicyTest = true |
| 312 | deployChild = true |
| 313 | common.infoMsg('Child cluster deployment will be enabled since machine deletion child policy test suite will be executed') |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 314 | } |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 315 | if (commitMsg ==~ /(?s).*\[graceful-reboot-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*graceful-reboot-test.*/) { |
| 316 | runGracefulRebootTest = true |
| 317 | } |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 318 | if (commitMsg ==~ /(?s).*\[pause-for-debug\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*pause-for-debug.*/) { |
| 319 | pauseForDebug = true |
| 320 | } |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 321 | if (commitMsg ==~ /(?s).*\[child-offline\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-offline.*/) { |
| 322 | proxyConfig['childOffline'] = true |
| 323 | deployChild = true |
| 324 | } |
Владислав Наумов | 257ea13 | 2021-04-14 14:44:13 +0200 | [diff] [blame] | 325 | if (commitMsg ==~ /(?s).*\[child-proxy\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-proxy.*/) { |
| 326 | proxyConfig['childOffline'] = true |
| 327 | proxyConfig['childProxy'] = true |
| 328 | deployChild = true |
| 329 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 330 | if (commitMsg ==~ /(?s).*\[fetch.*binaries\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*fetch.*binaries.*/) { |
| 331 | fetchServiceBinaries = true |
| 332 | } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 333 | if (commitMsg ==~ /(?s).*\[equinix-on-aws\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinix-on-aws.*/) { |
| 334 | equinixOnAwsDemo = true |
| 335 | common.warningMsg('Forced running child cluster deployment on EQUINIX METAL provider based on AWS management cluster, triggered on patchset using custom keyword: \'[equinix-on-aws]\' ') |
| 336 | } |
| 337 | if (commitMsg ==~ /(?s).*\[azure-on-aws\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*azure-on-aws.*/) { |
| 338 | azureOnAwsDemo = true |
| 339 | common.warningMsg('Forced running child cluster deployment on Azure provider based on AWS management cluster, triggered on patchset using custom keyword: \'[azure-on-aws]\' ') |
| 340 | } |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 341 | if (commitMsg ==~ /(?s).*\[aws-demo\].*/ || |
| 342 | env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*aws-demo.*/ || |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 343 | runBYOMatrix || |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 344 | seedMacOs || |
| 345 | equinixOnAwsDemo || |
| 346 | azureOnAwsDemo) { |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 347 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 348 | awsOnDemandDemo = true |
Владислав Наумов | 2d3db33 | 2021-06-15 15:19:19 +0200 | [diff] [blame] | 349 | common.warningMsg('Running additional kaas deployment with AWS provider, may be forced due applied trigger cross dependencies, follow docs to clarify info') |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 350 | } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 351 | if (commitMsg ==~ /(?s).*\[equinix-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinix-demo\.*/) { |
| 352 | equinixOnDemandDemo = true |
| 353 | } |
Владислав Наумов | 82305e9 | 2021-10-14 20:45:20 +0200 | [diff] [blame] | 354 | if (commitMsg ==~ /(?s).*\[equinixmetalv2-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinixmetalv2-demo\.*/) { |
Владислав Наумов | 144956f | 2021-10-14 17:49:19 +0200 | [diff] [blame] | 355 | equinixMetalV2OnDemandDemo = true |
| 356 | } |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 357 | if (commitMsg ==~ /(?s).*\[equinixmetalv2-child-diff-metro\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*equinixmetalv2-child-diff-metro\.*/) { |
| 358 | equinixMetalV2OnDemandDemo = true |
| 359 | equinixMetalV2ChildDiffMetro = true |
| 360 | } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 361 | if (commitMsg ==~ /(?s).*\[azure-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*azure-demo\.*/) { |
| 362 | azureOnDemandDemo = true |
| 363 | } |
Sergey Lalov | 10cb350 | 2023-03-27 22:13:49 +0400 | [diff] [blame] | 364 | if (commitMsg ==~ /(?s).*\[disable-all-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-all-demo\.*/) { |
| 365 | enableVsphereDemo = false |
| 366 | enableOSDemo = false |
| 367 | enableBMDemo = false |
Sergey Lalov | 781fccc | 2023-10-12 21:55:17 +0400 | [diff] [blame] | 368 | enableBv2Smoke = false |
| 369 | common.errorMsg('vSphere, BM, Openstack, demo deployments and Bootstrap v2 smoke checks will be aborted, VF -1 will be set') |
Sergey Lalov | 10cb350 | 2023-03-27 22:13:49 +0400 | [diff] [blame] | 370 | } |
| 371 | |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 372 | if (commitMsg ==~ /(?s).*\[disable-os-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-os-demo\.*/) { |
| 373 | enableOSDemo = false |
| 374 | common.errorMsg('Openstack demo deployment will be aborted, VF -1 will be set') |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 375 | } |
| 376 | |
azvyagintsev | 1761bdc | 2020-09-04 17:24:12 +0300 | [diff] [blame] | 377 | if (commitMsg ==~ /(?s).*\[disable-bm-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-bm-demo\.*/) { |
| 378 | enableBMDemo = false |
| 379 | common.errorMsg('BM demo deployment will be aborted, VF -1 will be set') |
| 380 | } |
| 381 | |
Sergey Lalov | d0e2085 | 2023-08-17 19:11:19 +0400 | [diff] [blame] | 382 | if (commitMsg ==~ /(?s).*\[bm-core-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*bm-core-demo\\.*/) { |
| 383 | enablebmCoreDemo = true |
| 384 | enableBMDemo = false |
| 385 | } |
| 386 | |
| 387 | if (commitMsg ==~ /(?s).*\[disable-bm-core-cleanup\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-bm-core-cleanup\\.*/) { |
| 388 | bmCoreCleanup = false |
| 389 | } |
| 390 | |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 391 | if (commitMsg ==~ /(?s).*\[disable-vsphere-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-vsphere-demo\.*/) { |
| 392 | enableVsphereDemo = false |
| 393 | common.errorMsg('vSphere demo deployment will be aborted, VF -1 will be set') |
| 394 | } |
Alexandr Lovtsov | 36473f3 | 2022-04-28 15:46:09 +0300 | [diff] [blame] | 395 | if (commitMsg ==~ /(?s).*\[vsphere-ubuntu\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*vsphere-ubuntu\.*/) { |
| 396 | enableVsphereUbuntu = true |
| 397 | common.warningMsg('Ubuntu will be used to deploy vsphere machines') |
| 398 | } |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 399 | if (commitMsg ==~ /(?s).*\[vsphere-rhel\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*vsphere-rhel\.*/) { |
| 400 | enableVsphereRHEL = true |
| 401 | common.warningMsg('RHEL will be used to deploy vsphere machines') |
| 402 | } |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 403 | if (commitMsg ==~ /(?s).*\[disable-bv2-smoke\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-bv2-smoke\.*/) { |
| 404 | enableBv2Smoke = false |
| 405 | common.errorMsg('Bootstrap v2 smoke checks will be aborted, WF -1 will be set') |
| 406 | } |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 407 | |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 408 | if (commitMsg ==~ /(?s).*\[cve-scan\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*cve-scan\.*/) { |
| 409 | cveScan = true |
| 410 | common.errorMsg('CVE Scan job enabled') |
| 411 | } |
| 412 | |
Sergey Kolekonov | 7514843 | 2024-07-16 13:22:36 +0500 | [diff] [blame] | 413 | if (commitMsg ==~ /(?s).*\[public-ci-sync\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*public-ci-sync\.*/) { |
| 414 | publicCISync = true |
| 415 | common.errorMsg('Sync to public-ci CDN is enabled') |
| 416 | } |
| 417 | |
Sergey Lalov | 7c2377e | 2023-12-15 23:14:45 +0400 | [diff] [blame] | 418 | def slackChannelMatches = (commitMsg =~ /(\[slack-channel\s*[#@](\S+)])/) |
| 419 | if (slackChannelMatches.size() > 0) { |
| 420 | // override chanenel notify when it set explicitly |
| 421 | customSlackChannel = slackChannelMatches[0][0].split("slack-channel")[1].replaceAll('[\\[\\]]', '').trim() |
| 422 | common.warningMsg("Forced send notify to ${customSlackChannel} channel") |
| 423 | } |
| 424 | |
Mikhail Ivanov | bd1a9fd | 2022-03-29 21:36:21 +0400 | [diff] [blame] | 425 | if (commitMsg ==~ /(?s).*\[disable-artifacts-build\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-artifacts-build\.*/) { |
| 426 | enableArtifactsBuild = false |
| 427 | common.errorMsg('artifacts build will be aborted, VF -1 will be set') |
| 428 | } |
| 429 | |
Sergey Zhemerdeev | e67fb26 | 2022-06-21 00:49:34 +0300 | [diff] [blame] | 430 | if (commitMsg ==~ /(?s).*\[child-os-boot-from-volume\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-os-boot-from-volume\.*/) { |
| 431 | childOsBootFromVolume = true |
| 432 | common.warningMsg('OS will be booted from Ceph volumes') |
| 433 | } |
| 434 | |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 435 | if (commitMsg ==~ /(?s).*\[child-custom-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*child-custom-cert-test\.*/) { |
| 436 | runChildCustomCertTest = true |
| 437 | deployChild = true |
| 438 | common.warningMsg('Child cluster deployment will be enabled since custom cert child test suite will be executed') |
| 439 | } |
| 440 | |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 441 | if (commitMsg ==~ /(?s).*\[mgmt-custom-cache-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mgmt-custom-cache-cert-test\.*/) { |
| 442 | runMgmtCustomCacheCertTest = true |
| 443 | deployChild = true |
| 444 | common.warningMsg('Child cluster deployment will be enabled as the test replaces the mgmt and cluster childcertificates') |
| 445 | } |
| 446 | |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 447 | if (commitMsg ==~ /(?s).*\[mke-custom-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mke-custom-cert-test\.*/) { |
| 448 | runMkeCustomCertTest = true |
| 449 | } |
| 450 | |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 451 | if (commitMsg ==~ /(?s).*\[custom-hostnames\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*custom-hostnames\.*/) { |
| 452 | runCustomHostnames = true |
| 453 | common.warningMsg('All clusters will be deployed with Custom Hostnames') |
| 454 | } |
| 455 | |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 456 | if (commitMsg ==~ /(?s).*\[sl-latest\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*sl-latest\.*/) { |
| 457 | slLatest = true |
| 458 | common.warningMsg('All clusters will be deployed with Stacklight version from artifact-metadata') |
| 459 | } |
| 460 | |
vryzhenkin | a8d74e7 | 2024-02-26 14:59:37 +0400 | [diff] [blame] | 461 | if (commitMsg ==~ /(?s).*\[keycloak-ldap\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*keycloak-ldap\.*/) { |
| 462 | coreKeycloakLdap = true |
| 463 | common.warningMsg('Management cluster will be deployed with LDAP integration enabled and after-deployment checks will be executed') |
| 464 | } |
| 465 | |
Viktor Astakhov | adfcfb5 | 2024-05-16 16:56:21 +0400 | [diff] [blame] | 466 | if (commitMsg ==~ /(?s).*\[ntp-update\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*ntp-update\.*/) { |
| 467 | runNTPUpdateTest = true |
| 468 | common.warningMsg('After deployment of mgmt job with NTP update will be executed') |
| 469 | } |
| 470 | |
Viktor Astakhov | 8da448c | 2024-06-14 14:59:32 +0400 | [diff] [blame] | 471 | if (commitMsg ==~ /(?s).*\[mcc-maria-backup-restore\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*mcc-maria-backup-restore\.*/) { |
| 472 | runMCCMariaBackupRestoreTest = true |
| 473 | common.warningMsg('MCC Maria Backup/Restore test will be executed as part of mgmt test suite') |
| 474 | } |
| 475 | |
Viktor Astakhov | 4fda267 | 2024-08-29 16:38:25 +0400 | [diff] [blame] | 476 | if (commitMsg ==~ /(?s).*\[runtime-migrate-extended-mgmt\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*runtime-migrate-extended-mgmt\.*/) { |
| 477 | runRuntimeMigrateExtendedTestMgmt = true |
| 478 | common.warningMsg('Runtime migration with semi-reverts (extended test) scheduled as part of mgmt test suite') |
| 479 | } |
| 480 | |
| 481 | if (commitMsg ==~ /(?s).*\[runtime-migrate-quick-mgmt\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*runtime-migrate-quick-mgmt\.*/) { |
| 482 | runRuntimeMigrateQuickTestMgmt = true |
| 483 | common.warningMsg('Runtime migration of all nodes in one action (quick test) scheduled as part of mgmt test suite') |
| 484 | } |
| 485 | |
| 486 | if (commitMsg ==~ /(?s).*\[runtime-migrate-and-rollback-mgmt\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*runtime-migrate-and-rollback-mgmt\.*/) { |
| 487 | runRuntimeMigrateAndRollbackTestMgmt = true |
| 488 | common.warningMsg('Runtime migration with semi-reverts (extended test) and runtime rollback scheduled as part of mgmt test suite') |
| 489 | } |
| 490 | |
| 491 | if (commitMsg ==~ /(?s).*\[runtime-migrate-extended-child\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*runtime-migrate-extended-child\.*/) { |
| 492 | runRuntimeMigrateExtendedTestChild = true |
| 493 | common.warningMsg('Runtime migration with semi-reverts (extended test) scheduled as part of child test suite') |
| 494 | } |
| 495 | |
| 496 | if (commitMsg ==~ /(?s).*\[runtime-migrate-quick-child\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*runtime-migrate-quick-child\.*/) { |
| 497 | runRuntimeMigrateQuickTestChild = true |
| 498 | common.warningMsg('Runtime migration of all nodes in one action (quick test) scheduled as part of child test suite') |
| 499 | } |
| 500 | |
| 501 | if (commitMsg ==~ /(?s).*\[runtime-migrate-and-rollback-child\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*runtime-migrate-and-rollback-child\.*/) { |
| 502 | runRuntimeMigrateAndRollbackTestChild = true |
| 503 | common.warningMsg('Runtime migration with semi-reverts (extended test) and runtime rollback scheduled as part of child test suite') |
| 504 | } |
| 505 | |
vryzhenkin | e0ff1d8 | 2024-03-18 15:08:09 +0400 | [diff] [blame] | 506 | if (commitMsg ==~ /(?s).*\[internal-ntp\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*internal-ntp\.*/ || proxyConfig['mgmtOffline'] || proxyConfig['childOffline']) { |
| 507 | configureInternalNTP = true |
Sergey Lalov | 348f945 | 2024-04-18 10:34:04 +0000 | [diff] [blame] | 508 | openstackIMC = 'eu' |
| 509 | common.warningMsg('Internal NTP servers will be used. Forced deployment for an offline case in eu cloud') |
vryzhenkin | e0ff1d8 | 2024-03-18 15:08:09 +0400 | [diff] [blame] | 510 | } |
| 511 | |
Sergey Lalov | d7593ab | 2024-01-11 13:40:13 +0400 | [diff] [blame] | 512 | if (commitMsg ==~ /(?s).*\[disable-kube-api-audit\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-kube-api-audit\.*/) { |
| 513 | disableKubeApiAudit = true |
| 514 | common.warningMsg('Disable KUBE API audit for mgmt cluster') |
| 515 | } |
| 516 | |
Sergey Lalov | 26e24c2 | 2024-03-20 13:47:31 +0400 | [diff] [blame] | 517 | if (commitMsg ==~ /(?s).*\[auditd\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*disable-kube-api-audit\.*/) { |
| 518 | auditd = true |
| 519 | } |
| 520 | |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 521 | if (commitMsg ==~ /(?s).*\[byo-child-custom-cert-test\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*byo-child-custom-cert-test\.*/) { |
| 522 | runByoChildCustomCertTest = true |
| 523 | attachBYO = true |
| 524 | common.warningMsg('Byo child cluster deployment will be enabled since custom cert child test suite will be executed') |
| 525 | } |
| 526 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 527 | // TODO (vnaumov) remove below condition after moving all releases to UCP |
| 528 | def ucpChildMatches = (commitMsg =~ /(\[child-ucp\s*ucp-.*?\])/) |
| 529 | if (ucpChildMatches.size() > 0) { |
| 530 | deployChild = true |
| 531 | common.warningMsg('Forced UCP based child deployment triggered on patchset using custom keyword: \'[child-ucp ucp-5-1-0-3-3-0-example]\' ') |
| 532 | |
| 533 | // TODO(vnaumov) delete after ucp upgrades support |
| 534 | common.errorMsg('Child upgrade test will be skipped, UCP upgrades temporally disabled') |
| 535 | upgradeChild = false |
| 536 | } |
| 537 | |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 538 | if (commitMsg ==~ /(?s).*\[aio-cluster\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*aio-cluster.*/) { |
| 539 | aioCluster = true |
| 540 | } |
| 541 | |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 542 | if (commitMsg ==~ /(?s).*\[cache-warmup\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*cache-warmup.*/) { |
| 543 | runCacheWarmup = true |
| 544 | } |
| 545 | |
| 546 | if (runCacheWarmup && (!deployChild && !mosDeployChild)) { |
| 547 | runCacheWarmup = false |
| 548 | common.errorMsg('Child cluster deployment is not enabled, skipping Cache Warmup') |
| 549 | } |
| 550 | |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 551 | // multiregional tests |
| 552 | def multiRegionalMatches = (commitMsg =~ /(\[multiregion\s*.*?\])/) |
| 553 | if (multiRegionalMatches.size() > 0) { |
| 554 | multiregionalMappings = multiregionWorkflowParser(multiRegionalMatches) |
| 555 | } |
| 556 | switch (multiregionalMappings['managementLocation']) { |
| 557 | case 'aws': |
| 558 | common.warningMsg('Forced running additional kaas deployment with AWS provider according multiregional demo request') |
| 559 | awsOnDemandDemo = true |
| 560 | |
| 561 | if (multiregionalMappings['regionLocation'] != 'aws' && seedMacOs) { // macstadium seed node has access only to *public* providers |
| 562 | error('incompatible triggers: [seed-macos] and multiregional deployment based on *private* regional provider cannot be applied simultaneously') |
| 563 | } |
| 564 | break |
| 565 | case 'os': |
| 566 | if (enableOSDemo == false) { |
| 567 | error('incompatible triggers: [disable-os-demo] and multiregional deployment based on OSt management region cannot be applied simultaneously') |
| 568 | } |
| 569 | break |
| 570 | case 'vsphere': |
| 571 | if (enableVsphereDemo == false) { |
| 572 | error('incompatible triggers: [disable-vsphere-demo] and multiregional deployment based on Vsphere management region cannot be applied simultaneously') |
| 573 | } |
| 574 | break |
| 575 | case 'equinix': |
| 576 | common.warningMsg('Forced running additional kaas deployment with Equinix provider according multiregional demo request') |
| 577 | equinixOnDemandDemo = true |
| 578 | break |
| 579 | case 'equinixmetalv2': |
| 580 | common.warningMsg('Forced running additional kaas deployment with Equinix Metal V2 provider according multiregional demo request') |
| 581 | equinixMetalV2OnDemandDemo = true |
| 582 | break |
| 583 | case 'azure': |
| 584 | common.warningMsg('Forced running additional kaas deployment with Azure provider according multiregional demo request') |
| 585 | azureOnDemandDemo = true |
| 586 | break |
| 587 | } |
| 588 | |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 589 | // CDN configuration |
| 590 | def cdnConfig = [ |
| 591 | mgmt: [ |
Sergey Lalov | f80dab5 | 2024-04-19 14:16:52 +0000 | [diff] [blame] | 592 | openstack: 'internal-ci', |
Sergey Lalov | 3ad827f | 2024-04-19 18:40:21 +0400 | [diff] [blame] | 593 | vsphere: 'internal-eu', |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 594 | aws: 'public-ci', |
Владислав Наумов | e021b02 | 2021-05-06 11:26:38 +0200 | [diff] [blame] | 595 | equinix: 'public-ci', |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 596 | azure: 'public-ci', |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 597 | ], |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 598 | ] |
| 599 | |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 600 | if (commitMsg ==~ /(?s).*\[eu-demo\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*eu-demo.*/) { |
| 601 | openstackIMC = 'eu' |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 602 | } |
Sergey Lalov | ac6a8e7 | 2023-12-19 01:28:41 +0400 | [diff] [blame] | 603 | |
| 604 | if (openstackIMC == 'eu') { |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 605 | // use internal-eu because on internal-ci with eu cloud image pull takes much time |
Sergey Lalov | f80dab5 | 2024-04-19 14:16:52 +0000 | [diff] [blame] | 606 | def cdnRegion = 'internal-eu' |
slalov | 021171f | 2022-03-04 14:48:38 +0400 | [diff] [blame] | 607 | cdnConfig['mgmt']['openstack'] = cdnRegion |
| 608 | } |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 609 | |
Владислав Наумов | 74e2d6e | 2020-12-30 17:05:40 +0100 | [diff] [blame] | 610 | // calculate weight of current demo run to manage lockable resources |
Sergey Lalov | 46deb44 | 2022-08-18 12:11:03 +0400 | [diff] [blame] | 611 | def demoWeight = deployChild ? 2 : 1 // management = 1, child += 1 |
Sergey Lalov | 9504060 | 2023-03-07 16:42:16 +0400 | [diff] [blame] | 612 | if (runUie2e || runUie2eNew) { |
Sergey Lalov | 46deb44 | 2022-08-18 12:11:03 +0400 | [diff] [blame] | 613 | demoWeight += 1 |
| 614 | } |
Владислав Наумов | 74e2d6e | 2020-12-30 17:05:40 +0100 | [diff] [blame] | 615 | |
Sergey Lalov | eb611b2 | 2023-09-22 16:59:09 +0400 | [diff] [blame] | 616 | if (commitMsg ==~ /(?s).*\[bootstrapv1-scenario\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*bootstrapv1-scenario\.*/) { |
| 617 | bootstrapV2Scenario = false |
| 618 | } |
| 619 | |
Ivan Berezovskiy | 29e72b7 | 2022-07-12 21:03:24 +0400 | [diff] [blame] | 620 | if (commitMsg ==~ /(?s).*\[bootstrapv2-scenario\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*bootstrapv2-scenario\.*/) { |
| 621 | bootstrapV2Scenario = true |
| 622 | } |
| 623 | |
Mikhail Ivanov | 3088d3d | 2022-10-24 14:05:46 +0400 | [diff] [blame] | 624 | if (commitMsg ==~ /(?s).*\[enable-fips\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*enable-fips\.*/) { |
| 625 | enableFips = true |
| 626 | } |
| 627 | |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 628 | if (commitMsg ==~ /(?s).*\[enable-mke-debug\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*enable-mke-debug\.*/) { |
| 629 | enableMkeDebug = true |
| 630 | } |
| 631 | |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 632 | if (commitMsg ==~ /(?s).*\[vsphere-vvmt-obj\].*/ || env.GERRIT_EVENT_COMMENT_TEXT ==~ /(?s).*vsphere-vvmt-obj\.*/) { |
| 633 | useVsphereVvmtObjects = true |
| 634 | } |
| 635 | |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 636 | // parse equinixmetalv2-metro trigger |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 637 | def equinixMetalV2MetroMatcher = (commitMsg =~ /\[equinixmetalv2-metro(\s+.*)?\]/) |
| 638 | if (equinixMetalV2OnDemandDemo && equinixMetalV2MetroMatcher.size() > 0) { |
Sergey Zhemerdeev | cc785e4 | 2022-07-22 17:15:47 +0300 | [diff] [blame] | 639 | equinixMetalV2Metro = equinixMetalV2MetroMatcher[0][1].trim().toLowerCase() |
Sergey Zhemerdeev | dd31ce9 | 2022-07-19 14:15:22 +0300 | [diff] [blame] | 640 | common.infoMsg("Forced Equnix mgmt deployment using custom metro ${equinixMetalV2Metro}") |
| 641 | } |
| 642 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 643 | common.infoMsg(""" |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 644 | OpenStack Cloud location: ${openstackIMC} |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 645 | CDN deployment configuration: ${cdnConfig} |
| 646 | MCC offline deployment configuration: ${proxyConfig} |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 647 | Use MacOS node as seed: ${seedMacOs} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 648 | Child cluster deployment scheduled: ${deployChild} |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 649 | Custom child cluster release: ${customChildRelease} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 650 | Child cluster release upgrade scheduled: ${upgradeChild} |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 651 | Full Child cluster release upgrade scheduled: ${fullUpgradeChild} |
Mikhail Ivanov | 38ee438 | 2022-01-27 16:21:51 +0400 | [diff] [blame] | 652 | MOS child deploy scheduled: ${mosDeployChild} |
| 653 | MOS child upgrade scheduled: ${mosUpgradeChild} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 654 | Child conformance testing scheduled: ${runChildConformance} |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 655 | Child conformance network policy testing scheduled: ${runChildConformanceNetworkPolicy} |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 656 | Child HPA testing scheduled: ${runChildHPA} |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame] | 657 | Child Stacklight HA: ${runChildStacklightHa} |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 658 | Single BYO cluster attachment scheduled: ${attachBYO} |
| 659 | Single Attached BYO cluster upgrade test scheduled: ${upgradeBYO} |
| 660 | BYO test matrix whole suite scheduled: ${runBYOMatrix} |
Mikhail Ivanov | eabc9d9 | 2021-12-30 16:40:14 +0400 | [diff] [blame] | 661 | Default BYO OS: ${defaultBYOOs} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 662 | Mgmt cluster release upgrade scheduled: ${upgradeMgmt} |
slalov | 1202bba | 2022-04-20 22:31:07 +0400 | [diff] [blame] | 663 | Mgmt cluster release auto upgrade scheduled: ${autoUpgradeMgmt} |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 664 | Mgmt LMA logging enabled: ${enableLMALogging} |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 665 | Deploy Os on child with mos release ${deployOsOnMos} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 666 | Mgmt conformance testing scheduled: ${runMgmtConformance} |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 667 | Mgmt conformance network policy testing scheduled: ${runMgmtConformanceNetworkPolicy} |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 668 | LMA testing scheduled: ${runLMATest} |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 669 | Mgmt user controller testing scheduled: ${runMgmtUserControllerTest} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 670 | Mgmt UI e2e testing scheduled: ${runUie2e} |
Mikhail Ivanov | f5e20af | 2022-03-24 15:38:06 +0400 | [diff] [blame] | 671 | Mgmt UI e2e playwrite testing scheduled: ${runUie2eNew} |
slalov | 13e579c | 2022-01-31 21:37:02 +0400 | [diff] [blame] | 672 | Maintenance test: ${runMaintenanceTest} |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 673 | Container Registry test: ${runContainerregistryTest} |
slalov | 574123e | 2022-04-06 17:24:19 +0400 | [diff] [blame] | 674 | Child proxy test: ${runProxyChildTest} |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 675 | Graceful reboot test: ${runGracefulRebootTest} |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 676 | Delete mgmt master node test: ${runMgmtDeleteMasterTest} |
| 677 | Delete rgnl master node test: ${runRgnlDeleteMasterTest} |
| 678 | Delete child master node test: ${runChildDeleteMasterTest} |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 679 | Child machine deletion policy test: ${runChildMachineDeletionPolicyTest} |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 680 | Custom cert test for child clusters: ${runChildCustomCertTest} |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 681 | Custom cert test for Byo child clusters: ${runByoChildCustomCertTest} |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 682 | Custom cache cert test for mgmt and child clusters: ${runMgmtCustomCacheCertTest} |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 683 | MKE custom cert test for mgmt/region: ${runMkeCustomCertTest} |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 684 | Custom hostnames for all clisuers: ${runCustomHostnames} |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 685 | Stacklight templates enchanced with latest version from artifact-metadata: ${slLatest} |
Sergey Lalov | d7593ab | 2024-01-11 13:40:13 +0400 | [diff] [blame] | 686 | Disable Kubernetes API audit: ${disableKubeApiAudit} |
Sergey Lalov | 26e24c2 | 2024-03-20 13:47:31 +0400 | [diff] [blame] | 687 | Enable Auditd : ${auditd} |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 688 | AWS provider deployment scheduled: ${awsOnDemandDemo} |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 689 | Equinix provider deployment scheduled: ${equinixOnDemandDemo} |
Владислав Наумов | 144956f | 2021-10-14 17:49:19 +0200 | [diff] [blame] | 690 | EquinixmetalV2 provider deployment scheduled: ${equinixMetalV2OnDemandDemo} |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 691 | EquinixmetalV2 child deploy in a separate metro scheduled: ${equinixMetalV2ChildDiffMetro} |
Sergey Zhemerdeev | 019c45a | 2022-08-13 00:09:07 +0300 | [diff] [blame] | 692 | EquinixmetalV2 mgmt will be deployed on the metro: ${equinixMetalV2Metro?:'auto'} |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 693 | Equinix@AWS child cluster deployment scheduled: ${equinixOnAwsDemo} |
| 694 | Azure provider deployment scheduled: ${azureOnDemandDemo} |
| 695 | Azure@AWS child cluster deployment scheduled: ${azureOnAwsDemo} |
Ivan Berezovskiy | f9bcfd6 | 2021-03-18 18:41:38 +0400 | [diff] [blame] | 696 | VSPHERE provider deployment scheduled: ${enableVsphereDemo} |
Владислав Наумов | 4eb1da3 | 2020-08-31 14:45:16 +0200 | [diff] [blame] | 697 | OS provider deployment scheduled: ${enableOSDemo} |
Sergey Lalov | d0e2085 | 2023-08-17 19:11:19 +0400 | [diff] [blame] | 698 | BM Core provider deployment scheduled: ${enablebmCoreDemo} |
| 699 | BM Core type deplyment: ${bmDeployType} |
| 700 | BM Core cleanup: ${bmCoreCleanup} |
azvyagintsev | 1761bdc | 2020-09-04 17:24:12 +0300 | [diff] [blame] | 701 | BM provider deployment scheduled: ${enableBMDemo} |
Alexandr Lovtsov | 36473f3 | 2022-04-28 15:46:09 +0300 | [diff] [blame] | 702 | Ubuntu on vSphere scheduled: ${enableVsphereUbuntu} |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 703 | RHEL on vSphere scheduled: ${enableVsphereRHEL} |
Mikhail Ivanov | bd1a9fd | 2022-03-29 21:36:21 +0400 | [diff] [blame] | 704 | Artifacts build scheduled: ${enableArtifactsBuild} |
Sergey Zhemerdeev | e67fb26 | 2022-06-21 00:49:34 +0300 | [diff] [blame] | 705 | Boot OS child from Ceph volumes: ${childOsBootFromVolume} |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 706 | Multiregional configuration: ${multiregionalMappings} |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 707 | Service binaries fetching scheduled: ${fetchServiceBinaries} |
Владислав Наумов | 74e2d6e | 2020-12-30 17:05:40 +0100 | [diff] [blame] | 708 | Current weight of the demo run: ${demoWeight} (Used to manage lockable resources) |
Ivan Berezovskiy | 29e72b7 | 2022-07-12 21:03:24 +0400 | [diff] [blame] | 709 | Bootstrap v2 scenario enabled: ${bootstrapV2Scenario} |
Mikhail Ivanov | 3088d3d | 2022-10-24 14:05:46 +0400 | [diff] [blame] | 710 | FIPS enabled: ${enableFips} |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 711 | MKE DEBUG enabled: ${enableMkeDebug} |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 712 | Pause for debug enabled: ${pauseForDebug} |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 713 | AIO cluster: ${aioCluster} |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 714 | Use Vsphere VVMT Objects: ${useVsphereVvmtObjects} |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 715 | Bootsrap v2 smoke checks enabled: ${enableBv2Smoke} |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 716 | Run Cache warmup for child clusters: ${runCacheWarmup} |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 717 | CVE Scan enabled: ${cveScan} |
vryzhenkin | a8d74e7 | 2024-02-26 14:59:37 +0400 | [diff] [blame] | 718 | Keycloak+LDAP integration enabled: ${coreKeycloakLdap} |
Viktor Astakhov | adfcfb5 | 2024-05-16 16:56:21 +0400 | [diff] [blame] | 719 | NTP update job scheduled: ${runNTPUpdateTest} |
Viktor Astakhov | 8da448c | 2024-06-14 14:59:32 +0400 | [diff] [blame] | 720 | MCC MariaDB Backup/Restore test enabled: ${runMCCMariaBackupRestoreTest} |
Sergey Kolekonov | 7514843 | 2024-07-16 13:22:36 +0500 | [diff] [blame] | 721 | Sync to public-ci CDN enabled: ${publicCISync} |
Viktor Astakhov | 4fda267 | 2024-08-29 16:38:25 +0400 | [diff] [blame] | 722 | Mgmt runtime migration (extended) enabled: ${runRuntimeMigrateExtendedTestMgmt} |
| 723 | Mgmt runtime migration (quick) enabled: ${runRuntimeMigrateQuickTestMgmt} |
| 724 | Mgmt runtime migration (extended) with rollback enabled: ${runRuntimeMigrateAndRollbackTestMgmt} |
| 725 | Child runtime migration (extended) enabled: ${runRuntimeMigrateExtendedTestChild} |
| 726 | Child runtime migration (quick) enabled: ${runRuntimeMigrateQuickTestChild} |
| 727 | Child runtime migration (extended) with rollback enabled: ${runRuntimeMigrateAndRollbackTestChild} |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 728 | Triggers: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md""") |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 729 | return [ |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 730 | osCloudLocation : openstackIMC, |
| 731 | cdnConfig : cdnConfig, |
| 732 | proxyConfig : proxyConfig, |
| 733 | useMacOsSeedNode : seedMacOs, |
| 734 | deployChildEnabled : deployChild, |
| 735 | childDeployCustomRelease : customChildRelease, |
| 736 | upgradeChildEnabled : upgradeChild, |
| 737 | fullUpgradeChildEnabled : fullUpgradeChild, |
| 738 | mosDeployChildEnabled : mosDeployChild, |
| 739 | mosUpgradeChildEnabled : mosUpgradeChild, |
| 740 | runChildConformanceEnabled : runChildConformance, |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 741 | runChildConformanceNetworkPolicyEnabled : runChildConformanceNetworkPolicy, |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 742 | runChildHPAEnabled : runChildHPA, |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame] | 743 | runChildStacklightHaEnabled : runChildStacklightHa, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 744 | attachBYOEnabled : attachBYO, |
| 745 | upgradeBYOEnabled : upgradeBYO, |
| 746 | runBYOMatrixEnabled : runBYOMatrix, |
| 747 | defaultBYOOs : defaultBYOOs, |
| 748 | upgradeMgmtEnabled : upgradeMgmt, |
| 749 | autoUpgradeMgmtEnabled : autoUpgradeMgmt, |
| 750 | enableLMALoggingEnabled : enableLMALogging, |
| 751 | deployOsOnMosEnabled : deployOsOnMos, |
| 752 | runUie2eEnabled : runUie2e, |
| 753 | runUie2eNewEnabled : runUie2eNew, |
| 754 | runMgmtConformanceEnabled : runMgmtConformance, |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 755 | runMgmtConformanceNetworkPolicyEnabled : runMgmtConformanceNetworkPolicy, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 756 | runMaintenanceTestEnabled : runMaintenanceTest, |
| 757 | runContainerregistryTestEnabled : runContainerregistryTest, |
| 758 | runGracefulRebootTestEnabled : runGracefulRebootTest, |
| 759 | pauseForDebugEnabled : pauseForDebug, |
| 760 | runMgmtDeleteMasterTestEnabled : runMgmtDeleteMasterTest, |
| 761 | runRgnlDeleteMasterTestEnabled : runRgnlDeleteMasterTest, |
| 762 | runChildDeleteMasterTestEnabled : runChildDeleteMasterTest, |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 763 | runChildCustomCertTestEnabled : runChildCustomCertTest, |
Sergey Lalov | 7c2377e | 2023-12-15 23:14:45 +0400 | [diff] [blame] | 764 | customSlackChannelEnabled : customSlackChannel, |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 765 | runMgmtCustomCacheCertTestEnabled : runMgmtCustomCacheCertTest, |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 766 | runMkeCustomCertTestEnabled : runMkeCustomCertTest, |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 767 | runCustomHostnamesEnabled : runCustomHostnames, |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 768 | slLatestEnabled : slLatest, |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 769 | runByoChildCustomCertTestEnabled : runByoChildCustomCertTest, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 770 | runChildMachineDeletionPolicyTestEnabled : runChildMachineDeletionPolicyTest, |
| 771 | runLMATestEnabled : runLMATest, |
| 772 | runMgmtUserControllerTestEnabled : runMgmtUserControllerTest, |
| 773 | runProxyChildTestEnabled : runProxyChildTest, |
| 774 | fetchServiceBinariesEnabled : fetchServiceBinaries, |
| 775 | awsOnDemandDemoEnabled : awsOnDemandDemo, |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 776 | equinixOnDemandDemoEnabled : equinixOnDemandDemo, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 777 | equinixMetalV2OnDemandDemoEnabled : equinixMetalV2OnDemandDemo, |
| 778 | equinixMetalV2ChildDiffMetroEnabled : equinixMetalV2ChildDiffMetro, |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 779 | equinixOnAwsDemoEnabled : equinixOnAwsDemo, |
| 780 | azureOnDemandDemoEnabled : azureOnDemandDemo, |
| 781 | azureOnAwsDemoEnabled : azureOnAwsDemo, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 782 | vsphereDemoEnabled : enableVsphereDemo, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 783 | bmDemoEnabled : enableBMDemo, |
Sergey Lalov | d0e2085 | 2023-08-17 19:11:19 +0400 | [diff] [blame] | 784 | bmCoreDemoEnabled : enablebmCoreDemo, |
| 785 | bmCoreCleanup : bmCoreCleanup, |
Sergey Lalov | 4ea2cbc | 2024-04-04 21:41:47 +0400 | [diff] [blame] | 786 | bmDeployType : bmDeployType, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 787 | osDemoEnabled : enableOSDemo, |
| 788 | vsphereUbuntuEnabled : enableVsphereUbuntu, |
Ivan Berezovskiy | 30c4b12 | 2023-11-06 18:03:18 +0500 | [diff] [blame] | 789 | vsphereRHELEnabled : enableVsphereRHEL, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 790 | artifactsBuildEnabled : enableArtifactsBuild, |
| 791 | childOsBootFromVolume : childOsBootFromVolume, |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 792 | multiregionalConfiguration : multiregionalMappings, |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 793 | demoWeight : demoWeight, |
| 794 | bootstrapV2Scenario : bootstrapV2Scenario, |
| 795 | equinixMetalV2Metro : equinixMetalV2Metro, |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 796 | enableFips : enableFips, |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 797 | enableMkeDebugEnabled : enableMkeDebug, |
Mikhail Morgoev | 58855c1 | 2023-02-10 14:57:31 +0100 | [diff] [blame] | 798 | aioCluster : aioCluster, |
vryzhenkin | 4fd3f24 | 2023-03-29 15:13:46 +0400 | [diff] [blame] | 799 | useVsphereVvmtObjects : useVsphereVvmtObjects, |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 800 | bv2SmokeEnabled : enableBv2Smoke, |
| 801 | runCacheWarmup : runCacheWarmup, |
vryzhenkin | 211a4e8 | 2023-11-23 12:48:27 +0400 | [diff] [blame] | 802 | cveScanEnabled : cveScan, |
Sergey Lalov | d7593ab | 2024-01-11 13:40:13 +0400 | [diff] [blame] | 803 | disableKubeApiAudit : disableKubeApiAudit, |
Sergey Lalov | 26e24c2 | 2024-03-20 13:47:31 +0400 | [diff] [blame] | 804 | auditdEnabled : auditd, |
vryzhenkin | a8d74e7 | 2024-02-26 14:59:37 +0400 | [diff] [blame] | 805 | coreKeycloakLdapEnabled : coreKeycloakLdap, |
vryzhenkin | e0ff1d8 | 2024-03-18 15:08:09 +0400 | [diff] [blame] | 806 | internalNTPServersEnabled : configureInternalNTP, |
Viktor Astakhov | adfcfb5 | 2024-05-16 16:56:21 +0400 | [diff] [blame] | 807 | runNTPUpdateTestEnabled : runNTPUpdateTest, |
Viktor Astakhov | 8da448c | 2024-06-14 14:59:32 +0400 | [diff] [blame] | 808 | runMCCMariaBackupRestoreTestEnabled : runMCCMariaBackupRestoreTest, |
Sergey Kolekonov | 7514843 | 2024-07-16 13:22:36 +0500 | [diff] [blame] | 809 | publicCISyncEnabled : publicCISync, |
Viktor Astakhov | 4fda267 | 2024-08-29 16:38:25 +0400 | [diff] [blame] | 810 | runtimeMigrateExtendedMgmtEnabled : runRuntimeMigrateExtendedTestMgmt, |
| 811 | runtimeMigrateQuickMgmtEnabled : runRuntimeMigrateQuickTestMgmt, |
| 812 | runtimeMigrateMgmtAndRollbackEnabled : runRuntimeMigrateAndRollbackTestMgmt, |
| 813 | runtimeMigrateExtendedChildEnabled : runRuntimeMigrateExtendedTestChild, |
| 814 | runtimeMigrateQuickChildEnabled : runRuntimeMigrateQuickTestChild, |
| 815 | runtimeMigrateChildAndRollbackEnabled : runRuntimeMigrateAndRollbackTestChild, |
Ivan Berezovskiy | 02baa98 | 2023-06-06 12:46:27 +0400 | [diff] [blame] | 816 | ] |
Владислав Наумов | 765f3bd | 2020-09-07 18:09:24 +0200 | [diff] [blame] | 817 | } |
| 818 | |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 819 | /** |
| 820 | * Determine management and regional setup for demo workflow scenario |
| 821 | * |
| 822 | * |
| 823 | * @param: keyword (string) string , represents keyword trigger, specified in gerrit commit body, like `[multiregion aws,os]` |
| 824 | or Jenkins environment string variable in form like 'aws,os' |
| 825 | * @return (map)[ |
| 826 | enabled: (bool), |
| 827 | * managementLocation: (string), //aws,os |
| 828 | * regionLocation: (string), //aws,os |
| 829 | * ] |
| 830 | */ |
| 831 | def multiregionWorkflowParser(keyword) { |
| 832 | def common = new com.mirantis.mk.Common() |
| 833 | def supportedManagementProviders = ['os', 'aws', 'vsphere', 'equinix', 'equinixmetalv2', 'azure'] |
| 834 | def supportedRegionalProviders = ['os', 'vsphere', 'equinix', 'equinixmetalv2', 'bm', 'azure', 'aws'] |
| 835 | |
| 836 | def clusterTypes = '' |
| 837 | if (keyword.toString().contains('multiregion')) { |
| 838 | common.infoMsg('Multiregion definition configured via gerrit keyword trigger') |
| 839 | clusterTypes = keyword[0][0].split('multiregion')[1].replaceAll('[\\[\\]]', '').trim().split(',') |
| 840 | } else { |
| 841 | common.infoMsg('Multiregion definition configured via environment variable') |
| 842 | clusterTypes = keyword.trim().split(',') |
| 843 | } |
| 844 | |
| 845 | if (clusterTypes.size() != 2) { |
| 846 | error("Incorrect regions definiton, valid scheme: [multiregion ${management}, ${region}], got: ${clusterTypes}") |
| 847 | } |
| 848 | |
| 849 | def desiredManagementProvider = clusterTypes[0].trim() |
| 850 | def desiredRegionalProvider = clusterTypes[1].trim() |
| 851 | if (! supportedManagementProviders.contains(desiredManagementProvider) || ! supportedRegionalProviders.contains(desiredRegionalProvider)) { |
| 852 | error("""unsupported management <-> regional bundle, available options: |
| 853 | management providers list - ${supportedManagementProviders} |
| 854 | regional providers list - ${supportedRegionalProviders}""") |
| 855 | } |
| 856 | |
| 857 | return [ |
| 858 | enabled: true, |
| 859 | managementLocation: desiredManagementProvider, |
| 860 | regionLocation: desiredRegionalProvider, |
| 861 | ] |
| 862 | } |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 863 | |
| 864 | /** |
| 865 | * Determine if custom si tests/pipelines refspec forwarded from gerrit change request |
| 866 | |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 867 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 868 | * Used for components team to test component changes w/ custom SI refspecs using kaas/core deployment jobs |
| 869 | * Example scheme: |
| 870 | * New CR pushed in kubernetes/lcm-ansible -> parsing it's commit body and get custom test refspecs -> trigger deployment jobs from kaas/core |
| 871 | * manage refspecs through Jenkins Job Parameters |
| 872 | * |
azvyagintsev | a12230a | 2020-06-05 13:24:06 +0300 | [diff] [blame] | 873 | * @return (map)[* siTests: (string) final refspec for si-tests |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 874 | * siPipelines: (string) final refspec for si-pipelines |
| 875 | * ] |
| 876 | */ |
| 877 | def checkCustomSIRefspec() { |
vnaumov | bdb9022 | 2020-05-04 18:25:50 +0200 | [diff] [blame] | 878 | def common = new com.mirantis.mk.Common() |
| 879 | |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 880 | // Available triggers and its sane defaults |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 881 | def siTestsRefspec = env.SI_TESTS_REFSPEC ?: 'master' |
| 882 | def siPipelinesRefspec = env.SI_PIPELINES_REFSPEC ?: 'master' |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 883 | def siTestsDockerImage = env.SI_TESTS_DOCKER_IMAGE ?: 'docker-dev-kaas-local.docker.mirantis.net/mirantis/kaas/si-test' |
| 884 | def siTestsDockerImageTag = env.SI_TESTS_DOCKER_IMAGE_TAG ?: 'master' |
Владислав Наумов | 6c2afff | 2020-06-05 12:54:53 +0200 | [diff] [blame] | 885 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 886 | |
| 887 | def siTestMatches = (commitMsg =~ /(\[si-tests-ref\s*refs\/changes\/.*?\])/) |
| 888 | def siPipelinesMatches = (commitMsg =~ /(\[si-pipelines-ref\s*refs\/changes\/.*?\])/) |
| 889 | |
| 890 | if (siTestMatches.size() > 0) { |
| 891 | siTestsRefspec = siTestMatches[0][0].split('si-tests-ref')[1].replaceAll('[\\[\\]]', '').trim() |
Владислав Наумов | 7f6c088 | 2021-03-23 19:10:57 +0400 | [diff] [blame] | 892 | siTestsDockerImage = "docker-review-local.docker.mirantis.net/review/kaas-si-test-${siTestsRefspec.split('/')[-2]}" |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 893 | siTestsDockerImageTag = siTestsRefspec.split('/')[-1] |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 894 | } |
| 895 | if (siPipelinesMatches.size() > 0) { |
| 896 | siPipelinesRefspec = siPipelinesMatches[0][0].split('si-pipelines-ref')[1].replaceAll('[\\[\\]]', '').trim() |
| 897 | } |
| 898 | |
| 899 | common.infoMsg(""" |
| 900 | kaas/si-pipelines will be fetched from: ${siPipelinesRefspec} |
| 901 | kaas/si-tests will be fetched from: ${siTestsRefspec} |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 902 | kaas/si-tests as dockerImage will be fetched from: ${siTestsDockerImage}:${siTestsDockerImageTag} |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 903 | Keywords: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md""") |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 904 | return [siTests: siTestsRefspec, siPipelines: siPipelinesRefspec, siTestsDockerImage: siTestsDockerImage, siTestsDockerImageTag: siTestsDockerImageTag] |
vnaumov | 33747e1 | 2020-05-04 17:35:20 +0200 | [diff] [blame] | 905 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 906 | |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 907 | /** |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 908 | * Parse additional configuration for kaas component CICD repo |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 909 | * @param configurationFile (str) path to configuration file in yaml format |
| 910 | * |
| 911 | * @return (map)[ siTestsFeatureFlags (string) dedicated feature flags that will be used in SI tests, |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 912 | * siTestsFeatureFlagsStable (string) dedicated feature flags that will be used in SI tests for deploying stable release |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 913 | * ] |
| 914 | */ |
| 915 | def parseKaaSComponentCIParameters(configurationFile){ |
| 916 | def common = new com.mirantis.mk.Common() |
| 917 | def ciConfig = readYaml file: configurationFile |
| 918 | def ciSpec = [ |
| 919 | siTestsFeatureFlags: env.SI_TESTS_FEATURE_FLAGS ?: '', |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 920 | siTestsFeatureFlagsStable: env.SI_TESTS_FEATURE_FLAGS_STABLE ?: '', |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 921 | ] |
| 922 | |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 923 | // If exists and not empty |
| 924 | if (ciConfig.getOrDefault('si-tests-feature-flags', [])) { |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 925 | common.infoMsg("""SI tests feature flags customization detected, |
| 926 | results will be merged with existing flags: [${ciSpec['siTestsFeatureFlags']}] identification...""") |
| 927 | |
| 928 | def ffMeta = ciSpec['siTestsFeatureFlags'].tokenize(',').collect { it.trim() } |
| 929 | ffMeta.addAll(ciConfig['si-tests-feature-flags']) |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 930 | |
Владислав Наумов | cb5ffca | 2020-07-14 15:28:36 +0200 | [diff] [blame] | 931 | ciSpec['siTestsFeatureFlags'] = ffMeta.unique().join(',') |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 932 | common.infoMsg("SI tests custom feature flags: ${ciSpec['siTestsFeatureFlags']}") |
| 933 | } |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 934 | if (ciConfig.getOrDefault('si-tests-feature-flags-stable', [])) { |
| 935 | common.infoMsg("""SI tests feature flags for stable release customization detected, |
| 936 | results will be merged with existing flags: [${ciSpec['siTestsFeatureFlagsStable']}] identification...""") |
| 937 | |
| 938 | def ffMeta = ciSpec['siTestsFeatureFlagsStable'].tokenize(',').collect { it.trim() } |
| 939 | ffMeta.addAll(ciConfig['si-tests-feature-flags-stable']) |
| 940 | |
| 941 | ciSpec['siTestsFeatureFlagsStable'] = ffMeta.unique().join(',') |
| 942 | common.infoMsg("SI tests custom feature flags for stable release: ${ciSpec['siTestsFeatureFlagsStable']}") |
| 943 | } |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 944 | |
| 945 | common.infoMsg("""Additional ci configuration parsed successfully: |
Alexandr Lovtsov | 1c78e45 | 2022-08-29 20:57:51 +0300 | [diff] [blame] | 946 | siTestsFeatureFlags: ${ciSpec['siTestsFeatureFlags']} |
| 947 | siTestsFeatureFlagsStable: ${ciSpec['siTestsFeatureFlagsStable']}""") |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 948 | return ciSpec |
| 949 | } |
| 950 | |
| 951 | /** |
| 952 | * Determine if custom kaas core/pipelines refspec forwarded from gerrit change request |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 953 | |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 954 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 955 | * Used for components team to test component changes w/ custom Core refspecs using kaas/core deployment jobs |
| 956 | * Example scheme: |
| 957 | * New CR pushed in kubernetes/lcm-ansible -> parsing it's commit body and get custom test refspecs -> trigger deployment jobs from kaas/core |
| 958 | * manage refspecs through Jenkins Job Parameters |
| 959 | * |
| 960 | * @return (map)[ core: (string) final refspec for kaas/core |
| 961 | * corePipelines: (string) final refspec for pipelines in kaas/core |
| 962 | * ] |
| 963 | */ |
| 964 | def checkCustomCoreRefspec() { |
| 965 | def common = new com.mirantis.mk.Common() |
| 966 | |
| 967 | // Available triggers and its sane defaults |
| 968 | def coreRefspec = env.KAAS_CORE_REFSPEC ?: 'master' |
| 969 | // by default using value of GERRIT_REFSPEC parameter in *kaas/core jobs* |
| 970 | def corePipelinesRefspec = env.KAAS_PIPELINE_REFSPEC ?: '\$GERRIT_REFSPEC' |
| 971 | def commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
| 972 | |
| 973 | def coreMatches = (commitMsg =~ /(\[core-ref\s*refs\/changes\/.*?\])/) |
| 974 | def corePipelinesMatches = (commitMsg =~ /(\[core-pipelines-ref\s*refs\/changes\/.*?\])/) |
| 975 | |
| 976 | if (coreMatches.size() > 0) { |
| 977 | coreRefspec = coreMatches[0][0].split('core-ref')[1].replaceAll('[\\[\\]]', '').trim() |
| 978 | } |
| 979 | if (corePipelinesMatches.size() > 0) { |
| 980 | corePipelinesRefspec = corePipelinesMatches[0][0].split('core-pipelines-ref')[1].replaceAll('[\\[\\]]', '').trim() |
| 981 | } |
| 982 | |
| 983 | common.infoMsg(""" |
| 984 | kaas/core will be fetched from: ${coreRefspec} |
| 985 | kaas/core pipelines will be fetched from: ${corePipelinesRefspec} |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 986 | Keywords: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md""") |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 987 | return [core: coreRefspec, corePipelines: corePipelinesRefspec] |
| 988 | } |
| 989 | |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 990 | |
| 991 | /** |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 992 | * generate Jenkins Parameter objects from from text parameter with additonal kaas core context |
| 993 | * needed to forward inside kaas core set of jobs |
| 994 | * |
| 995 | * @param context (string) Representation of the string enviroment variables needed for kaas core jobs in yaml format |
| 996 | * @return (list)[ string(name: '', value: ''), |
| 997 | * ] |
| 998 | */ |
| 999 | def generateKaaSVarsFromContext(context) { |
| 1000 | def common = new com.mirantis.mk.Common() |
| 1001 | def parameters = [] |
| 1002 | def config = readYaml text: context |
| 1003 | |
| 1004 | config.each { k,v -> |
| 1005 | common.infoMsg("Custom KaaS Core context parameter: ${k}=${v}") |
| 1006 | parameters.add(string(name: k, value: v)) |
| 1007 | } |
| 1008 | |
| 1009 | return parameters |
| 1010 | } |
| 1011 | |
| 1012 | /** |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1013 | * Trigger KaaS demo jobs based on AWS/OS providers with customized test suite, parsed from external sources (gerrit commit/jj vars) |
Владислав Наумов | 8177747 | 2021-03-09 15:14:27 +0400 | [diff] [blame] | 1014 | * Keyword list: https://gerrit.mcp.mirantis.com/plugins/gitiles/kaas/core/+/refs/heads/master/hack/ci-gerrit-keywords.md |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1015 | * Used for components team to test component changes w/ customized SI tests/refspecs using kaas/core deployment jobs |
| 1016 | * |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 1017 | * @param: component (string) component name [iam, lcm, stacklight] |
| 1018 | * @param: patchSpec (string) Patch for kaas/cluster releases in json format |
| 1019 | * @param: configurationFile (string) Additional file for component repo CI config in yaml format |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1020 | */ |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1021 | def triggerPatchedComponentDemo(component, patchSpec = '', configurationFile = '.ci-parameters.yaml', coreContext = '') { |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1022 | def common = new com.mirantis.mk.Common() |
| 1023 | // Determine if custom trigger keywords forwarded from gerrit |
| 1024 | def triggers = checkDeploymentTestSuite() |
| 1025 | // Determine SI refspecs |
| 1026 | def siRefspec = checkCustomSIRefspec() |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 1027 | // Determine Core refspecs |
| 1028 | def coreRefspec = checkCustomCoreRefspec() |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1029 | |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 1030 | // Determine component repo ci configuration |
| 1031 | def ciSpec = [:] |
| 1032 | def componentFeatureFlags = env.SI_TESTS_FEATURE_FLAGS ?: '' |
| 1033 | if (fileExists(configurationFile)) { |
| 1034 | common.infoMsg('Component CI configuration file detected, parsing...') |
| 1035 | ciSpec = parseKaaSComponentCIParameters(configurationFile) |
| 1036 | componentFeatureFlags = ciSpec['siTestsFeatureFlags'] |
| 1037 | } else { |
| 1038 | common.warningMsg('''Component CI configuration file is not exists, |
Владислав Наумов | c17dd55 | 2020-07-29 17:07:38 +0200 | [diff] [blame] | 1039 | several code-management features may be unavailable, |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1040 | follow https://mirantis.jira.com/wiki/spaces/QA/pages/2310832276/SI-tests+feature+flags#%5BUpdated%5D-Using-a-feature-flag |
| 1041 | to create the configuration file''') |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 1042 | } |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1043 | |
| 1044 | def platforms = [] |
| 1045 | if (component == 'ipam' && triggers.vsphereDemoEnabled) { |
| 1046 | // Currently only vsphere demo is required for IPAM component |
| 1047 | platforms.add('vsphere') |
| 1048 | } else { |
| 1049 | if (triggers.osDemoEnabled) { |
| 1050 | platforms.add('openstack') |
| 1051 | } |
| 1052 | if (triggers.awsOnDemandDemoEnabled) { |
| 1053 | platforms.add('aws') |
| 1054 | } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1055 | if (triggers.equinixOnDemandDemoEnabled) { |
| 1056 | platforms.add('equinix') |
| 1057 | } |
Владислав Наумов | 144956f | 2021-10-14 17:49:19 +0200 | [diff] [blame] | 1058 | if (triggers.equinixMetalV2OnDemandDemoEnabled) { |
| 1059 | platforms.add('equinixmetalv2') |
| 1060 | } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1061 | if (triggers.azureOnDemandDemoEnabled) { |
| 1062 | platforms.add('azure') |
| 1063 | } |
Ivan Berezovskiy | b0229d0 | 2021-05-17 16:55:18 +0400 | [diff] [blame] | 1064 | if (triggers.vsphereDemoEnabled) { |
| 1065 | platforms.add('vsphere') |
| 1066 | } |
Sergey Kolekonov | 8e4de18 | 2024-03-05 15:07:07 +0500 | [diff] [blame] | 1067 | if (triggers.bmCoreDemoEnabled) { |
| 1068 | platforms.add('bm') |
| 1069 | } |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1070 | } |
| 1071 | |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1072 | def jobs = [:] |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1073 | def parameters = [ |
Владислав Наумов | 9080f37 | 2020-06-08 13:57:16 +0200 | [diff] [blame] | 1074 | string(name: 'GERRIT_REFSPEC', value: coreRefspec.core), |
| 1075 | string(name: 'KAAS_PIPELINE_REFSPEC', value: coreRefspec.corePipelines), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1076 | string(name: 'SI_TESTS_REFSPEC', value: siRefspec.siTests), |
Владислав Наумов | 418042b | 2020-07-09 18:31:10 +0200 | [diff] [blame] | 1077 | string(name: 'SI_TESTS_FEATURE_FLAGS', value: componentFeatureFlags), |
Владислав Наумов | 2db15e2 | 2020-07-14 12:29:22 +0200 | [diff] [blame] | 1078 | string(name: 'SI_TESTS_DOCKER_IMAGE', value: siRefspec.siTestsDockerImage), |
| 1079 | string(name: 'SI_TESTS_DOCKER_IMAGE_TAG', value: siRefspec.siTestsDockerImageTag), |
Владислав Наумов | 4a5c324 | 2020-06-08 14:36:11 +0200 | [diff] [blame] | 1080 | string(name: 'SI_PIPELINES_REFSPEC', value: siRefspec.siPipelines), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1081 | string(name: 'CUSTOM_RELEASE_PATCH_SPEC', value: patchSpec), |
Mikhail Ivanov | 7450437 | 2021-05-21 17:01:06 +0400 | [diff] [blame] | 1082 | string(name: 'KAAS_CHILD_CLUSTER_RELEASE_NAME', value: triggers.childDeployCustomRelease), |
Mikhail Ivanov | b6283f7 | 2021-11-24 18:34:57 +0400 | [diff] [blame] | 1083 | string(name: 'OPENSTACK_CLOUD_LOCATION', value: triggers.osCloudLocation), |
Sergey Lalov | 7c2377e | 2023-12-15 23:14:45 +0400 | [diff] [blame] | 1084 | string(name: 'SLACK_CHANNEL_NOTIFY', value: triggers.customSlackChannelEnabled), |
Sergey Lalov | 4ea2cbc | 2024-04-04 21:41:47 +0400 | [diff] [blame] | 1085 | string(name: 'BM_DEPLOY_TYPE', value: triggers.bmDeployType), |
Владислав Наумов | b8305e2 | 2021-02-10 17:23:12 +0100 | [diff] [blame] | 1086 | booleanParam(name: 'OFFLINE_MGMT_CLUSTER', value: triggers.proxyConfig['mgmtOffline']), |
Владислав Наумов | f8f23fa | 2021-04-01 16:57:52 +0200 | [diff] [blame] | 1087 | booleanParam(name: 'OFFLINE_CHILD_CLUSTER', value: triggers.proxyConfig['childOffline']), |
Владислав Наумов | 257ea13 | 2021-04-14 14:44:13 +0200 | [diff] [blame] | 1088 | booleanParam(name: 'PROXY_CHILD_CLUSTER', value: triggers.proxyConfig['childProxy']), |
Владислав Наумов | 44c64b7 | 2020-12-04 20:22:53 +0100 | [diff] [blame] | 1089 | booleanParam(name: 'SEED_MACOS', value: triggers.useMacOsSeedNode), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 1090 | booleanParam(name: 'UPGRADE_MGMT_CLUSTER', value: triggers.upgradeMgmtEnabled), |
slalov | 1202bba | 2022-04-20 22:31:07 +0400 | [diff] [blame] | 1091 | booleanParam(name: 'AUTO_UPGRADE_MCC', value: triggers.autoUpgradeMgmtEnabled), |
Victor Ryzhenkin | d2b7b66 | 2021-08-23 14:18:38 +0400 | [diff] [blame] | 1092 | booleanParam(name: 'ENABLE_LMA_LOGGING', value: triggers.enableLMALoggingEnabled), |
Sergey Kolekonov | 7586164 | 2024-10-28 18:38:15 +0500 | [diff] [blame^] | 1093 | booleanParam(name: 'DEPLOY_MOS_CHILD_CLUSTER', value: triggers.mosDeployChildEnabled), |
Sergey Lalov | b2f6037 | 2022-09-20 23:58:47 +0400 | [diff] [blame] | 1094 | booleanParam(name: 'DEPLOY_OS_ON_MOS', value: triggers.deployOsOnMosEnabled), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1095 | booleanParam(name: 'RUN_UI_E2E', value: triggers.runUie2eEnabled), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 1096 | booleanParam(name: 'RUN_MGMT_CFM', value: triggers.runMgmtConformanceEnabled), |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 1097 | booleanParam(name: 'RUN_MGMT_CFM_NETWORK_POLICY', value: triggers.runMgmtConformanceNetworkPolicyEnabled), |
slalov | 0a4947a | 2022-06-09 15:44:35 +0400 | [diff] [blame] | 1098 | booleanParam(name: 'RUN_MAINTENANCE_TEST', value: triggers.runMaintenanceTestEnabled), |
| 1099 | booleanParam(name: 'RUN_CONTAINER_REGISTRY_TEST', value: triggers.runContainerregistryTestEnabled), |
Mikhail Nikolaenko | 7e632cd | 2022-10-24 16:20:31 +0300 | [diff] [blame] | 1100 | booleanParam(name: 'RUN_GRACEFUL_REBOOT_TEST', value: triggers.runGracefulRebootTestEnabled), |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 1101 | booleanParam(name: 'RUN_MGMT_DELETE_MASTER_TEST', value: triggers.runMgmtDeleteMasterTestEnabled), |
| 1102 | booleanParam(name: 'RUN_RGNL_DELETE_MASTER_TEST', value: triggers.runRgnlDeleteMasterTestEnabled), |
| 1103 | booleanParam(name: 'RUN_CHILD_DELETE_MASTER_TEST', value: triggers.runChildDeleteMasterTestEnabled), |
Sergey Lalov | d5efcd5 | 2023-03-01 22:42:17 +0400 | [diff] [blame] | 1104 | booleanParam(name: 'RUN_CHILD_CUSTOM_CERT_TEST', value: triggers.runChildCustomCertTestEnabled), |
Sergey Lalov | f6fbfea | 2023-04-06 17:05:40 +0400 | [diff] [blame] | 1105 | booleanParam(name: 'RUN_MGMT_CUSTOM_CACHE_CERT_TEST', value: triggers.runMgmtCustomCacheCertTestEnabled), |
Sergey Lalov | 48e6902 | 2023-07-25 16:08:00 +0400 | [diff] [blame] | 1106 | booleanParam(name: 'RUN_MKE_CUSTOM_CERT_TEST', value: triggers.runMkeCustomCertTestEnabled), |
Sergey Lalov | 62c2831 | 2023-10-18 19:23:59 +0400 | [diff] [blame] | 1107 | booleanParam(name: 'RUN_CUSTOM_HOSTNAMES', value: triggers.runCustomHostnamesEnabled), |
vryzhenkin | 504dfc9 | 2023-11-01 15:49:47 +0400 | [diff] [blame] | 1108 | booleanParam(name: 'SL_LATEST', value: triggers.slLatestEnabled), |
Sergey Lalov | 430fcd7 | 2023-03-20 17:19:44 +0400 | [diff] [blame] | 1109 | booleanParam(name: 'RUN_BYO_CHILD_CUSTOM_CERT_TEST', value: triggers.runByoChildCustomCertTestEnabled), |
Dmitriy Kasyanov | 43cb06e | 2022-08-17 14:35:39 +0300 | [diff] [blame] | 1110 | booleanParam(name: 'RUN_CHILD_MACHINE_DELETION_POLICY_TEST', value: triggers.runChildMachineDeletionPolicyTestEnabled), |
Владислав Наумов | 9cec55d | 2021-08-03 15:00:59 +0200 | [diff] [blame] | 1111 | booleanParam(name: 'RUN_LMA_TEST', value: triggers.runLMATestEnabled), |
Vladyslav Drok | c4f9c1b | 2021-07-22 15:34:24 +0200 | [diff] [blame] | 1112 | booleanParam(name: 'RUN_MGMT_USER_CONTROLLER_TEST', value: triggers.runMgmtUserControllerTestEnabled), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 1113 | booleanParam(name: 'DEPLOY_CHILD_CLUSTER', value: triggers.deployChildEnabled), |
| 1114 | booleanParam(name: 'UPGRADE_CHILD_CLUSTER', value: triggers.upgradeChildEnabled), |
Sergey Lalov | c1cb49f | 2022-09-27 01:16:25 +0400 | [diff] [blame] | 1115 | booleanParam(name: 'FULL_UPGRADE_CHILD_CLUSTER', value: triggers.fullUpgradeChildEnabled), |
slalov | 574123e | 2022-04-06 17:24:19 +0400 | [diff] [blame] | 1116 | booleanParam(name: 'RUN_PROXY_CHILD_TEST', value: triggers.runProxyChildTestEnabled), |
Владислав Наумов | 0dc9925 | 2020-11-13 13:30:48 +0100 | [diff] [blame] | 1117 | booleanParam(name: 'ATTACH_BYO', value: triggers.attachBYOEnabled), |
Владислав Наумов | cdbd84e | 2020-12-01 16:51:09 +0100 | [diff] [blame] | 1118 | booleanParam(name: 'UPGRADE_BYO', value: triggers.upgradeBYOEnabled), |
Vladislav Naumov | 7930ab2 | 2021-11-22 18:24:24 +0100 | [diff] [blame] | 1119 | booleanParam(name: 'RUN_BYO_MATRIX', value: triggers.runBYOMatrixEnabled), |
Владислав Наумов | 080d941 | 2020-07-29 13:05:14 +0200 | [diff] [blame] | 1120 | booleanParam(name: 'RUN_CHILD_CFM', value: triggers.runChildConformanceEnabled), |
Sergey Lalov | afcc043 | 2023-04-13 14:59:06 +0400 | [diff] [blame] | 1121 | booleanParam(name: 'RUN_CHILD_CFM_NETPOLICY', value: triggers.runChildConformanceNetworkPolicyEnabled), |
vryzhenkin | b286bd8 | 2023-04-04 07:17:52 +0400 | [diff] [blame] | 1122 | booleanParam(name: 'RUN_CHILD_HPA', value: triggers.runChildHPAEnabled), |
Sergey Lalov | 012496a | 2023-11-27 15:57:52 +0400 | [diff] [blame] | 1123 | booleanParam(name: 'RUN_STACKLIGHT_CHILD_HA', value: triggers.runChildStacklightHaEnabled), |
Ivan Berezovskiy | cbf9eeb | 2021-03-22 15:57:32 +0400 | [diff] [blame] | 1124 | booleanParam(name: 'ALLOW_AWS_ON_DEMAND', value: triggers.awsOnDemandDemoEnabled), |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1125 | booleanParam(name: 'ALLOW_EQUINIX_ON_DEMAND', value: triggers.equinixOnDemandDemoEnabled), |
Владислав Наумов | 82305e9 | 2021-10-14 20:45:20 +0200 | [diff] [blame] | 1126 | booleanParam(name: 'ALLOW_EQUINIXMETALV2_ON_DEMAND', value: triggers.equinixMetalV2OnDemandDemoEnabled), |
Vladislav Naumov | 42b71dc | 2021-11-22 13:09:42 +0100 | [diff] [blame] | 1127 | booleanParam(name: 'EQUINIXMETALV2_CHILD_DIFF_METRO', value: triggers.equinixMetalV2ChildDiffMetroEnabled), |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1128 | booleanParam(name: 'EQUINIX_ON_AWS_DEMO', value: triggers.equinixOnAwsDemoEnabled), |
| 1129 | booleanParam(name: 'ALLOW_AZURE_ON_DEMAND', value: triggers.azureOnDemandDemoEnabled), |
| 1130 | booleanParam(name: 'AZURE_ON_AWS_DEMO', value: triggers.azureOnAwsDemoEnabled), |
Sergey Lalov | c63259f | 2024-01-28 16:52:30 +0400 | [diff] [blame] | 1131 | booleanParam(name: 'ALLOW_BM_CORE_ON_DEMAND', value: triggers.bmCoreDemoEnabled), |
Sergey Zhemerdeev | 9074f6e | 2022-06-07 12:03:16 +0300 | [diff] [blame] | 1132 | booleanParam(name: 'VSPHERE_DEPLOY_UBUNTU', value: triggers.vsphereUbuntuEnabled), |
Sergey Lalov | bc68d75 | 2022-11-08 13:40:53 +0400 | [diff] [blame] | 1133 | booleanParam(name: 'PAUSE_FOR_DEBUG', value: triggers.pauseForDebugEnabled), |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 1134 | booleanParam(name: 'ENABLE_FIPS', value: triggers.enableFips), |
Sergey Lalov | 00bea0f | 2023-08-14 16:46:33 +0400 | [diff] [blame] | 1135 | booleanParam(name: 'ENABLE_MKE_DUBUG', value: triggers.enableMkeDebugEnabled), |
Mikhail Nikolaenko | c36dea9 | 2022-12-12 02:40:40 +0300 | [diff] [blame] | 1136 | booleanParam(name: 'AIO_CLUSTER', value: triggers.aioCluster), |
Sergey Lalov | d0e2085 | 2023-08-17 19:11:19 +0400 | [diff] [blame] | 1137 | booleanParam(name: 'BM_CORE_CLEANUP', value: triggers.bmCoreCleanup), |
Sergey Lalov | d7593ab | 2024-01-11 13:40:13 +0400 | [diff] [blame] | 1138 | booleanParam(name: 'DISABLE_KUBE_API_AUDIT', value: triggers.disableKubeApiAudit), |
Sergey Lalov | f44cbb7 | 2024-03-27 15:19:24 +0400 | [diff] [blame] | 1139 | booleanParam(name: "AUDITD_ENABLE", value: triggers.auditdEnabled), |
vryzhenkin | e0ff1d8 | 2024-03-18 15:08:09 +0400 | [diff] [blame] | 1140 | booleanParam(name: 'CORE_KEYCLOAK_LDAP_ENABLED', value: triggers.coreKeycloakLdapEnabled), |
Viktor Astakhov | adfcfb5 | 2024-05-16 16:56:21 +0400 | [diff] [blame] | 1141 | booleanParam(name: 'CORE_KAAS_NTP_ENABLED', value: triggers.internalNTPServersEnabled), |
Viktor Astakhov | 8da448c | 2024-06-14 14:59:32 +0400 | [diff] [blame] | 1142 | booleanParam(name: 'RUN_NTP_UPDATE_TEST', value: triggers.runNTPUpdateTestEnabled), |
Viktor Astakhov | 4fda267 | 2024-08-29 16:38:25 +0400 | [diff] [blame] | 1143 | booleanParam(name: 'RUN_MCC_MARIA_BACKUP_RESTORE_TEST', value: triggers.runMCCMariaBackupRestoreTestEnabled), |
| 1144 | booleanParam(name: 'RUN_MGMT_RUNTIME_MIGRATE_EXTENDED_TEST', value: triggers.runtimeMigrateExtendedMgmtEnabled), |
| 1145 | booleanParam(name: 'RUN_MGMT_RUNTIME_MIGRATE_QUICK_TEST', value: triggers.runtimeMigrateQuickMgmtEnabled), |
| 1146 | booleanParam(name: 'RUN_MGMT_RUNTIME_MIGRATE_AND_ROLLBACK_TEST', value: triggers.runtimeMigrateMgmtAndRollbackEnabled), |
| 1147 | booleanParam(name: 'RUN_CHILD_RUNTIME_MIGRATE_EXTENDED_TEST', value: triggers.runtimeMigrateExtendedChildEnabled), |
| 1148 | booleanParam(name: 'RUN_CHILD_RUNTIME_MIGRATE_QUICK_TEST', value: triggers.runtimeMigrateQuickChildEnabled), |
| 1149 | booleanParam(name: 'RUN_CHILD_RUNTIME_MIGRATE_AND_ROLLBACK_TEST', value: triggers.runtimeMigrateChildAndRollbackEnabled), |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1150 | ] |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1151 | |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1152 | // customize multiregional demo |
| 1153 | if (triggers.multiregionalConfiguration.enabled) { |
| 1154 | parameters.add(string(name: 'MULTIREGION_SETUP', |
| 1155 | value: "${triggers.multiregionalConfiguration.managementLocation},${triggers.multiregionalConfiguration.regionLocation}" |
| 1156 | )) |
| 1157 | } |
| 1158 | |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1159 | // Determine component team custom context |
| 1160 | if (coreContext != '') { |
| 1161 | common.infoMsg('Additional KaaS Core context detected, will be forwarded into kaas core cicd...') |
| 1162 | def additionalParameters = generateKaaSVarsFromContext(coreContext) |
Владислав Наумов | bef51a9 | 2020-10-01 17:36:51 +0200 | [diff] [blame] | 1163 | parameters.addAll(additionalParameters) |
Владислав Наумов | 92288d9 | 2020-07-13 18:36:21 +0200 | [diff] [blame] | 1164 | } |
| 1165 | |
Владислав Наумов | aa43061 | 2020-06-08 17:18:31 +0200 | [diff] [blame] | 1166 | def jobResults = [] |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1167 | |
| 1168 | platforms.each { platform -> |
| 1169 | jobs["kaas-core-${platform}-patched-${component}"] = { |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1170 | try { |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1171 | common.infoMsg("Deploy: patched KaaS demo with ${platform} provider") |
| 1172 | def job_info = build job: "kaas-testing-core-${platform}-workflow-${component}", parameters: parameters, wait: true |
| 1173 | def build_description = job_info.getDescription() |
| 1174 | def build_result = job_info.getResult() |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1175 | jobResults.add(build_result) |
Владислав Наумов | d044e84 | 2020-06-17 15:33:43 +0200 | [diff] [blame] | 1176 | |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1177 | if (build_description) { |
| 1178 | currentBuild.description += build_description |
| 1179 | } |
| 1180 | } finally { |
Ivan Berezovskiy | 91ede50 | 2021-05-13 21:05:36 +0400 | [diff] [blame] | 1181 | common.infoMsg("Patched KaaS demo with ${platform} provider finished") |
Vladislav Naumov | 5313a20 | 2021-04-07 17:13:39 +0000 | [diff] [blame] | 1182 | } |
| 1183 | } |
| 1184 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1185 | |
| 1186 | common.infoMsg('Trigger KaaS demo deployments according to defined provider set') |
Владислав Наумов | 37f7f84 | 2021-03-09 16:08:39 +0400 | [diff] [blame] | 1187 | if (jobs.size() == 0) { |
| 1188 | error('No demo jobs matched with keywords, execution will be aborted, at least 1 provider should be enabled') |
| 1189 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1190 | // Limit build concurency workaround examples: https://issues.jenkins-ci.org/browse/JENKINS-44085 |
| 1191 | parallel jobs |
Владислав Наумов | aa43061 | 2020-06-08 17:18:31 +0200 | [diff] [blame] | 1192 | |
| 1193 | if (jobResults.contains('FAILURE')) { |
Владислав Наумов | f86b111 | 2020-06-09 14:04:48 +0200 | [diff] [blame] | 1194 | common.infoMsg('One of parallel downstream jobs is failed, mark executor job as failed') |
Владислав Наумов | aa43061 | 2020-06-08 17:18:31 +0200 | [diff] [blame] | 1195 | currentBuild.result = 'FAILURE' |
| 1196 | } |
Владислав Наумов | 2a982ff | 2020-06-02 19:06:46 +0200 | [diff] [blame] | 1197 | } |
Владислав Наумов | 30a516c | 2020-07-09 13:15:41 +0200 | [diff] [blame] | 1198 | |
| 1199 | |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1200 | /** |
| 1201 | * Function currently supported to be called from aws or vsphere demos. It gets particular demo context |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1202 | * and generate proper lockResources data and netMap data for vsphere,equinix related clusters. |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1203 | * |
| 1204 | * @param: callBackDemo (string) Demo which requested to generate lockResources [aws or vsphere] |
| 1205 | * @param: triggers (map) Custom trigger keywords forwarded from gerrit |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1206 | * @param: multiregionalConfiguration (map) Multiregional configuration |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1207 | * @return (map) Return aggregated map with lockResources and netMap |
| 1208 | */ |
| 1209 | |
| 1210 | |
| 1211 | def generateLockResources(callBackDemo, triggers) { |
| 1212 | def common = new com.mirantis.mk.Common() |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1213 | def netMap = [ |
| 1214 | vsphere: [:], |
| 1215 | equinix: [:], |
| 1216 | ] |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1217 | // Define vsphere locklabels with initial quantity |
| 1218 | def lockLabels = [ |
| 1219 | vsphere_networking_core_ci: 0, |
| 1220 | vsphere_offline_networking_core_ci: 0, |
| 1221 | ] |
| 1222 | def deployChild = triggers.deployChildEnabled |
Sergey Lalov | 13eea42 | 2023-08-21 23:10:17 +0400 | [diff] [blame] | 1223 | def testUiVsphere = triggers.runUie2eEnabled || triggers.runUie2eNewEnabled |
Sergey Lalov | 900aff4 | 2024-03-08 00:05:50 +0400 | [diff] [blame] | 1224 | def vsphereByo = triggers.attachBYOEnabled |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1225 | def multiregionConfig = triggers.multiregionalConfiguration |
| 1226 | def runMultiregion = multiregionConfig.enabled |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1227 | |
| 1228 | // Generate vsphere netMap and lockLabels based on demo context |
| 1229 | switch (callBackDemo) { |
| 1230 | case 'aws': |
| 1231 | // Add aws specific lock label with quantity calculated based on single mgmt deploy or mgmt + child |
| 1232 | lockLabels['aws_core_ci_queue'] = triggers.demoWeight |
Sergey Kolekonov | f4c1f49 | 2022-02-03 14:44:45 +0400 | [diff] [blame] | 1233 | if (triggers.runBYOMatrixEnabled) { lockLabels['aws_core_ci_queue'] += 6 } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1234 | |
| 1235 | // Define netMap for Vsphere region |
| 1236 | if (runMultiregion && multiregionConfig.managementLocation == 'aws') { |
| 1237 | if (multiregionConfig.regionLocation == 'vsphere') { |
| 1238 | if (deployChild) { |
| 1239 | addToProviderNetMap(netMap, 'vsphere', 'regional-child') |
| 1240 | } |
| 1241 | addToProviderNetMap(netMap, 'vsphere', 'region') |
| 1242 | } |
| 1243 | |
| 1244 | if (multiregionConfig.regionLocation == 'azure') { |
| 1245 | lockLabels['azure_core_ci_queue'] = 1 |
| 1246 | if (deployChild) { |
| 1247 | lockLabels['azure_core_ci_queue'] += 1 |
| 1248 | } |
| 1249 | } |
| 1250 | } |
| 1251 | if (triggers.azureOnAwsDemoEnabled) { |
| 1252 | lockLabels['azure_core_ci_queue'] = 1 |
| 1253 | } |
| 1254 | |
| 1255 | if (triggers.equinixOnAwsDemoEnabled) { |
| 1256 | lockLabels['equinix_core_ci_queue'] = 1 |
| 1257 | } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1258 | break |
| 1259 | case 'vsphere': |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1260 | addToProviderNetMap(netMap, 'vsphere', 'mgmt') |
Sergey Lalov | 900aff4 | 2024-03-08 00:05:50 +0400 | [diff] [blame] | 1261 | if (deployChild || testUiVsphere || vsphereByo) { |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1262 | addToProviderNetMap(netMap, 'vsphere', 'child') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1263 | } |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1264 | if (runMultiregion && multiregionConfig.managementLocation == 'vsphere' && |
| 1265 | multiregionConfig.regionLocation == 'vsphere') { |
| 1266 | if (deployChild) { |
| 1267 | addToProviderNetMap(netMap, 'vsphere', 'regional-child') |
| 1268 | } |
| 1269 | addToProviderNetMap(netMap, 'vsphere', 'region') |
| 1270 | } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1271 | break |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1272 | case 'azure': |
| 1273 | lockLabels['azure_core_ci_queue'] = triggers.demoWeight |
| 1274 | if (runMultiregion && multiregionConfig.managementLocation == 'azure') { |
| 1275 | if (multiregionConfig.regionLocation == 'aws') { |
| 1276 | lockLabels['aws_core_ci_queue'] = 1 |
| 1277 | if (deployChild) { |
| 1278 | lockLabels['aws_core_ci_queue'] += 1 |
| 1279 | } |
| 1280 | } |
| 1281 | |
| 1282 | if (multiregionConfig.regionLocation == 'equinix') { |
| 1283 | lockLabels['equinix_core_ci_queue'] = 1 |
| 1284 | if (deployChild) { |
| 1285 | lockLabels['equinix_core_ci_queue'] +=1 |
| 1286 | } |
| 1287 | } |
| 1288 | } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1289 | default: |
Sergey Kolekonov | d6a1739 | 2024-02-06 15:57:53 +0000 | [diff] [blame] | 1290 | error('Supposed to be called from aws, azure or vsphere demos only') |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1291 | } |
| 1292 | |
| 1293 | // Checking gerrit triggers and manage lock label quantity and network types in case of Offline deployment |
| 1294 | // Vsphere labels only |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1295 | netMap['vsphere'].each { clusterType, netConfig -> |
| 1296 | if (triggers.proxyConfig["${clusterType}Offline"] == true || |
| 1297 | (clusterType == 'regional-child' && triggers.proxyConfig['childOffline'] == true) || |
| 1298 | (clusterType == 'region' && triggers.proxyConfig['mgmtOffline'])) { |
| 1299 | |
| 1300 | netMap['vsphere'][clusterType]['netName'] = 'offline' |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1301 | lockLabels['vsphere_offline_networking_core_ci']++ |
| 1302 | } else { |
| 1303 | lockLabels['vsphere_networking_core_ci']++ |
| 1304 | } |
| 1305 | } |
| 1306 | |
| 1307 | // generate lock metadata |
| 1308 | def lockResources = [] |
| 1309 | lockLabels.each { label, quantity -> |
| 1310 | if (quantity > 0) { |
| 1311 | def res = [ |
| 1312 | label: label, |
| 1313 | quantity: quantity, |
| 1314 | ] |
| 1315 | lockResources.add(res) |
| 1316 | } |
| 1317 | } |
| 1318 | |
| 1319 | common.infoMsg("""Generated vsphere netMap: ${netMap} |
| 1320 | Generated lockResources: ${lockResources}""") |
| 1321 | |
| 1322 | return [ |
| 1323 | netMap: netMap, |
| 1324 | lockResources: lockResources, |
| 1325 | ] |
| 1326 | } |
| 1327 | |
| 1328 | /** |
| 1329 | * Function gets vsphere netMap or empty map and adds new vsphere clusterType with default netName |
| 1330 | * and empty rangeConfig to the this map. |
| 1331 | * |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1332 | * @param: netMap (string) vsphere, equinix netMap or empty map |
| 1333 | * @param: provider (string) provider type |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1334 | * @param: clusterType (string) Vsphere cluster type |
| 1335 | */ |
| 1336 | |
Владислав Наумов | 33e1e81 | 2021-08-17 17:09:25 +0200 | [diff] [blame] | 1337 | def addToProviderNetMap (netMap, provider, clusterType) { |
| 1338 | switch (provider) { |
| 1339 | case 'equinix': |
| 1340 | netMap[provider][clusterType] = [ |
| 1341 | vlanConfig: '', |
| 1342 | ] |
| 1343 | break |
| 1344 | case 'vsphere': |
| 1345 | netMap[provider][clusterType] = [ |
| 1346 | netName: 'default', |
| 1347 | rangeConfig: '', |
| 1348 | ] |
| 1349 | break |
| 1350 | default: |
| 1351 | error('Net map locks supported for Equinix/Vsphere providers only') |
| 1352 | } |
Stanislav Riazanov | 78fa7df | 2021-05-28 20:28:59 +0400 | [diff] [blame] | 1353 | } |
Dmitry Teselkin | fce71aa | 2022-03-05 19:36:52 +0300 | [diff] [blame] | 1354 | |
| 1355 | /** |
| 1356 | * getCIKeywordsFromCommitMsg parses commit message and returns all gerrit keywords with their values as a list of maps. |
| 1357 | * Each element (map) contains keys 'key' for keyword name and 'value' for its value. |
| 1358 | * If keyword contains only 'key' part then 'value' is boolean True. |
| 1359 | * This function does not perform keywords validation. |
| 1360 | * First line of a commit message is ignored. |
| 1361 | * To use '[' or ']' characters inside keyword prepend it with backslash '\'. |
| 1362 | * TODO: Remove backslash chars from values if they prepend '[' or ']'. |
| 1363 | **/ |
| 1364 | |
| 1365 | List getCIKeywordsFromCommitMsg() { |
| 1366 | String commitMsg = env.GERRIT_CHANGE_COMMIT_MESSAGE ? new String(env.GERRIT_CHANGE_COMMIT_MESSAGE.decodeBase64()) : '' |
| 1367 | List commitMsgLines = commitMsg.split('\n') |
| 1368 | List keywords = [] |
| 1369 | if (commitMsgLines.size() < 2) { |
| 1370 | return keywords |
| 1371 | } |
| 1372 | |
| 1373 | String commitMsgBody = commitMsgLines[1..-1].join('\n') |
| 1374 | |
| 1375 | // Split commit message body to chunks using '[' or ']' as delimiter, |
| 1376 | // ignoring them if prepended by backslash (regex negative lookbehind). |
| 1377 | // Resulting list will have chunks between '[' and ']' at odd indexes. |
| 1378 | List parts = commitMsgBody.split(/(?<!\\)[\[\]]/) |
| 1379 | |
| 1380 | // Iterate chunks by odd indexes only, trim values and split to |
| 1381 | // <key> / <value> pair where <key> is the part of a sting before the first |
| 1382 | // whitespace delimiter, and <value> is the rest (may include whitespaces). |
| 1383 | // If there is no whitespace in the string then this is a 'switch' |
| 1384 | // and <value> will be boolean True. |
| 1385 | for (i = 1; i < parts.size(); i += 2) { |
| 1386 | def (key, value) = (parts[i].trim().split(/\s+/, 2) + [true, ])[0..1] |
| 1387 | keywords.add(['key': key, 'value': value]) |
| 1388 | } |
| 1389 | |
| 1390 | return keywords |
| 1391 | } |
| 1392 | |
| 1393 | /** |
| 1394 | * getJobsParamsFromCommitMsg parses list of CI keywords and returns values of 'job-params' keyword |
| 1395 | * that were specified for given job name. `job-params` keyword has the following structure |
| 1396 | * |
| 1397 | * [job-params <job name> <parameter name> <parameter value>] |
| 1398 | * |
| 1399 | * Return value is a Map that contains those parameters using the following structure: |
| 1400 | * |
| 1401 | * <job name>: |
| 1402 | * <parameter name>: <parameter value> |
| 1403 | * |
| 1404 | **/ |
| 1405 | Map getJobsParamsFromCommitMsg() { |
| 1406 | List keywords = getCIKeywordsFromCommitMsg() |
| 1407 | |
| 1408 | List jobsParamsList = [] |
| 1409 | keywords.findAll{ it.key == 'job-params' }.collect(jobsParamsList) { |
| 1410 | def (name, params) = (it['value'].split(/\s+/, 2) + [null, ])[0..1] |
| 1411 | def (key, value) = params.split(/\s+/, 2) |
| 1412 | ['name': name, 'key': key, 'value': value] |
| 1413 | } |
| 1414 | |
| 1415 | Map jobsParams = jobsParamsList.inject([:]) { result, it -> |
| 1416 | if (!result.containsKey(it.name)) { |
| 1417 | result[it.name] = [:] |
| 1418 | } |
| 1419 | result[it.name][it.key] = it.value |
| 1420 | result |
| 1421 | } |
| 1422 | |
| 1423 | return jobsParams |
| 1424 | } |
| 1425 | |
| 1426 | |
| 1427 | /** |
| 1428 | * getJobParamsFromCommitMsg returns key:value Map of parameters set for a job in commit message. |
| 1429 | * It uses getJobsParamsFromCommitMsg to get all parameters from commit message and then |
| 1430 | * uses only those parametes that were set to all jobs (with <job name> == '*') or to |
| 1431 | * a particular job. Parameters set to a particular job have higher precedence. |
| 1432 | * |
| 1433 | * Return value is a Map that contains those parameters: |
| 1434 | * |
| 1435 | * <parameter name>: <parameter value> |
| 1436 | * |
| 1437 | **/ |
| 1438 | Map getJobParamsFromCommitMsg(String jobName) { |
| 1439 | jobsParams = getJobsParamsFromCommitMsg() |
| 1440 | jobParams = jobsParams.getOrDefault('*', [:]) |
| 1441 | if (jobName) { |
| 1442 | jobParams.putAll(jobsParams.getOrDefault(jobName, [:])) |
| 1443 | } |
| 1444 | return jobParams |
| 1445 | } |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 1446 | |
| 1447 | /** Getting test scheme from text, which should be |
| 1448 | Imput example: |
| 1449 | text=""" |
| 1450 | DATA |
| 1451 | |
| 1452 | kaas_bm_test_schemas: |
| 1453 | KAAS_RELEASES_REFSPEC: '' |
| 1454 | KEY: VAL |
| 1455 | |
| 1456 | DATA |
| 1457 | """ |
| 1458 | |
| 1459 | Call: parseTextForTestSchemas(['text' : text,'keyLine' : 'kaas_bm_test_schemas']) |
| 1460 | |
| 1461 | Return: |
| 1462 | ['KAAS_RELEASES_REFSPEC': '', 'KEY' : 'VAL'] |
| 1463 | **/ |
| 1464 | def parseTextForTestSchemas(Map opts) { |
azvyagintsev | d96aac2 | 2022-06-10 14:23:26 +0300 | [diff] [blame] | 1465 | String text = opts.getOrDefault('text', '') |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 1466 | String keyLine = opts.getOrDefault('keyLine', '') |
| 1467 | Map testScheme = [:] |
| 1468 | if (!text || !keyLine) { |
azvyagintsev | d96aac2 | 2022-06-10 14:23:26 +0300 | [diff] [blame] | 1469 | return testScheme |
azvyagintsev | c17d14b | 2022-06-06 19:06:33 +0300 | [diff] [blame] | 1470 | } |
| 1471 | if (text =~ /\n$keyLine\n.*/) { |
| 1472 | def common = new com.mirantis.mk.Common() |
| 1473 | try { |
| 1474 | String regExp = '\\n' + keyLine + '\\n' |
| 1475 | // regexep block must be followed by empty line |
| 1476 | testScheme = readYaml text: "${text.split(regExp)[1].split('\n\n')[0]}" |
| 1477 | common.infoMsg("parseTextForTestSchemas result:\n" + testScheme) |
| 1478 | common.mergeEnv(env, toJson(testScheme)) |
| 1479 | } |
| 1480 | catch (Exception e) { |
| 1481 | common.errorMsg("There is an error occured during parseTextForTestSchemas execution:\n${e}") |
| 1482 | throw e |
| 1483 | } |
| 1484 | } |
azvyagintsev | d96aac2 | 2022-06-10 14:23:26 +0300 | [diff] [blame] | 1485 | return testScheme |
Dmitriy Kasyanov | 5f910e6 | 2022-02-11 14:57:05 +0300 | [diff] [blame] | 1486 | } |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1487 | |
| 1488 | |
| 1489 | /** |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1490 | * getEquinixMetroWithCapacity returns list of Equinix metros using specified |
| 1491 | * instance type (nodeType), desired count of metros (metroCount) and |
| 1492 | * instances (nodeCount) in a metro using specified matal version. |
| 1493 | * Function downloads metal CLI from the |
| 1494 | * https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux |
| 1495 | * Empty list is returned in case of no metros with specified capacity was found or any other errors. |
| 1496 | * Non-empty list is shuffled. |
| 1497 | * |
| 1498 | * @param: metroCount (int) Desired count of metros |
| 1499 | * @param: nodeCount (int) Desired count of instances |
| 1500 | * @param: nodeType (string) Instance type |
| 1501 | * @param: version (string) Metal version to use |
| 1502 | * @return ([]string) List of selected metros |
| 1503 | * |
| 1504 | **/ |
| 1505 | def getEquinixMetroWithCapacity(metroCount = 1, nodeCount = 50, nodeType = 'c3.small.x86', version = '0.9.0') { |
| 1506 | def common = new com.mirantis.mk.Common() |
| 1507 | def metalUrl = "https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux" |
| 1508 | def metal = './metal --config metal.yaml' |
| 1509 | def metro = [] |
| 1510 | def out = '' |
| 1511 | def retries = 3 // number of retries |
| 1512 | def i = 0 |
| 1513 | def delay = 60 // 1 minute sleep |
| 1514 | def excludeMetro = [] // list of metros to exclude from selection |
| 1515 | try { |
| 1516 | if (excludeMetro.size() > 0) { |
| 1517 | common.infoMsg("Excluded metros: ${excludeMetros}") |
| 1518 | } |
| 1519 | sh "curl -o metal -# ${metalUrl} && chmod +x metal" |
| 1520 | withCredentials([string(credentialsId: env.KAAS_EQUINIX_API_TOKEN, variable: 'KAAS_EQUINIX_API_TOKEN')]) { |
| 1521 | sh 'echo "project-id: ${KAAS_EQUINIX_PROJECT_ID}\ntoken: ${KAAS_EQUINIX_API_TOKEN}" >metal.yaml' |
| 1522 | } |
| 1523 | while (metro.size() < metroCount && i < retries) { |
| 1524 | common.infoMsg("Selecting ${metroCount} available Equinix metros with free ${nodeCount} ${nodeType} hosts, try ${i+1}/${retries} ...") |
| 1525 | if (i > 0) { // skip sleep on first step |
| 1526 | sleep(delay) |
| 1527 | } |
| 1528 | out = sh(script: "${metal} capacity get -m -P ${nodeType}|awk '/${nodeType}/ {print \$2}'|paste -s -d,|xargs ${metal} capacity check -P ${nodeType} -q ${nodeCount} -m|grep true|awk '{print \$2}'|paste -s -d,", returnStdout: true).trim() |
| 1529 | metro = out.tokenize(',') |
| 1530 | metro -= excludeMetro |
| 1531 | if (metro.size() < metroCount) { |
| 1532 | nodeCount -= 10 |
| 1533 | // We need different metros for the [equinixmetalv2-child-diff-metro] case |
| 1534 | } else if (metro.size() == 2 && metro[0][0, 1] == metro[1][0, 1]) { |
| 1535 | nodeCount -= 10 |
| 1536 | } |
| 1537 | i++ |
| 1538 | } |
| 1539 | if (metro.size() > 0) { |
eromanova | efbbb42 | 2023-11-24 13:54:35 +0400 | [diff] [blame] | 1540 | m = metro.size() > 1 ? "${metro[0]},${metro[1]}" : "${metro[0]}" |
| 1541 | sh "${metal} capacity check -P ${nodeType} -m ${m} -q ${nodeCount}" |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1542 | } |
| 1543 | } catch (Exception e) { |
| 1544 | common.errorMsg "Exception: '${e}'" |
| 1545 | return [] |
| 1546 | } finally { |
| 1547 | sh 'rm metal.yaml' |
| 1548 | } |
| 1549 | if (metro.size() > 0) { |
| 1550 | Collections.shuffle(metro) |
| 1551 | common.infoMsg("Selected metros: ${metro}") |
| 1552 | } else { |
| 1553 | common.warningMsg('No any metros have been selected !!! :(') |
| 1554 | } |
| 1555 | return metro |
| 1556 | } |
| 1557 | |
| 1558 | |
| 1559 | /** |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1560 | * getEquinixFacilityWithCapacity returns list of Equinix facilities using specified |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1561 | * instance type (nodeType), desired count of facilities (facilityCount) and |
| 1562 | * instances (nodeCount) in a facility using specified matal version. |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1563 | * Function downloads metal CLI from the |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1564 | * https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux |
| 1565 | * Empty list is returned in case of no facilities with specified capacity was found or any other errors. |
Sergey Zhemerdeev | 15aa860 | 2022-10-13 11:10:02 +0300 | [diff] [blame] | 1566 | * Non-empty list is shuffled. |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1567 | * |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1568 | * @param: facilityCount (int) Desired count of facilities |
| 1569 | * @param: nodeCount (int) Desired count of instances |
| 1570 | * @param: nodeType (string) Instance type |
| 1571 | * @param: version (string) Metal version to use |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1572 | * @return ([]string) List of selected facilities |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1573 | * |
| 1574 | **/ |
eromanova | b24cb23 | 2023-11-17 12:17:06 +0400 | [diff] [blame] | 1575 | @Deprecated |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1576 | def getEquinixFacilityWithCapacity(facilityCount = 1, nodeCount = 50, nodeType = 'c3.small.x86', version = '0.9.0') { |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1577 | def common = new com.mirantis.mk.Common() |
Sergey Lalov | 314daae | 2023-11-27 12:21:20 +0400 | [diff] [blame] | 1578 | common.warningMsg('You are using deprecated method getEquinixFacilityWithCapacity. Use getEquinixMetroWithCapacity instead') |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1579 | def metalUrl = "https://artifactory.mcp.mirantis.net:443/artifactory/binary-dev-kaas-local/core/bin/mirror/metal-${version}-linux" |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1580 | def metal = './metal --config metal.yaml' |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1581 | def facility = [] |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1582 | def out = '' |
Sergey Zhemerdeev | bcccb91 | 2022-08-25 14:26:52 +0300 | [diff] [blame] | 1583 | def retries = 3 // number of retries |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1584 | def i = 0 |
| 1585 | def delay = 60 // 1 minute sleep |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1586 | def excludeFacility = [] // list of facilities to exclude from selection |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1587 | try { |
Sergey Zhemerdeev | b357534 | 2022-10-04 11:02:19 +0300 | [diff] [blame] | 1588 | if (excludeFacility.size() > 0) { |
| 1589 | common.infoMsg("Excluded facilities: ${excludeFacility}") |
| 1590 | } |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1591 | sh "curl -o metal -# ${metalUrl} && chmod +x metal" |
| 1592 | withCredentials([string(credentialsId: env.KAAS_EQUINIX_API_TOKEN, variable: 'KAAS_EQUINIX_API_TOKEN')]) { |
| 1593 | sh 'echo "project-id: ${KAAS_EQUINIX_PROJECT_ID}\ntoken: ${KAAS_EQUINIX_API_TOKEN}" >metal.yaml' |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1594 | } |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1595 | while (facility.size() < facilityCount && i < retries) { |
| 1596 | common.infoMsg("Selecting ${facilityCount} available Equinix facilities with free ${nodeCount} ${nodeType} hosts, try ${i+1}/${retries} ...") |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1597 | if (i > 0 ) { // skip sleep on first step |
| 1598 | sleep(delay) |
| 1599 | } |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1600 | out = sh(script: "${metal} capacity get -f -P ${nodeType}|awk '/${nodeType}/ {print \$2}'|paste -s -d,|xargs ${metal} capacity check -P ${nodeType} -q ${nodeCount} -f|grep true|awk '{print \$2}'|paste -s -d,", returnStdout: true).trim() |
| 1601 | facility = out.tokenize(',') |
Sergey Zhemerdeev | b357534 | 2022-10-04 11:02:19 +0300 | [diff] [blame] | 1602 | facility -= excludeFacility |
Sergey Zhemerdeev | 46080fa | 2022-10-06 12:34:12 +0300 | [diff] [blame] | 1603 | if (facility.size() < facilityCount) { |
| 1604 | nodeCount -= 10 |
| 1605 | // We need different metros for the [equinixmetalv2-child-diff-metro] case, facility[][0, 1] contains a metro name |
| 1606 | } else if (facility.size() == 2 && facility[0][0, 1] == facility[1][0, 1]) { |
Sergey Zhemerdeev | bcccb91 | 2022-08-25 14:26:52 +0300 | [diff] [blame] | 1607 | nodeCount -= 10 |
| 1608 | } |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1609 | i++ |
| 1610 | } |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1611 | if (facility.size() > 0) { |
| 1612 | f = facility.size() > 1 ? "${facility[0]},${facility[1]}" : "${facility[0]}" |
| 1613 | sh "${metal} capacity check -P ${nodeType} -f ${f} -q ${nodeCount}" |
Sergey Zhemerdeev | bcccb91 | 2022-08-25 14:26:52 +0300 | [diff] [blame] | 1614 | } |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1615 | } catch (Exception e) { |
| 1616 | common.errorMsg "Exception: '${e}'" |
| 1617 | return [] |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1618 | } finally { |
| 1619 | sh 'rm metal.yaml' |
| 1620 | } |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1621 | if (facility.size() > 0) { |
Sergey Zhemerdeev | 15aa860 | 2022-10-13 11:10:02 +0300 | [diff] [blame] | 1622 | Collections.shuffle(facility) |
Sergey Zhemerdeev | b68bf61 | 2022-09-12 13:12:32 +0300 | [diff] [blame] | 1623 | common.infoMsg("Selected facilities: ${facility}") |
Sergey Zhemerdeev | 495ba58 | 2022-08-16 16:31:43 +0300 | [diff] [blame] | 1624 | } else { |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1625 | common.warningMsg('No any facilities have been selected !!! :(') |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1626 | } |
Sergey Zhemerdeev | de949bf | 2022-09-14 15:44:33 +0300 | [diff] [blame] | 1627 | return facility |
Sergey Zhemerdeev | 3156908 | 2022-08-10 10:13:19 +0300 | [diff] [blame] | 1628 | } |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1629 | |
| 1630 | |
| 1631 | /** |
| 1632 | * genCommandLine prepares command line for artifactory-replication |
| 1633 | * command using legacy environment variables |
| 1634 | * |
| 1635 | * @return: (string) Prepared command line |
| 1636 | */ |
| 1637 | def genCommandLine() { |
| 1638 | def envToParam = [ |
| 1639 | 'DESTINATION_USER': '-dst-user', |
| 1640 | 'ARTIFACT_FILTER': '-artifact-filter', |
| 1641 | 'ARTIFACT_FILTER_PROD': '-artifact-filter-prod', |
| 1642 | 'ARTIFACT_TYPE': '-artifact-type', |
| 1643 | 'BINARY_CLEAN': '-bin-cleanup', |
| 1644 | 'BINARY_CLEAN_KEEP_DAYS': '-bin-clean-keep-days', |
| 1645 | 'BINARY_CLEAN_PREFIX': '-bin-clean-prefix', |
| 1646 | 'BUILD_URL': '-slack-build-url', |
| 1647 | 'CHECK_REPOS': '-check-repos', |
| 1648 | 'DESTINATION_REGISTRY': '-dst-repo', |
| 1649 | 'DESTINATION_REGISTRY_TYPE': '-dst-repo-type', |
Ihor Hryshchenko | 4f70386 | 2023-12-07 14:45:50 +0200 | [diff] [blame] | 1650 | 'SIGNED_IMAGES_PATH': '-signed-images-path', |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1651 | 'DOCKER_CLEAN': '-cleanup', |
Ihor Hryshchenko | aa50100 | 2024-03-11 16:39:56 +0200 | [diff] [blame] | 1652 | 'DOCKER_OLDER_THAN_DAYS': '-older-than-days', |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1653 | 'DOCKER_REPO_PREFIX': '-docker-repo-prefix', |
| 1654 | 'DOCKER_TAG': '-docker-tag', |
| 1655 | 'FORCE': '-force', |
| 1656 | 'HELM_CDN_DOMAIN': '-helm-cdn-domain', |
| 1657 | 'SLACK_CHANNEL': '-slack-channel', |
Ihor Hryshchenko | 742c901 | 2024-01-19 16:47:22 +0200 | [diff] [blame] | 1658 | 'SLACK_CHANNELS': '-slack-channels', |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1659 | 'SLACK_USER': '-slack-user', |
| 1660 | 'SOURCE_REGISTRY': '-src-repo', |
| 1661 | 'SOURCE_REGISTRY_TYPE': '-src-repo-type', |
| 1662 | 'SYNC_PATTERN': '-sync-pattern' |
| 1663 | ] |
| 1664 | def cmdParams = '' |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1665 | def isCheckClean = false |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1666 | for (e in envToParam) { |
| 1667 | if (env[e.key] == null) { |
| 1668 | continue |
| 1669 | } |
| 1670 | if (e.key == 'CHECK_REPOS' || e.key == 'DOCKER_CLEAN') { |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1671 | // Avoid CHECK_REPOS=true and DOCKER_CLEAN=true |
| 1672 | if (env[e.key].toBoolean() && !isCheckClean) { |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1673 | cmdParams += e.value + ' ' |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1674 | isCheckClean = true |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1675 | } |
| 1676 | } else if (e.key == 'FORCE') { |
| 1677 | if (env[e.key].toBoolean()) { |
| 1678 | cmdParams += e.value + ' ' |
| 1679 | } |
| 1680 | } else { |
Sergey Zhemerdeev | e2926cd | 2022-08-29 15:28:47 +0300 | [diff] [blame] | 1681 | cmdParams += "${e.value} '${env[e.key]}' " |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1682 | } |
| 1683 | } |
Sergey Zhemerdeev | 88d1c3d | 2022-08-31 16:37:48 +0300 | [diff] [blame] | 1684 | // No any check or clean was specified - take a default action |
| 1685 | if (!isCheckClean) { |
| 1686 | cmdParams += '-replicate' |
| 1687 | } |
Sergey Zhemerdeev | 2a27334 | 2022-08-18 12:06:11 +0300 | [diff] [blame] | 1688 | return cmdParams |
| 1689 | } |
Sergey Kolekonov | 0e60a94 | 2022-09-05 13:02:22 +0400 | [diff] [blame] | 1690 | |
| 1691 | /** |
| 1692 | * custom scheduling algorithm |
| 1693 | * it ensures that builds of the same job are distributed as much as possible between different nodes |
| 1694 | * @param label (string) desired node label |
| 1695 | * @return: (string) node name |
| 1696 | */ |
| 1697 | def schedule (label='docker') { |
| 1698 | def common = new com.mirantis.mk.Common() |
| 1699 | def freeNodes = [] |
| 1700 | def nodesMap = [:] |
| 1701 | |
| 1702 | // filter nodes with the specified label and at least one free executor |
| 1703 | timeout(time: 30, unit: 'MINUTES') { |
| 1704 | while (!freeNodes) { |
| 1705 | freeNodes = jenkins.model.Jenkins.instance.computers.findAll { node -> |
| 1706 | label in node.getAssignedLabels().collect { it.name } && |
Sergey Kolekonov | d588717 | 2022-11-10 12:13:22 +0600 | [diff] [blame] | 1707 | node.isPartiallyIdle() && |
| 1708 | node.isOnline() |
Sergey Kolekonov | 0e60a94 | 2022-09-05 13:02:22 +0400 | [diff] [blame] | 1709 | } |
| 1710 | if (!freeNodes) { |
| 1711 | echo 'No nodes available for scheduling, retrying...' |
| 1712 | sleep 30 |
| 1713 | } |
| 1714 | } |
| 1715 | } |
| 1716 | |
| 1717 | // generate a map of nodes matching other criteria |
| 1718 | for (node in freeNodes) { |
| 1719 | // sameJobExecutors is the number of executors running the same job as the calling one |
| 1720 | sameJobExecutors = node.getExecutors() // get all executors |
| 1721 | .collect { executor -> executor.getCurrentExecutable() } // get running "threads" |
| 1722 | .collect { thread -> thread?.displayName } // filter job names from threads |
| 1723 | .minus(null) // null = empty executors, remove them from the list |
| 1724 | .findAll { it.contains(env.JOB_NAME) } // filter the same jobs as the calling one |
| 1725 | .size() |
| 1726 | |
| 1727 | // calculate busy executors, we don't want to count "sameJobExecutors" twice |
| 1728 | totalBusyExecutors = node.countBusy() - sameJobExecutors |
| 1729 | // generate the final map which contains nodes matching criteria with their load score |
| 1730 | // builds of the same jobs have x10 score, all others x1 |
| 1731 | nodesMap += ["${node.getName()}" : sameJobExecutors * 10 + totalBusyExecutors] |
| 1732 | } |
| 1733 | |
| 1734 | // return the least loaded node |
| 1735 | return common.SortMapByValueAsc(nodesMap).collect { it.key }[0] |
| 1736 | } |
Sergey Zhemerdeev | 78a6527 | 2023-03-23 18:05:22 +0200 | [diff] [blame] | 1737 | |
| 1738 | |
| 1739 | /** |
| 1740 | * Get latest tag for test/frontend & equinix-private-infra images |
| 1741 | * @param version (str) default tag value from main workflow |
| 1742 | * @param isChanged (bool) is dependent directory files were changed |
| 1743 | * @param imageName (string) image name for information message |
| 1744 | * @return: (string) tag name |
| 1745 | */ |
| 1746 | def getImageTag(version, isChanged, imageName) { |
| 1747 | def common = new com.mirantis.mk.Common() |
Sergey Zhemerdeev | 5fbf202 | 2023-04-28 14:51:36 +0300 | [diff] [blame] | 1748 | def latestTag = '' |
| 1749 | if (env.GERRIT_EVENT_TYPE && !(env.GERRIT_EVENT_TYPE in ['change-merged', 'ref-updated']) && isChanged) { |
Sergey Zhemerdeev | 78a6527 | 2023-03-23 18:05:22 +0200 | [diff] [blame] | 1750 | latestTag = version |
Sergey Zhemerdeev | ebdcad2 | 2023-04-25 16:58:28 +0300 | [diff] [blame] | 1751 | } else { |
| 1752 | if (env.GERRIT_EVENT_TYPE == 'ref-updated') { |
| 1753 | latestTag = env.GERRIT_REFNAME.replace('refs/tags/v', '').trim() |
| 1754 | } else { |
| 1755 | latestTag = env.GERRIT_BRANCH ? env.GERRIT_BRANCH : env.GERRIT_REFSPEC ? env.GERRIT_REFSPEC : 'master' |
| 1756 | if (latestTag != 'master') { |
| 1757 | latestTag = latestTag.replaceAll('/', '_') |
| 1758 | } |
| 1759 | } |
Sergey Zhemerdeev | 78a6527 | 2023-03-23 18:05:22 +0200 | [diff] [blame] | 1760 | } |
| 1761 | common.infoMsg("${imageName} image will use tag '${latestTag}'") |
| 1762 | return latestTag |
| 1763 | } |
Sergey Zhemerdeev | 1d2c03e | 2023-04-28 11:07:24 +0300 | [diff] [blame] | 1764 | |
Sergey Lalov | 7865910 | 2024-02-15 16:57:21 +0400 | [diff] [blame] | 1765 | /** |
| 1766 | * Get actual branch version for os deployment job |
| 1767 | * @param mosChildPreviouseComplexRelease (string) kaas_previous_complex_mosk_cluster_release_version.txt |
| 1768 | * @param mosChildLatestComplexRelease (string) kaas_latest_complex_mosk_cluster_release_version.txt |
| 1769 | * @param upgradeFlag (boolean) |
| 1770 | * all parametrs get from si-test-release-sanity-check-prepare-configuration job |
| 1771 | * @return: (string) branch verison |
| 1772 | */ |
| 1773 | def getOpenstackbranchVersion(mosChildPreviouseComplexRelease, mosChildLatestComplexRelease, upgradeFlag) { |
| 1774 | def common = new com.mirantis.mk.Common() |
| 1775 | def regex = Pattern.compile('([a-z]+)-([0-9]+-[0-9]+-[0-9]+)-([a-z]*)-?([0-9]+-[0-9]+-?[0-9]*)') |
| 1776 | |
| 1777 | def mosVersionBranch = upgradeFlag ? mosChildPreviouseComplexRelease : mosChildLatestComplexRelease |
| 1778 | def matcherComplexVersion = regex.matcher((mosVersionBranch).toString()) |
| 1779 | def releaseOpenstackK8sBranch = 'master' |
| 1780 | |
| 1781 | if (matcherComplexVersion.find()) { |
| 1782 | def matcherComplexVersionParts = matcherComplexVersion.group(2).split('-') |
| 1783 | releaseOpenstackK8sBranch = String.format('%s.%s.%s', matcherComplexVersionParts[0], matcherComplexVersionParts[1], '0') |
| 1784 | } |
| 1785 | common.infoMsg("Use: OPENSTACK_DEPLOY_RELEASE_DIR ${releaseOpenstackK8sBranch}") |
| 1786 | return releaseOpenstackK8sBranch |
| 1787 | } |
| 1788 | |
| 1789 | |
Sergey Zhemerdeev | 1d2c03e | 2023-04-28 11:07:24 +0300 | [diff] [blame] | 1790 | |
| 1791 | /** |
| 1792 | * Translates set of environment vars into actual replicator command line |
| 1793 | * @return: (string cmdParams, string jobDescription) |
| 1794 | * cmdParams - generated command line |
| 1795 | * jobDescription - job description |
| 1796 | */ |
| 1797 | def genReplicatorCommandLine() { |
| 1798 | def mainModes = ['REPLICATE', 'CLEANUP', 'CHECK_REPOS', 'BIN_CLEANUP'] |
Sergey Zhemerdeev | 9919b1b | 2023-04-28 17:24:21 +0300 | [diff] [blame] | 1799 | def parameterWithoutArgument = mainModes |
Sergey Zhemerdeev | 1d2c03e | 2023-04-28 11:07:24 +0300 | [diff] [blame] | 1800 | def parametersList = parameterWithoutArgument + [ |
| 1801 | 'ARTIFACT_FILTER', |
| 1802 | 'ARTIFACT_TYPE', |
| 1803 | 'BIN_CLEAN_KEEP_DAYS', |
| 1804 | 'BIN_CLEAN_PREFIX', |
| 1805 | 'DOCKER_TAG', |
| 1806 | // DST_ will be changed to TARGET_ |
| 1807 | 'DST_REPO', |
| 1808 | 'DST_REPO_TYPE', |
| 1809 | 'DST_USER', |
| 1810 | 'OLDER_THAN_DAYS', |
| 1811 | 'SLACK_BUILD_URL', |
| 1812 | 'SLACK_CHANNEL', |
| 1813 | 'SLACK_USER', |
| 1814 | 'SRC_REPO', |
| 1815 | 'SRC_REPO_TYPE', |
| 1816 | 'SRC_USER', |
| 1817 | 'SYNC_PATTERN', |
| 1818 | 'THREAD_COUNT' |
| 1819 | ] |
| 1820 | def mainModesDescriptions = [ |
| 1821 | 'REPLICATE': 'Replicating binaries/Docker images', |
| 1822 | 'CLEANUP': 'Cleaning Docker images', |
| 1823 | 'BIN_CLEANUP': 'Cleaning binaries', |
| 1824 | 'CHECK_REPOS': 'Checking binaries' |
| 1825 | ] |
| 1826 | |
| 1827 | def cmdParams = '' |
| 1828 | def jobDescription = '' |
| 1829 | for (e in parametersList) { |
| 1830 | if (env[e] == null || env[e] == '') { |
| 1831 | continue |
| 1832 | } |
| 1833 | if (e in mainModes) { |
| 1834 | jobDescription = mainModesDescriptions[e] |
| 1835 | } |
| 1836 | cmdParams += "-${e.replaceAll('_', '-').toLowerCase()} " |
| 1837 | if (!(e in parameterWithoutArgument)) { |
| 1838 | cmdParams += "'${env[e]}' " |
| 1839 | } |
| 1840 | } |
| 1841 | return [cmdParams, jobDescription] |
| 1842 | } |