diff options
-rw-r--r-- | jenkins/dispatch.groovy | 66 | ||||
-rw-r--r-- | jenkins/package_builder.groovy | 71 | ||||
-rw-r--r-- | manifests/dev.yaml | 5 | ||||
-rw-r--r-- | manifests/public.yaml | 1 | ||||
-rw-r--r-- | patches/conda_build_2.1.1_substr_fix_py2.patch | 11 | ||||
-rw-r--r-- | patches/conda_build_2.1.1_substr_fix_py3.patch | 11 |
6 files changed, 102 insertions, 63 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 77ceb36..df7f780 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -30,11 +30,11 @@ node(LABEL) { if (uname == "Darwin") { this.OSname = "MacOSX" env.PATH = "${env.PATH}:/sw/bin" - this.CONDA_BLD_OUTPUT_DIR = "osx-64" + this.CONDA_PLATFORM = "osx-64" } if (uname == "Linux") { this.OSname = uname - this.CONDA_BLD_OUTPUT_DIR = "linux-64" + this.CONDA_PLATFORM = "linux-64" } assert uname != null @@ -47,7 +47,7 @@ node(LABEL) { // Allow for sharing build_list between stages below. this.build_list = [] - stage('Setup') { + stage("Setup") { // Inherited from env() assignment performed in the generator // DSL script. @@ -60,6 +60,7 @@ node(LABEL) { println("PY_VERSION = ${PY_VERSION}") assert PY_VERSION != null assert PY_VERSION != "py_version-DEFAULTVALUE" + this.py_maj_version = "${PY_VERSION.split.(".")[0]}" // Inherited from env() assignment performed in the generator // DSL script. @@ -67,6 +68,8 @@ node(LABEL) { assert MANIFEST_FILE != null assert MANIFEST_FILE != "manifest_file-DEFAULTVALUE" + println("PATH = ${env.PATH}") + // Fetch the manifest files git url: this.build_control_URL @@ -95,15 +98,26 @@ node(LABEL) { // Run miniconda installer and then force to particular version sh "bash ./${conda_installer} -b -p miniconda" - env.PATH = "${env.WORKSPACE}/miniconda/bin/:" + "${env.PATH}" + env.PATH = "${env.WORKSPACE}/miniconda/bin/:${env.PATH}" sh "conda install --quiet conda=${this.conda_version}" sh "conda install --quiet --yes conda-build=${this.conda_build_version}" + // Apply bugfix patch to conda_build 2.1.1 + def patches_dir = "${env.WORKSPACE}/patches" + def patch = "${patches_dir}/conda_build_2.1.1_substr_fix_py${this.py_maj_version}.patch" + dir("miniconda/lib/python${PY_VERSION}/site-packages/conda/conda_build") { + sh "patch ${patch}" + } + this.manifest = readYaml file: "manifests/" + this.manifest_file + if (this.manifest.channel_URL == '/') { + this.manifest.channel_URL = this.manifest.channel_URL[0..-2] + } println("Manifest repository: ${this.manifest.repository}") println("Manifest numpy version specification: " + "${this.manifest.numpy_version}") + println("Manifest channel_URL: ${this.manifest.channel_URL}") println("Manifest packages to build:") for (pkgname in this.manifest.packages) { println(pkgname) @@ -113,43 +127,43 @@ node(LABEL) { dir(this.recipes_dir) { git url: this.manifest.repository } - - // Retrieve recipe management tools - - } stage("Generate build list") { - // Call in Rambo. + // Obtain build utilities dir(this.utils_dir) { git url: this.utils_URL } - // Generate a dependency-ordered list of available package recipes. - cmd = "${this.utils_dir}/rambo.py --ordered ${this.recipes_dir}" - ordered_available = - sh(script: cmd, returnStdout: true).trim().tokenize() - - // Compose the ordered union of the list of available recipes and the - // actual build manifest. - build_list = [] - for (pkg in ordered_available) { - if (pkg in this.manifest.packages) { - build_list.push(pkg) - } + // Generate a filtered, culled, & dependency-ordered list of available + // package recipes. + def blist_file = "build_list" + cmd = "${this.utils_dir}/rambo.py" + args = ["--platform ${this.CONDA_PLATFORM}", + "--manifest manifests/${this.manifest_file}", + "--file ${blist_file}", + "--culled", + this.recipes_dir] + for (arg in args) { + cmd = "${cmd} ${arg}" } + sh(script: cmd) + + def blist_text = readFile blist_file + def build_list = blist_text.trim().tokenize() println("Build list:") println(build_list) } - stage('Build packages') { + stage("Build packages") { for (pkg in build_list) { build job: pkg, parameters: - [string(name: 'label', value: env.NODE_NAME), - string(name: 'py_version', value: PY_VERSION), - string(name: 'numpy_version', value: "${this.manifest.numpy_version}"), - string(name: 'parent_workspace', value: env.WORKSPACE)], + [string(name: "label", value: env.NODE_NAME), + string(name: "py_version", value: PY_VERSION), + string(name: "numpy_version", + value: "${this.manifest.numpy_version}"), + string(name: "parent_workspace", value: env.WORKSPACE)], propagate: false } } diff --git a/jenkins/package_builder.groovy b/jenkins/package_builder.groovy index 2391abf..9f06ac7 100644 --- a/jenkins/package_builder.groovy +++ b/jenkins/package_builder.groovy @@ -3,60 +3,61 @@ node(this.label) { dir(this.parent_workspace) { println("inherited workspace: ${this.parent_workspace}") - println("Nodelabel: ${this.label}") - println("${env.JOB_NAME}") - println("${env.JOB_BASE_NAME}") - println("${env.BUILD_NUMBER}") - println("${env.NODE_NAME}") - println("${env.WORKSPACE}") - println("${env.JENKINS_HOME}") + println("this.Nodelabel: ${this.label}") + println("env.JOB_NAME: ${env.JOB_NAME}") + println("env.JOB_BASE_NAME: ${env.JOB_BASE_NAME}") + println("env.BUILD_NUMBER: ${env.BUILD_NUMBER}") + println("env.NODE_NAME: ${env.NODE_NAME}") + println("env.WORKSPACE: ${env.WORKSPACE}") + println("env.JENKINS_HOME: ${env.JENKINS_HOME}") println(currentBuild.buildVariables) println("parameter py_version: ${this.py_version}") env.PATH = "${this.parent_workspace}/miniconda/bin/:" + "${env.PATH}" + println("PATH: ${env.PATH}") // Make the log files a bit more deterministic env.PYTHONUNBUFFERED = "true" - this.OSname = null - uname = sh(script: "uname", returnStdout: true).trim() - if (uname == "Darwin") { - this.OSname = "MacOSX" - env.PATH = "${env.PATH}:/sw/bin" - this.CONDA_BLD_OUTPUT_DIR = "osx-64" - } - if (uname == "Linux") { - this.OSname = uname - this.CONDA_BLD_OUTPUT_DIR = "linux-64" - } - assert uname != null - println("${this.CONDA_BLD_OUTPUT_DIR}") - - // In directory common to all package build jobs, run conda build for this - // package. + // In the directory common to all package build jobs, + // run conda build --dirty for this package to use any existing work + // directory or source trees already obtained. dir("conda-recipes") { - build_cmd = "conda build" + cmd = "conda build" stage("Build") { - build_args = "--no-test --no-anaconda-upload --python=${this.py_version}" + - " --numpy=${this.numpy_version} --skip-existing" + build_cmd = cmd + args = ["--no-test", + "--no-anaconda-upload", + "--python=${this.py_version}", + "--numpy=${this.numpy_version}", + "--skip-existing", + "--dirty"] + for (arg in args) { + build_cmd = "${build_cmd} ${arg}" + } stat = 999 - - stat = sh(script: "${build_cmd} ${build_args} ${env.JOB_BASE_NAME}", - returnStatus: true) - println("Shell call returned status: ${stat}") + stat = sh(script: "${build_cmd} ${env.JOB_BASE_NAME}", + returnStatus: true) if (stat != 0) { currentBuild.result = "FAILURE" } } stage("Test") { - build_args = "--test --no-anaconda-upload --python=${this.py_version}" + - " --numpy=${this.numpy_version} --skip-existing" - stat = sh(script: "${build_cmd} ${build_args} ${env.JOB_BASE_NAME}", - returnStatus: true) - println("Shell call returned status: ${stat}") + build_cmd = cmd + args = ["--test", + "--no-anaconda-upload", + "--python=${this.py_version}", + "--numpy=${this.numpy_version}", + "--skip-existing"] + for (arg in args) { + build_cmd = "${build_cmd} ${arg}" + } + stat = 999 + stat = sh(script: "${build_cmd} ${env.JOB_BASE_NAME}", + returnStatus: true) if (stat != 0) { currentBuild.result = "UNSTABLE" } diff --git a/manifests/dev.yaml b/manifests/dev.yaml index 0df5e31..fabd494 100644 --- a/manifests/dev.yaml +++ b/manifests/dev.yaml @@ -1,4 +1,5 @@ repository: 'https://github.com/astroconda/astroconda-dev' +channel_URL: 'http://ssb.stsci.edu/astroconda-dev' numpy_version: 1.11 packages: - stsci.tools @@ -29,7 +30,7 @@ packages: - fitsblender - ginga - glueviz - - glue-core +# - glue-core - glue-vispy-viewers - gwcs - hstcal @@ -37,7 +38,7 @@ packages: - imexam - jplephem - jwst - - jwst_coronagraph_visibility +# - jwst_coronagraph_visibility - jwst_gtvt - jwxml - mosviz diff --git a/manifests/public.yaml b/manifests/public.yaml index 865b66e..d831d87 100644 --- a/manifests/public.yaml +++ b/manifests/public.yaml @@ -1,4 +1,5 @@ repository: 'https://github.com/astroconda/astroconda-contrib' +channel_URL: 'http://ssb.stsci.edu/astroconda' numpy_version: 1.11 packages: - stsci.tools diff --git a/patches/conda_build_2.1.1_substr_fix_py2.patch b/patches/conda_build_2.1.1_substr_fix_py2.patch new file mode 100644 index 0000000..20a69f0 --- /dev/null +++ b/patches/conda_build_2.1.1_substr_fix_py2.patch @@ -0,0 +1,11 @@ +--- config.py.ORIG 2017-04-18 10:00:00.000000000 -0400 ++++ config.py 2017-04-18 10:00:24.000000000 -0400 +@@ -246,7 +246,7 @@ + assert not os.path.isabs(package_name), ("package name should not be a absolute path, " + "to preserve croot during path joins") + build_folders = sorted([build_folder for build_folder in get_build_folders(self.croot) +- if package_name in build_folder]) ++ if package_name + "_" in build_folder]) + + if self.dirty and build_folders: + # Use the most recent build with matching recipe name diff --git a/patches/conda_build_2.1.1_substr_fix_py3.patch b/patches/conda_build_2.1.1_substr_fix_py3.patch new file mode 100644 index 0000000..88fbaf4 --- /dev/null +++ b/patches/conda_build_2.1.1_substr_fix_py3.patch @@ -0,0 +1,11 @@ +--- config.py.ORIG 2017-04-18 08:08:06.000000000 -0400 ++++ config.py 2017-04-18 08:08:20.000000000 -0400 +@@ -327,7 +327,7 @@ + assert not os.path.isabs(package_name), ("package name should not be a absolute path, " + "to preserve croot during path joins") + build_folders = sorted([build_folder for build_folder in get_build_folders(self.croot) +- if package_name in build_folder]) ++ if package_name + "_" in build_folder]) + + if self.dirty and build_folders: + # Use the most recent build with matching recipe name |