From 5da9fa322bf2259d8bb8c61188c696a0d5e7274d Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 08:27:53 -0400 Subject: Update test.yaml --- manifests/test.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/manifests/test.yaml b/manifests/test.yaml index bc84973..0c626c2 100644 --- a/manifests/test.yaml +++ b/manifests/test.yaml @@ -2,8 +2,10 @@ repository: 'https://github.com/astroconda/astroconda-contrib' channel_URL: 'http://ssb.stsci.edu/astroconda' numpy_version: 1.13 packages: - - mosviz - - specutils - - glueviz - - glue-vispy-viewers - - glue-core + - costools + - crds +# - mosviz +# - specutils +# - glueviz +# - glue-vispy-viewers +# - glue-core -- cgit From 75e46b8b4352421511776a3556b3aba34b069713 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 09:46:13 -0400 Subject: New stage and value passing --- jenkins/dispatch.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 7dd09e0..e4da6ba 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -231,5 +231,9 @@ node(LABEL) { tmp_status = tmp_status.trim() currentBuild.result = tmp_status } + + stage ("Publication") { + println("PUBLICATION_PATH: ${PUBLICATION_PATH}") + } } -- cgit From 000cf487a12b574d3c80c305bd81f8748cce22d3 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 09:51:28 -0400 Subject: Inject env var for use downstream --- jenkins/generator_DSL.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index f74275c..b48339a 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -47,6 +47,7 @@ pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { "CONDA_BUILD_VERSION: ${conda_build_version}\n" + "CONDA_BASE_URL: ${conda_base_URL}\n" + "UTILS_REPO: ${utils_repo}\n") + "PUBLICATION_PATH: ${publication_path}\n") environmentVariables { env("JOB_DEF_GENERATION_TIME", job_def_generation_time) env("SCRIPT", this.script) @@ -59,6 +60,7 @@ pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { env("CONDA_BUILD_VERSION", conda_build_version) env("CONDA_BASE_URL", conda_base_URL) env("UTILS_REPO", utils_repo) + env("PUBLICATION_PATH", publication_path) } definition { cps { -- cgit From dbdeefad893b1a898d3a0ed630fd1340ca2d7240 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 09:53:48 -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 b48339a..d875444 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -46,7 +46,7 @@ pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { "CONDA_VERSION: ${conda_version}\n" + "CONDA_BUILD_VERSION: ${conda_build_version}\n" + "CONDA_BASE_URL: ${conda_base_URL}\n" + - "UTILS_REPO: ${utils_repo}\n") + "UTILS_REPO: ${utils_repo}\n" + "PUBLICATION_PATH: ${publication_path}\n") environmentVariables { env("JOB_DEF_GENERATION_TIME", job_def_generation_time) -- cgit From faa8382333c1323c2099893c4ce912c3b283d8d6 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 10:37:17 -0400 Subject: File create test --- jenkins/dispatch.groovy | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index e4da6ba..338007b 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -23,6 +23,9 @@ this.conda_installers = ["Linux-py2.7":"Miniconda2-${CONDA_VERSION}-Linux-x86_6 "MacOSX-py2.7":"Miniconda2-${CONDA_VERSION}-MacOSX-x86_64.sh", "MacOSX-py3.5":"Miniconda3-${CONDA_VERSION}-MacOSX-x86_64.sh"] +// Conda paths +this.conda_install_dir = "${env.WORKSPACE}/miniconda" + node(LABEL) { this.OSname = null @@ -44,6 +47,8 @@ node(LABEL) { } assert uname != null + this.conda_build_output_dir = "${this.conda_install_dir}/conda-bld/${this.CONDA_PLATFORM}" + env.PYTHONPATH = "" // Make the log files a bit more deterministic env.PYTHONUNBUFFERED = "true" @@ -157,8 +162,8 @@ node(LABEL) { sh dl_cmd // Install specific versions of miniconda and conda-build - sh "bash ./${conda_installer} -b -p miniconda" - env.PATH = "${env.WORKSPACE}/miniconda/bin:${env.PATH}" + sh "bash ./${conda_installer} -b -p ${this.conda_install_dir}" + env.PATH = "${this.conda_install_dir}/bin:${env.PATH}" def cpkgs = "conda=${CONDA_VERSION} conda-build=${CONDA_BUILD_VERSION}" sh "conda install --quiet --yes ${cpkgs} python=${PY_VERSION}" @@ -167,7 +172,7 @@ node(LABEL) { def conda_build_maj_ver = conda_build_version.tokenize()[1].tokenize('.')[0] if (conda_build_maj_ver == "2") { println("conda-build major version ${conda_build_maj_ver} detected. Applying bugfix patch.") - def filename = "${env.WORKSPACE}/miniconda/lib/python${PY_VERSION}/" + + def filename = "${this.conda_install_dir}/lib/python${PY_VERSION}/" + "site-packages/conda_build/config.py" def patches_dir = "${env.WORKSPACE}/patches" def patchname = "conda_build_2.1.1_substr_fix_py${this.py_maj_version}.patch" @@ -233,7 +238,17 @@ node(LABEL) { } stage ("Publication") { - println("PUBLICATION_PATH: ${PUBLICATION_PATH}") + //sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}") + // Use a lock file to prevent two dispatch jobs that finish at the same + // time from trampling each other's indexing process. + PrintWriter writer = null + f = new File("${PUBLICATION_PATH}/LOCK-Jenkins") + writer = new PrintWriter(f) + writer.println("Lock file output") + writer.close() + //dir(this.conda_build_output_dir) { + // sh(script: "conda index") + //} } } -- cgit From 1a8304e996f00c42b022b35ac8f44d57c2882e9b Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 10:45:44 -0400 Subject: Put vars in correct scope --- jenkins/dispatch.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 338007b..bee97e3 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -23,8 +23,6 @@ this.conda_installers = ["Linux-py2.7":"Miniconda2-${CONDA_VERSION}-Linux-x86_6 "MacOSX-py2.7":"Miniconda2-${CONDA_VERSION}-MacOSX-x86_64.sh", "MacOSX-py3.5":"Miniconda3-${CONDA_VERSION}-MacOSX-x86_64.sh"] -// Conda paths -this.conda_install_dir = "${env.WORKSPACE}/miniconda" node(LABEL) { @@ -47,6 +45,8 @@ node(LABEL) { } assert uname != null + // Conda paths + this.conda_install_dir = "${env.WORKSPACE}/miniconda" this.conda_build_output_dir = "${this.conda_install_dir}/conda-bld/${this.CONDA_PLATFORM}" env.PYTHONPATH = "" -- cgit From 9fa3d59a0c17adb715ea42c294cd3cee0982bb32 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 10:59:01 -0400 Subject: Sort environment dumps --- jenkins/dispatch.groovy | 2 +- jenkins/package_builder.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index bee97e3..c7a263c 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -53,7 +53,7 @@ node(LABEL) { // Make the log files a bit more deterministic env.PYTHONUNBUFFERED = "true" - sh "printenv" + sh "env | sort" // Delete any existing job workspace directory contents. // The directory deleted is the one named after the jenkins pipeline job. diff --git a/jenkins/package_builder.groovy b/jenkins/package_builder.groovy index 8ddbe9f..436b4b2 100644 --- a/jenkins/package_builder.groovy +++ b/jenkins/package_builder.groovy @@ -10,7 +10,7 @@ node(this.label) { env.PYTHONUNBUFFERED = "true" def time = new Date() - sh "printenv" + sh "env | sort" println("\n" + " Package Build Info Summary:\n" + -- cgit From 5e1ca1b50d6dda10ac9af4b3f3102e3d62888bf8 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 11:02:41 -0400 Subject: Different file creation approach --- jenkins/dispatch.groovy | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index c7a263c..05ff914 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -241,11 +241,13 @@ node(LABEL) { //sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. - PrintWriter writer = null - f = new File("${PUBLICATION_PATH}/LOCK-Jenkins") - writer = new PrintWriter(f) - writer.println("Lock file output") - writer.close() + sh(script: "touch ${PUBLICATION_PATH}/LOCK-Jenkins") + //PrintWriter writer = null + //f = new File("${PUBLICATION_PATH}/LOCK-Jenkins") + ////f = new File("${PUBLICATION_PATH}/${this.CONDA_PLATFORM}/LOCK-Jenkins") + //writer = new PrintWriter(f) + //writer.println("Lock file output") + //writer.close() //dir(this.conda_build_output_dir) { // sh(script: "conda index") //} -- cgit From 187fe2e8627fbdcebe585b5c3b07f3b9480e3287 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 11:19:08 -0400 Subject: Lockfile test --- jenkins/dispatch.groovy | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 05ff914..03cdad6 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -241,13 +241,11 @@ node(LABEL) { //sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. - sh(script: "touch ${PUBLICATION_PATH}/LOCK-Jenkins") - //PrintWriter writer = null - //f = new File("${PUBLICATION_PATH}/LOCK-Jenkins") - ////f = new File("${PUBLICATION_PATH}/${this.CONDA_PLATFORM}/LOCK-Jenkins") - //writer = new PrintWriter(f) - //writer.println("Lock file output") - //writer.close() + def lockfile = "${PUBLICATION_PATH}/${this.CONDA_PLATFORM}/LOCK-Jenkins" + def file = new File(lockfile) + if ( !file.exists() ) { + sh(script: "touch ${lockfile}") + } //dir(this.conda_build_output_dir) { // sh(script: "conda index") //} -- cgit From 33f49bedd2c9087a7ec2f7204f5baf6c280bbdc7 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 11:49:40 -0400 Subject: Lockfile testing --- jenkins/dispatch.groovy | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 03cdad6..c2c1c95 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -238,17 +238,31 @@ node(LABEL) { } stage ("Publication") { - //sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}") + // Copy packages built during this session to the publication path. + sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. - def lockfile = "${PUBLICATION_PATH}/${this.CONDA_PLATFORM}/LOCK-Jenkins" + def lockfile = "${this.conda_build_output_dir}/LOCK-Jenkins" def file = new File(lockfile) - if ( !file.exists() ) { + def tries_remaining = 5 + if ( file.exists() ) { + println("Lockfile already exists, waiting for it to be released...") + while ( tries_remaining > 0) { + println("Waiting 3s for lockfile release...") + sleep(3000) + if ( !file.exists() ) { + break + } + tries_remaining-- + } + } + if ( tries_remaining != 0 ) { sh(script: "touch ${lockfile}") + dir(this.conda_build_output_dir) { + sh(script: "conda index") + } + sh(script: "rm -f ${lockfile}") } - //dir(this.conda_build_output_dir) { - // sh(script: "conda index") - //} } } -- cgit From a2af62db7567b6a27e890c0bc18aa47dab0ec68c Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 13:36:21 -0400 Subject: Adjust final publication path --- jenkins/dispatch.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index c2c1c95..a79ad51 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -239,7 +239,7 @@ node(LABEL) { stage ("Publication") { // Copy packages built during this session to the publication path. - sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}") + sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}/${this.CONDA_PLATFORM}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. def lockfile = "${this.conda_build_output_dir}/LOCK-Jenkins" -- cgit From af12a963ce3c0358b5465b624b9dbb2681c8572b Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 13:56:33 -0400 Subject: Compose publication path and run index there --- jenkins/dispatch.groovy | 5 +++-- jenkins/generator_DSL.groovy | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index a79ad51..8393cd8 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -239,7 +239,8 @@ node(LABEL) { stage ("Publication") { // Copy packages built during this session to the publication path. - sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${PUBLICATION_PATH}/${this.CONDA_PLATFORM}") + def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" + sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. def lockfile = "${this.conda_build_output_dir}/LOCK-Jenkins" @@ -259,7 +260,7 @@ node(LABEL) { if ( tries_remaining != 0 ) { sh(script: "touch ${lockfile}") dir(this.conda_build_output_dir) { - sh(script: "conda index") + sh(script: "conda index ${publication_path}") } sh(script: "rm -f ${lockfile}") } diff --git a/jenkins/generator_DSL.groovy b/jenkins/generator_DSL.groovy index d875444..f05c46c 100644 --- a/jenkins/generator_DSL.groovy +++ b/jenkins/generator_DSL.groovy @@ -47,7 +47,7 @@ pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { "CONDA_BUILD_VERSION: ${conda_build_version}\n" + "CONDA_BASE_URL: ${conda_base_URL}\n" + "UTILS_REPO: ${utils_repo}\n" + - "PUBLICATION_PATH: ${publication_path}\n") + "PUBLICATION_ROOT: ${publication_root}\n") environmentVariables { env("JOB_DEF_GENERATION_TIME", job_def_generation_time) env("SCRIPT", this.script) @@ -60,7 +60,7 @@ pipelineJob("${suite_name}/_${script.tokenize(".")[0]}") { env("CONDA_BUILD_VERSION", conda_build_version) env("CONDA_BASE_URL", conda_base_URL) env("UTILS_REPO", utils_repo) - env("PUBLICATION_PATH", publication_path) + env("PUBLICATION_ROOT", publication_root) } definition { cps { -- cgit From ca7dfb1a205af0944c9f9742edae90a00a3813d8 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 14:40:20 -0400 Subject: Capture shell shell call output to investigate failure reporting --- jenkins/dispatch.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 8393cd8..6545777 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -240,7 +240,7 @@ node(LABEL) { stage ("Publication") { // Copy packages built during this session to the publication path. def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" - sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") + def rsync_status = sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. def lockfile = "${this.conda_build_output_dir}/LOCK-Jenkins" @@ -258,11 +258,11 @@ node(LABEL) { } } if ( tries_remaining != 0 ) { - sh(script: "touch ${lockfile}") + def lockfile_status = sh(script: "touch ${lockfile}") dir(this.conda_build_output_dir) { - sh(script: "conda index ${publication_path}") + def index_status = sh(script: "conda index ${publication_path}") } - sh(script: "rm -f ${lockfile}") + def lockfile_status = sh(script: "rm -f ${lockfile}") } } } -- cgit From e0fab8ba9a3b73e37f2036cdc697eec66720f10c Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 14:41:26 -0400 Subject: typo fix --- jenkins/dispatch.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 6545777..1a3bc13 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -262,7 +262,7 @@ node(LABEL) { dir(this.conda_build_output_dir) { def index_status = sh(script: "conda index ${publication_path}") } - def lockfile_status = sh(script: "rm -f ${lockfile}") + lockfile_status = sh(script: "rm -f ${lockfile}") } } } -- cgit From f24f72cff0e9b8cf3d8a38ed1e702f814bfde27d Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 14:49:27 -0400 Subject: Correct lockfile path, turn off status capture --- jenkins/dispatch.groovy | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 1a3bc13..67b07b4 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -240,10 +240,11 @@ node(LABEL) { stage ("Publication") { // Copy packages built during this session to the publication path. def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" - def rsync_status = sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") + //def rsync_status = sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") + sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. - def lockfile = "${this.conda_build_output_dir}/LOCK-Jenkins" + def lockfile = "${publication_path}/LOCK-Jenkins" def file = new File(lockfile) def tries_remaining = 5 if ( file.exists() ) { @@ -258,11 +259,14 @@ node(LABEL) { } } if ( tries_remaining != 0 ) { - def lockfile_status = sh(script: "touch ${lockfile}") + //def lockfile_status = sh(script: "touch ${lockfile}") + sh(script: "touch ${lockfile}") dir(this.conda_build_output_dir) { - def index_status = sh(script: "conda index ${publication_path}") + //def index_status = sh(script: "conda index ${publication_path}") + sh(script: "conda index ${publication_path}") } - lockfile_status = sh(script: "rm -f ${lockfile}") + //lockfile_status = sh(script: "rm -f ${lockfile}") + sh(script: "rm -f ${lockfile}") } } } -- cgit From 30db90c7f98f35ef494122e38ca53aca1d89db51 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 14:55:16 -0400 Subject: Turn on status capture again. --- jenkins/dispatch.groovy | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 67b07b4..389ecd3 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -240,8 +240,7 @@ node(LABEL) { stage ("Publication") { // Copy packages built during this session to the publication path. def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" - //def rsync_status = sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") - sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") + def rsync_status = sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. def lockfile = "${publication_path}/LOCK-Jenkins" @@ -259,14 +258,11 @@ node(LABEL) { } } if ( tries_remaining != 0 ) { - //def lockfile_status = sh(script: "touch ${lockfile}") - sh(script: "touch ${lockfile}") + def lockfile_status = sh(script: "touch ${lockfile}") dir(this.conda_build_output_dir) { - //def index_status = sh(script: "conda index ${publication_path}") - sh(script: "conda index ${publication_path}") + def index_status = sh(script: "conda index ${publication_path}") } - //lockfile_status = sh(script: "rm -f ${lockfile}") - sh(script: "rm -f ${lockfile}") + lockfile_status = sh(script: "rm -f ${lockfile}") } } } -- cgit From 1b6fdc3dbb3f5f81424e14790a31c33e0bb0794f Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 15:21:15 -0400 Subject: Selective publish stage based on overall build status --- jenkins/dispatch.groovy | 51 ++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 389ecd3..38ef533 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -237,33 +237,36 @@ node(LABEL) { currentBuild.result = tmp_status } - stage ("Publication") { - // Copy packages built during this session to the publication path. - def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" - def rsync_status = sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") - // Use a lock file to prevent two dispatch jobs that finish at the same - // time from trampling each other's indexing process. - def lockfile = "${publication_path}/LOCK-Jenkins" - def file = new File(lockfile) - def tries_remaining = 5 - if ( file.exists() ) { - println("Lockfile already exists, waiting for it to be released...") - while ( tries_remaining > 0) { - println("Waiting 3s for lockfile release...") - sleep(3000) - if ( !file.exists() ) { - break + // Only run Publish stage if there were no package build falures. + if (currentBuild.result != "FAILURE") { + stage ("Publish") { + // Copy packages built during this session to the publication path. + def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" + sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") + // Use a lock file to prevent two dispatch jobs that finish at the same + // time from trampling each other's indexing process. + def lockfile = "${publication_path}/LOCK-Jenkins" + def file = new File(lockfile) + def tries_remaining = 5 + if (file.exists()) { + println("Lockfile already exists, waiting for it to be released...") + while ( tries_remaining > 0) { + println("Waiting 3s for lockfile release...") + sleep(3000) + if ( !file.exists() ) { + break + } + tries_remaining-- } - tries_remaining-- } - } - if ( tries_remaining != 0 ) { - def lockfile_status = sh(script: "touch ${lockfile}") - dir(this.conda_build_output_dir) { - def index_status = sh(script: "conda index ${publication_path}") + if (tries_remaining != 0) { + sh(script: "touch ${lockfile}") + dir(this.conda_build_output_dir) { + sh(script: "conda index ${publication_path}") + } + sh(script: "rm -f ${lockfile}") } - lockfile_status = sh(script: "rm -f ${lockfile}") - } + } } } -- cgit From ef61f49cbabb7895127830df2ba3ff688fd864fd Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 3 Aug 2017 15:35:18 -0400 Subject: Update test.yaml --- manifests/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/test.yaml b/manifests/test.yaml index 0c626c2..0f3b5df 100644 --- a/manifests/test.yaml +++ b/manifests/test.yaml @@ -3,7 +3,7 @@ channel_URL: 'http://ssb.stsci.edu/astroconda' numpy_version: 1.13 packages: - costools - - crds +# - crds # - mosviz # - specutils # - glueviz -- cgit From 07b37f89a661550a4cb192876c82449097a1ab77 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Tue, 8 Aug 2017 21:35:41 -0400 Subject: Update test.yaml --- manifests/test.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manifests/test.yaml b/manifests/test.yaml index 0f3b5df..7e8d51a 100644 --- a/manifests/test.yaml +++ b/manifests/test.yaml @@ -2,8 +2,14 @@ repository: 'https://github.com/astroconda/astroconda-contrib' channel_URL: 'http://ssb.stsci.edu/astroconda' numpy_version: 1.13 packages: - - costools -# - crds +# - costools + - crds + - cube-tools + - sphinxcontrib-programoutput + - pyds9 + - wcstools + - webbpsf + # - mosviz # - specutils # - glueviz -- cgit From 470d9eb5b97badfe8fafe915fd61ea9e345f90b5 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 13:10:36 -0400 Subject: Create dev-test.yaml --- manifests/dev-test.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 manifests/dev-test.yaml diff --git a/manifests/dev-test.yaml b/manifests/dev-test.yaml new file mode 100644 index 0000000..6bdf084 --- /dev/null +++ b/manifests/dev-test.yaml @@ -0,0 +1,15 @@ +repository: 'https://github.com/astroconda/astroconda-dev' +channel_URL: 'http://ssb.stsci.edu/astroconda-dev' +numpy_version: 1.13 +packages: + - crds + - cube-tools + - sphinxcontrib-programoutput + - pyds9 + - wcstools + - webbpsf +# - mosviz +# - specutils +# - glueviz +# - glue-vispy-viewers +# - glue-core -- cgit From f7a63456b20cf23f850bc362509d7f6025d47fc0 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 15:14:06 -0400 Subject: Update test.yaml --- manifests/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/test.yaml b/manifests/test.yaml index 7e8d51a..40d2aff 100644 --- a/manifests/test.yaml +++ b/manifests/test.yaml @@ -2,7 +2,9 @@ repository: 'https://github.com/astroconda/astroconda-contrib' channel_URL: 'http://ssb.stsci.edu/astroconda' numpy_version: 1.13 packages: -# - costools + - costools + - cfitsio + - ds9 - crds - cube-tools - sphinxcontrib-programoutput -- cgit From 9b5f25eb83fcee3017792bd47982b4d4da975baa Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 15:17:25 -0400 Subject: Update test.yaml --- manifests/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/test.yaml b/manifests/test.yaml index 40d2aff..41aa167 100644 --- a/manifests/test.yaml +++ b/manifests/test.yaml @@ -1,5 +1,5 @@ -repository: 'https://github.com/astroconda/astroconda-contrib' -channel_URL: 'http://ssb.stsci.edu/astroconda' +repository: 'https://github.com/astroconda/astroconda-dev' +channel_URL: 'http://ssb.stsci.edu/astroconda-dev' numpy_version: 1.13 packages: - costools -- cgit From 13d68a9d919e8852a5c847496a82256bf48ab6bd Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 15:50:53 -0400 Subject: Remove conditional publication to allow for partial builds to produce something valuable --- jenkins/dispatch.groovy | 61 ++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 38ef533..03383d2 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -23,6 +23,9 @@ this.conda_installers = ["Linux-py2.7":"Miniconda2-${CONDA_VERSION}-Linux-x86_6 "MacOSX-py2.7":"Miniconda2-${CONDA_VERSION}-MacOSX-x86_64.sh", "MacOSX-py3.5":"Miniconda3-${CONDA_VERSION}-MacOSX-x86_64.sh"] +// Values controlling the conda index stage which happens after any packages are created. +this.max_publication_tries = 5 +this.publication_lock_wait_s = 10 node(LABEL) { @@ -237,35 +240,35 @@ node(LABEL) { currentBuild.result = tmp_status } - // Only run Publish stage if there were no package build falures. - if (currentBuild.result != "FAILURE") { - stage ("Publish") { - // Copy packages built during this session to the publication path. - def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" - sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") - // Use a lock file to prevent two dispatch jobs that finish at the same - // time from trampling each other's indexing process. - def lockfile = "${publication_path}/LOCK-Jenkins" - def file = new File(lockfile) - def tries_remaining = 5 - if (file.exists()) { - println("Lockfile already exists, waiting for it to be released...") - while ( tries_remaining > 0) { - println("Waiting 3s for lockfile release...") - sleep(3000) - if ( !file.exists() ) { - break - } - tries_remaining-- - } - } - if (tries_remaining != 0) { - sh(script: "touch ${lockfile}") - dir(this.conda_build_output_dir) { - sh(script: "conda index ${publication_path}") - } - sh(script: "rm -f ${lockfile}") - } + stage ("Publish") { + def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" + def artifacts_present = sh(script: "ls ${publication_path}/*.tar.bz2 >/dev/null 2>&1") + // Copy and index packages if any were produced in the build. + if (artifacts_present == "0") { + sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") + // Use a lock file to prevent two dispatch jobs that finish at the same + // time from trampling each other's indexing process. + def lockfile = "${publication_path}/LOCK-Jenkins" + def file = new File(lockfile) + def tries_remaining = this.max_publication_tries + if (file.exists()) { + println("Lockfile already exists, waiting for it to be released...") + while ( tries_remaining > 0) { + println("Waiting ${this.publication_lock_wait_s}s for lockfile release...") + sleep(this.publication_lock_wait_s * 1000) + if ( !file.exists() ) { + break + } + tries_remaining-- + } + } + if (tries_remaining != 0) { + sh(script: "touch ${lockfile}") + dir(this.conda_build_output_dir) { + sh(script: "conda index ${publication_path}") + } + sh(script: "rm -f ${lockfile}") + } } } } -- cgit From 983fa191385e27fc6bdce85bb6af54796e913800 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 16:19:27 -0400 Subject: Path fix and diagnostic output --- jenkins/dispatch.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index 03383d2..f610fed 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -242,8 +242,9 @@ node(LABEL) { stage ("Publish") { def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" - def artifacts_present = sh(script: "ls ${publication_path}/*.tar.bz2 >/dev/null 2>&1") // Copy and index packages if any were produced in the build. + def artifacts_present = sh(script: "ls ${this.conda_build_output_dir}/*.tar.bz2 >/dev/null 2>&1") + println("artifacts_present: ${artifacts_present}") if (artifacts_present == "0") { sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same -- cgit From b18819c26d00d451b33dbd3b0ebab50276ef516d Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 16:56:44 -0400 Subject: Capture return code --- jenkins/dispatch.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index f610fed..c710597 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -243,8 +243,9 @@ node(LABEL) { stage ("Publish") { def publication_path = "${PUBLICATION_ROOT}/${this.CONDA_PLATFORM}" // Copy and index packages if any were produced in the build. - def artifacts_present = sh(script: "ls ${this.conda_build_output_dir}/*.tar.bz2 >/dev/null 2>&1") - println("artifacts_present: ${artifacts_present}") + def artifacts_present = + sh(script: "ls ${this.conda_build_output_dir}/*.tar.bz2 >/dev/null 2>&1", + returnStatus: true) if (artifacts_present == "0") { sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same -- cgit From 754542ec671a682744f916cabee775379724d990 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 17:43:02 -0400 Subject: Status diagnostic and reduced test manifest --- jenkins/dispatch.groovy | 1 + manifests/test.yaml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index c710597..bde59dc 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -246,6 +246,7 @@ node(LABEL) { def artifacts_present = sh(script: "ls ${this.conda_build_output_dir}/*.tar.bz2 >/dev/null 2>&1", returnStatus: true) + println("artifacts present = ${artifacts_present}") if (artifacts_present == "0") { sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same diff --git a/manifests/test.yaml b/manifests/test.yaml index 41aa167..4d6806e 100644 --- a/manifests/test.yaml +++ b/manifests/test.yaml @@ -4,14 +4,14 @@ numpy_version: 1.13 packages: - costools - cfitsio - - ds9 - - crds - - cube-tools - - sphinxcontrib-programoutput - - pyds9 - - wcstools - - webbpsf - +# - ds9 +# - crds +# - cube-tools +# - sphinxcontrib-programoutput +# - pyds9 +# - wcstools +# - webbpsf +# # - mosviz # - specutils # - glueviz -- cgit From b708fbf728a3a1b28c5bedbb6edc8a4b2289dbad Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 9 Aug 2017 17:52:53 -0400 Subject: Change type of return code comparison value --- jenkins/dispatch.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index bde59dc..551bad4 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -247,7 +247,7 @@ node(LABEL) { sh(script: "ls ${this.conda_build_output_dir}/*.tar.bz2 >/dev/null 2>&1", returnStatus: true) println("artifacts present = ${artifacts_present}") - if (artifacts_present == "0") { + if (artifacts_present == 0) { sh(script: "rsync -avzr ${this.conda_build_output_dir}/*.tar.bz2 ${publication_path}") // Use a lock file to prevent two dispatch jobs that finish at the same // time from trampling each other's indexing process. -- cgit