From 05731cc9b0a9b1f755aaf480b153a3a0111460b4 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Fri, 25 Aug 2017 15:58:32 -0400 Subject: Test labels list --- jenkins/generator_DSL.groovy | 8 ++++++++ jenkins/job-suite-generator.groovy | 1 + 2 files changed, 9 insertions(+) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index f74275c..31b6022 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -27,6 +27,13 @@ this.build_control_repo = this.build_control_repo.trim() this.build_control_branch = readFileFromWorkspace("VAR-build_control_branch") this.build_control_branch= this.build_control_branch.trim() + +println("**LABELS:") +for (label in labels) { + println("${label}") +} + + pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { // At trigger-time, allow for setting manifest culling behavior. parameters { @@ -40,6 +47,7 @@ pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { "script: ${this.script}\n" + "MANIFEST_FILE: ${manifest_file}\n" + "LABEL: ${label}\n" + + "LABELS: ${labels}\n" + "PY_VERSION: ${py_version}\n" + "BUILD_CONTROL_REPO: ${build_control_repo}\n" + "BUILD_CONTROL_BRANCH: ${build_control_branch}\n" + diff --git a/jenkins/job-suite-generator.groovy b/jenkins/job-suite-generator.groovy index 1501b69..19203b7 100644 --- a/jenkins/job-suite-generator.groovy +++ b/jenkins/job-suite-generator.groovy @@ -60,6 +60,7 @@ node("master") { " Parameters:\n" + "manifest_file: ${this.manifest_file}\n" + "label: ${this.label}\n" + + "labels: ${this.labels}\n" + "py_version: ${this.py_version}\n" + "conda_version: ${this.conda_version}\n" + "conda_build_version: ${this.conda_build_version}\n" + -- cgit From d4353728280f85f4df68ba5de505438669bfcee5 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 09:49:27 -0400 Subject: Split list properly --- jenkins/generator_DSL.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index 31b6022..6c7d39e 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -29,7 +29,7 @@ this.build_control_branch= this.build_control_branch.trim() println("**LABELS:") -for (label in labels) { +for (label in labels.trim().tokenize()) { println("${label}") } -- cgit From d45666d6a8f01bf63744b6aab1af9e3eab19c560 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 10:17:12 -0400 Subject: Create multiple job suites. --- jenkins/generator_DSL.groovy | 189 ++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 93 deletions(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index 6c7d39e..0c9bbeb 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -6,14 +6,9 @@ import org.yaml.snakeyaml.Yaml def yaml = new Yaml() def config = yaml.load(readFileFromWorkspace("manifests/${manifest_file}")) -def job_def_generation_time = new Date() +def job_def_generation_time = new Date() -//----------------------------------------------------------------------- -// Create a folder to contain the jobs which are created below. - -suite_name = "${manifest_file.tokenize(".")[0]}_${label}_py${py_version}" -folder(suite_name) //----------------------------------------------------------------------- @@ -30,98 +25,106 @@ this.build_control_branch= this.build_control_branch.trim() println("**LABELS:") for (label in labels.trim().tokenize()) { - println("${label}") -} - - -pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { - // At trigger-time, allow for setting manifest culling behavior. - parameters { - booleanParam("cull_manifest", - true, - "Whether or not package recipes that would generate a " + - "package file name that already exists in the manfest's" + - " channel archive are removed from the build list.") - } - println("\n" + - "script: ${this.script}\n" + - "MANIFEST_FILE: ${manifest_file}\n" + - "LABEL: ${label}\n" + - "LABELS: ${labels}\n" + - "PY_VERSION: ${py_version}\n" + - "BUILD_CONTROL_REPO: ${build_control_repo}\n" + - "BUILD_CONTROL_BRANCH: ${build_control_branch}\n" + - "CONDA_VERSION: ${conda_version}\n" + - "CONDA_BUILD_VERSION: ${conda_build_version}\n" + - "CONDA_BASE_URL: ${conda_base_URL}\n" + - "UTILS_REPO: ${utils_repo}\n") - environmentVariables { - env("JOB_DEF_GENERATION_TIME", job_def_generation_time) - env("SCRIPT", this.script) - env("MANIFEST_FILE", manifest_file) - env("LABEL", label) - env("PY_VERSION", py_version) - env("BUILD_CONTROL_REPO", build_control_repo) - env("BUILD_CONTROL_BRANCH", build_control_branch) - env("CONDA_VERSION", conda_version) - env("CONDA_BUILD_VERSION", conda_build_version) - env("CONDA_BASE_URL", conda_base_URL) - env("UTILS_REPO", utils_repo) - } - definition { - cps { - script(readFileFromWorkspace("jenkins/${this.script}")) - sandbox() - } - } -} + for (py_version in py_versions.trim().tokenize()) { + println("**** ${label}-${py_version}") + //----------------------------------------------------------------------- + // Create a folder to contain the jobs which are created below. -//----------------------------------------------------------------------- -// Generate the series of actual package building jobs. + suite_name = "${manifest_file.tokenize(".")[0]}_${label}_py${py_version}" + folder(suite_name) -for(pkg in config.packages) { - pipelineJob("${suite_name}/${pkg}") { - environmentVariables { - env("JOB_DEF_GENERATION_TIME", job_def_generation_time) - } - parameters { - stringParam("label", - "label-DEFAULTVALUE", - "The node on which to run.") - stringParam("build_control_repo", - "build_control_repo-DEFAULTVALUE", - "Repository containing the build system scripts.") - stringParam("build_control_branch", - "build_control_branch-DEFAULTVALUE", - "Branch checked out to obtain build system scripts.") - stringParam("py_version", - "py_version-DEFAULTVALUE", - "python version to use") - stringParam("numpy_version", - "numpy_version-DEFAULTVALUE", - "Version of numpy to use") - stringParam("parent_workspace", - "parent_workspace-DEFAULTVALUE", - "The workspace dir of the dispatch job") - stringParam("manifest_file", - "manifest_file-DEFAULTVALUE", - "Manifest (release) file to use for the build.") - stringParam("cull_manifest", - "cull_manifest-DEFAULTVALUE", - "Was the manifest culled as part of dispatch?") - stringParam("channel_URL", - "channel_URL-DEFAULTVALUE", - "Publication channel used for culled builds.") - } - definition { - cps { - script(readFileFromWorkspace("jenkins/package_builder.groovy")) - sandbox() + pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { + // At trigger-time, allow for setting manifest culling behavior. + parameters { + booleanParam("cull_manifest", + true, + "Whether or not package recipes that would generate a " + + "package file name that already exists in the manfest's" + + " channel archive are removed from the build list.") + } + println("\n" + + "script: ${this.script}\n" + + "MANIFEST_FILE: ${manifest_file}\n" + + "LABEL: ${label}\n" + + "LABELS: ${labels}\n" + + "PY_VERSION: ${py_version}\n" + + "BUILD_CONTROL_REPO: ${build_control_repo}\n" + + "BUILD_CONTROL_BRANCH: ${build_control_branch}\n" + + "CONDA_VERSION: ${conda_version}\n" + + "CONDA_BUILD_VERSION: ${conda_build_version}\n" + + "CONDA_BASE_URL: ${conda_base_URL}\n" + + "UTILS_REPO: ${utils_repo}\n") + environmentVariables { + env("JOB_DEF_GENERATION_TIME", job_def_generation_time) + env("SCRIPT", this.script) + env("MANIFEST_FILE", manifest_file) + env("LABEL", label) + env("PY_VERSION", py_version) + env("BUILD_CONTROL_REPO", build_control_repo) + env("BUILD_CONTROL_BRANCH", build_control_branch) + env("CONDA_VERSION", conda_version) + env("CONDA_BUILD_VERSION", conda_build_version) + env("CONDA_BASE_URL", conda_base_URL) + env("UTILS_REPO", utils_repo) + } + definition { + cps { + script(readFileFromWorkspace("jenkins/${this.script}")) + sandbox() + } } } - } // end pipelineJob -} //end for(pkg... + //----------------------------------------------------------------------- + // Generate the series of actual package building jobs. + + for(pkg in config.packages) { + + pipelineJob("${suite_name}/${pkg}") { + environmentVariables { + env("JOB_DEF_GENERATION_TIME", job_def_generation_time) + } + parameters { + stringParam("label", + "label-DEFAULTVALUE", + "The node on which to run.") + stringParam("build_control_repo", + "build_control_repo-DEFAULTVALUE", + "Repository containing the build system scripts.") + stringParam("build_control_branch", + "build_control_branch-DEFAULTVALUE", + "Branch checked out to obtain build system scripts.") + stringParam("py_version", + "py_version-DEFAULTVALUE", + "python version to use") + stringParam("numpy_version", + "numpy_version-DEFAULTVALUE", + "Version of numpy to use") + stringParam("parent_workspace", + "parent_workspace-DEFAULTVALUE", + "The workspace dir of the dispatch job") + stringParam("manifest_file", + "manifest_file-DEFAULTVALUE", + "Manifest (release) file to use for the build.") + stringParam("cull_manifest", + "cull_manifest-DEFAULTVALUE", + "Was the manifest culled as part of dispatch?") + stringParam("channel_URL", + "channel_URL-DEFAULTVALUE", + "Publication channel used for culled builds.") + } + definition { + cps { + script(readFileFromWorkspace("jenkins/package_builder.groovy")) + sandbox() + } + } + } // end pipelineJob + + } //end for(pkg... + + } // end for(py_version +} // end for(label -- cgit From cac5345fcbe028593020bfe6da49ca060975b0fc Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 10:26:45 -0400 Subject: Scope adjust --- jenkins/generator_DSL.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index 0c9bbeb..cd128e6 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -23,7 +23,9 @@ this.build_control_branch = readFileFromWorkspace("VAR-build_control_branch") this.build_control_branch= this.build_control_branch.trim() -println("**LABELS:") +println("**combinations:") +def label = "" +def py_version = "" for (label in labels.trim().tokenize()) { for (py_version in py_versions.trim().tokenize()) { println("**** ${label}-${py_version}") -- cgit From 54ab1cbb07127c7e071e8ac46d819e0588ce52dc Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 10:28:25 -0400 Subject: Scope test --- jenkins/generator_DSL.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index cd128e6..167480b 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -24,11 +24,13 @@ this.build_control_branch= this.build_control_branch.trim() println("**combinations:") -def label = "" -def py_version = "" +this.label = "" +this.py_version = "" for (label in labels.trim().tokenize()) { for (py_version in py_versions.trim().tokenize()) { - println("**** ${label}-${py_version}") + this.label = label + this.py_version = py_version + println("**** ${this.label}-${this.py_version}") //----------------------------------------------------------------------- // Create a folder to contain the jobs which are created below. -- cgit From be1a3534f85b728e3fa659e81ce3a92658664438 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 10:30:28 -0400 Subject: Remove old var --- jenkins/generator_DSL.groovy | 6 +----- jenkins/job-suite-generator.groovy | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index 167480b..dd9c105 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -24,13 +24,9 @@ this.build_control_branch= this.build_control_branch.trim() println("**combinations:") -this.label = "" -this.py_version = "" for (label in labels.trim().tokenize()) { for (py_version in py_versions.trim().tokenize()) { - this.label = label - this.py_version = py_version - println("**** ${this.label}-${this.py_version}") + println("**** ${label}-${py_version}") //----------------------------------------------------------------------- // Create a folder to contain the jobs which are created below. diff --git a/jenkins/job-suite-generator.groovy b/jenkins/job-suite-generator.groovy index 19203b7..4a491ee 100644 --- a/jenkins/job-suite-generator.groovy +++ b/jenkins/job-suite-generator.groovy @@ -59,7 +59,6 @@ node("master") { "build_control_branch: ${build_control_branch}\n" + " Parameters:\n" + "manifest_file: ${this.manifest_file}\n" + - "label: ${this.label}\n" + "labels: ${this.labels}\n" + "py_version: ${this.py_version}\n" + "conda_version: ${this.conda_version}\n" + -- cgit From 56bd3a5d92eea975757e4939b30af848040a84b5 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 10:31:25 -0400 Subject: Remove var --- jenkins/job-suite-generator.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/job-suite-generator.groovy b/jenkins/job-suite-generator.groovy index 4a491ee..c53ec2e 100644 --- a/jenkins/job-suite-generator.groovy +++ b/jenkins/job-suite-generator.groovy @@ -60,7 +60,7 @@ node("master") { " Parameters:\n" + "manifest_file: ${this.manifest_file}\n" + "labels: ${this.labels}\n" + - "py_version: ${this.py_version}\n" + + "py_versions: ${this.py_versions}\n" + "conda_version: ${this.conda_version}\n" + "conda_build_version: ${this.conda_build_version}\n" + "conda_base_URL: ${this.conda_base_URL}\n" + -- cgit From 9e7b804874dcc4329014181ee7d27f053646155e Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 12:45:28 -0400 Subject: Cleanup and add suite description --- jenkins/generator_DSL.groovy | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index dd9c105..598cf96 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -9,12 +9,6 @@ def config = yaml.load(readFileFromWorkspace("manifests/${manifest_file}")) def job_def_generation_time = new Date() - - -//----------------------------------------------------------------------- -// Generate the dispatch job that will trigger the chain of package -// build jobs. - this.script = "dispatch.groovy" this.build_control_repo = readFileFromWorkspace("VAR-build_control_repo") @@ -22,19 +16,29 @@ this.build_control_repo = this.build_control_repo.trim() this.build_control_branch = readFileFromWorkspace("VAR-build_control_branch") this.build_control_branch= this.build_control_branch.trim() - -println("**combinations:") +// For each label (OS) in the list provided by the 'labels' job parameter, iterate +// over each python version provided by the 'py_versions' job parameter, to obtain +// every combination of OS and python version. Generate a separate job suite for +// each combination. for (label in labels.trim().tokenize()) { for (py_version in py_versions.trim().tokenize()) { - println("**** ${label}-${py_version}") //----------------------------------------------------------------------- // Create a folder to contain the jobs which are created below. suite_name = "${manifest_file.tokenize(".")[0]}_${label}_py${py_version}" - folder(suite_name) - + folder(suite_name) { + description("Build suite generated: ${job_def_generation_time}\n" + + "build control repo: ${build_control_repo}\n" + + "build control branch/tag: ${build_control_branch}\n" + + "conda version: ${conda_version}\n" + + "conda-build version: ${conda-build_version}\n" + + "utils_repo: ${utils_repo}") + } + //----------------------------------------------------------------------- + // Generate the dispatch job that will trigger the chain of package + // build jobs. pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { // At trigger-time, allow for setting manifest culling behavior. parameters { @@ -48,7 +52,6 @@ for (label in labels.trim().tokenize()) { "script: ${this.script}\n" + "MANIFEST_FILE: ${manifest_file}\n" + "LABEL: ${label}\n" + - "LABELS: ${labels}\n" + "PY_VERSION: ${py_version}\n" + "BUILD_CONTROL_REPO: ${build_control_repo}\n" + "BUILD_CONTROL_BRANCH: ${build_control_branch}\n" + -- cgit From e4ebac4fdb7a29de18c8c9ee128ff93e244e020a Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Mon, 28 Aug 2017 12:47:37 -0400 Subject: Typo fix --- jenkins/generator_DSL.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index 598cf96..7dd10ea 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -32,7 +32,7 @@ for (label in labels.trim().tokenize()) { "build control repo: ${build_control_repo}\n" + "build control branch/tag: ${build_control_branch}\n" + "conda version: ${conda_version}\n" + - "conda-build version: ${conda-build_version}\n" + + "conda-build version: ${conda_build_version}\n" + "utils_repo: ${utils_repo}") } -- cgit