aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-09-21 14:27:59 -0400
committerMatt Rendina <mrendina@stsci.edu>2017-09-22 11:22:52 -0400
commitc4a560e340bee45d60ef499ad963bdd8fbb7cc5d (patch)
tree7d757a310f4d840aef7505e241c8d285ffc23d38
parentb42617a75628294b715e3fd9f25acdbf29f367c9 (diff)
downloadbuild_control-c4a560e340bee45d60ef499ad963bdd8fbb7cc5d.tar.gz
* Use pin environment only if pin packages are specified.
* Convert cull_manifest to proper boolean parameter.
-rw-r--r--jenkins/dispatch.groovy34
-rw-r--r--jenkins/generator_DSL.groovy7
-rw-r--r--jenkins/package_builder.groovy13
-rw-r--r--jenkins/version_pins.yml9
-rw-r--r--manifests/dev-test.yaml2
5 files changed, 47 insertions, 18 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy
index aa6b924..36df8ee 100644
--- a/jenkins/dispatch.groovy
+++ b/jenkins/dispatch.groovy
@@ -3,9 +3,11 @@
// MANIFEST_FILE - The "release" type; list of recipes/packages to build
// LABEL - Node or logical group of build nodes
// PY_VERSION - Python version hosted by conda to support the build
+// NUMPY_VERSION - numpy version used to support the build
// BUILD_CONTROL_REPO - Repository holding this & other build system files,
// and manifest files
// BUILD_CONTROL_BRANCH - Branch to obtain from build control repo
+// BUILD_CONTROL_TAG - Tag to obtain from build control repo
// CONDA_VERSION - First, then the version is forced to this value.
// CONDA_BUILD_VERSION - Conda-build is installed forced to this version.
// CONDA_BASE_URL - Where to get the conda installer
@@ -214,7 +216,14 @@ node(LABEL) {
// Create and populate environment to be used for pinning reference when
// building packages via the --bootstrap flag.
// sh "conda create --name pin_env python=${PY_VERSION}"
- if (CONDA_BUILD_VERSION[0] == "3") {
+ this.use_version_pins = false
+ // This test requires script approval for signature:
+ // org.codehaus.groovy.runtime.DefaultGroovyMethods
+ // hasProperty java.lang.Object java.lang.String
+ if (this.pins_file.hasProperty('packages')) {
+ this.use_version_pins = true
+ }
+ if (CONDA_BUILD_VERSION[0] == "3" && this.use_version_pins) {
println("Creating environment based on package pin values found \n" +
"in ${this.version_pins_file} to use as global version pinnning \n" +
"specification.")
@@ -236,9 +245,9 @@ node(LABEL) {
stage("Generate build list") {
// Generate a filtered, optionally culled, & dependency-ordered list
// of available package recipes.
- def culled_option = "--culled"
- if (this.cull_manifest == "false") {
- culled_option = ""
+ def culled_option = ""
+ if (this.cull_manifest) {
+ culled_option = "--culled"
}
def build_list_file = "build_list"
cmd = "rambo"
@@ -266,15 +275,24 @@ node(LABEL) {
stage("Build packages") {
for (pkg in this.build_list) {
build job: pkg,
- parameters:
- [string(name: "label", value: env.NODE_NAME),
+ parameters: [
+ string(name: "label", value: env.NODE_NAME),
string(name: "build_control_repo", value: BUILD_CONTROL_REPO),
string(name: "build_control_branch", value: BUILD_CONTROL_BRANCH),
+ string(name: "build_control_tag", value: BUILD_CONTROL_TAG),
string(name: "py_version", value: PY_VERSION),
string(name: "numpy_version", value: NUMPY_VERSION),
string(name: "parent_workspace", value: env.WORKSPACE),
- string(name: "cull_manifest", value: this.cull_manifest),
- string(name: "channel_URL", value: this.manifest.channel_URL)],
+ string(name: "manifest_file", value: MANIFEST_FILE),
+ [$class: 'BooleanParameterValue',
+ name: "cull_manifest",
+ value: this.cull_manifest.toBoolean()],
+ string(name: "channel_URL", value: this.manifest.channel_URL),
+ [$class: 'BooleanParameterValue',
+ name: "use_version_pins",
+ value: this.use_version_pins.toBoolean()]
+ ]
+ // toBoolean java.lang.Boolean above equires script approval
propagate: false
}
// Set overall status to that propagated from individual jobs.
diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy
index 6474e9c..82503c9 100644
--- a/jenkins/generator_DSL.groovy
+++ b/jenkins/generator_DSL.groovy
@@ -127,12 +127,15 @@ for (label in labels.trim().tokenize()) {
stringParam("manifest_file",
"manifest_file-DEFAULTVALUE",
"Manifest (release) file to use for the build.")
- stringParam("cull_manifest",
- "cull_manifest-DEFAULTVALUE",
+ booleanParam("cull_manifest",
+ false,
"Was the manifest culled as part of dispatch?")
stringParam("channel_URL",
"channel_URL-DEFAULTVALUE",
"Publication channel used for culled builds.")
+ booleanParam("use_version_pins",
+ false,
+ "Whether or not to use global version pins.")
}
definition {
cps {
diff --git a/jenkins/package_builder.groovy b/jenkins/package_builder.groovy
index 688cc25..9d7db25 100644
--- a/jenkins/package_builder.groovy
+++ b/jenkins/package_builder.groovy
@@ -1,4 +1,4 @@
-// Parameters inherited environment injection.
+// Parameters inherited via environment injection at job creation time.
//----------------------------------------------------------------------------
// CONDA_BUILD_VERSION - Conda-build is installed forced to this version.
@@ -35,6 +35,7 @@ node(this.label) {
"parameter numpy_version: ${this.numpy_version}\n" +
"parameter cull_manifest: ${this.cull_manifest}\n" +
"parameter channel_URL: ${this.channel_URL}\n" +
+ "parameter use_version_pins: ${this.use_version_pins}\n" +
"PATH: ${env.PATH}\n" +
"PYTHONPATH: ${env.PYTHONPATH}\n" +
"PYTHONUNBUFFERED: ${env.PYTHONUNBUFFERED}\n")
@@ -63,7 +64,8 @@ node(this.label) {
// simply download dependency packages from the publication
// channel as needed, rather than build them as part of the
// package build session that requires them.
- if (this.cull_manifest == "true") {
+ // Channel arguments are order-dependent.
+ if (this.cull_manifest) {
args.add("--channel ${this.channel_URL}")
}
args.add("--channel defaults")
@@ -74,7 +76,9 @@ node(this.label) {
// here.
if (CONDA_BUILD_VERSION[0] == "3") {
args.add("--old-build-string")
- args.add("--bootstrap pin_env")
+ if (this.use_version_pins == "true") {
+ args.add("--bootstrap pin_env")
+ }
}
// Compose build command string to use in shell call.
for (arg in args) {
@@ -101,7 +105,8 @@ node(this.label) {
"--python=${this.py_version}",
"--numpy=${this.numpy_version}",
"--override-channels"]
- if (this.cull_manifest == "true") {
+ // Channel arguments are order-dependent.
+ if (this.cull_manifest) {
args.add("--channel ${this.channel_URL}")
}
args.add("--channel defaults")
diff --git a/jenkins/version_pins.yml b/jenkins/version_pins.yml
index caaa16a..2d6f23e 100644
--- a/jenkins/version_pins.yml
+++ b/jenkins/version_pins.yml
@@ -1,3 +1,5 @@
+# This file must exist even if empty or entirely commented out.
+#
# This file is only honored when the build system is configured to use
# conda-build 3.x.
#
@@ -8,6 +10,7 @@
# - setuptools 36.4.0 is released in a broken state which prevents packages
# that have it as a build requirement from building.
# - setuptools can be pinned to an earlier version for all package builds
-# that happen in a given job suite, allowing them to succeed.
-packages:
- - setuptools 27.2.0
+# that happen in a given job suite, allowing them to succeed.
+#
+#packages:
+# - setuptools 27.2.0
diff --git a/manifests/dev-test.yaml b/manifests/dev-test.yaml
index fd6fe7e..cad5d5a 100644
--- a/manifests/dev-test.yaml
+++ b/manifests/dev-test.yaml
@@ -5,7 +5,7 @@ repository: 'https://github.com/astroconda/astroconda-dev'
channel_URL: 'http://ssb.stsci.edu/astroconda-dev'
# publication_root path needs to be visible from the slave nodes.
-publication_root: '/eng/ssb/websites/ssbpublic/astroconda-dev'
+publication_root: '/eng/ssb/websites/ssbpublic/astroconda-j-dev-staging'
packages:
# - drizzlepac
- jwst_gtvt