diff options
author | Matt Rendina <mrendina@stsci.edu> | 2018-01-05 13:33:52 -0500 |
---|---|---|
committer | Matt Rendina <mrendina@stsci.edu> | 2018-01-05 13:33:52 -0500 |
commit | 6806ffa9329b309c15488c795784ae4687f1a482 (patch) | |
tree | 73eb034762f0b4214a1d4265aa469faeec39f6cf | |
parent | c0424e6e7befc05b33cd0e313bcca2efae1b8863 (diff) | |
download | build_control-6806ffa9329b309c15488c795784ae4687f1a482.tar.gz |
Allow for JWST specfile generation
-rw-r--r-- | jenkins/dispatch.groovy | 46 | ||||
-rw-r--r-- | manifests/jwst.yaml | 12 | ||||
-rw-r--r-- | manifests/public.yaml | 1 |
3 files changed, 57 insertions, 2 deletions
diff --git a/jenkins/dispatch.groovy b/jenkins/dispatch.groovy index a79635e..e45b236 100644 --- a/jenkins/dispatch.groovy +++ b/jenkins/dispatch.groovy @@ -267,7 +267,7 @@ node(LABEL) { // Generate a filtered, optionally culled, & dependency-ordered list // of available package recipes. def culled_option = "" - if (this.cull_manifest) { + if (this.cull_manifest == "true") { culled_option = "--culled" } def build_list_file = "build_list" @@ -356,6 +356,50 @@ node(LABEL) { } } + // If spec file generation was requested at trigger time, generate one. + // Create a conda environment containing all packages specified in the manifest. + specfile_type = "" + try { + specfile_type = this.manifest.specfile_type + } catch(all) { + println("specfile_type not found in manifest. Not creating spec file.") + } + + specfile_output = "" + try { + specfile_output = this.manifest.specfile_output + } catch(all) { + println("specfile_output not found in manifest. Not creating spec file.") + // prepare to skip specfile_creation + specfile_type = "NONE" + } + + if (specfile_type == "jwstdp") { + stage("Create spec file") { + // If an 'ASCO_GIT_REV_jwst' has been defined, use it to crate the spec file name + // otherwise, just use the latest package and leave out the version from the spec + // file name. + package_name = "jwst" + jwst_git_rev = sh(script: "echo \$ASCO_GIT_REV_jwst", returnStdout: true).trim() + if (jwst_git_rev != "") { + package_name = "${package_name}=${jwst_git_rev}.dev0" + } else { + jwst_git_rev = new Date().format("yyyyMMdd:HHmm") + } + cmd = "conda create -n spec -q -y -c ${this.manifest.channel_URL} -c defaults python=${PY_VERSION} ${package_name}" + sh(script: cmd) + + short_plat = CONDA_PLATFORM.tokenize("-")[0] + //short_py_ver = PY_VERSION.replaceAll(".", "") + short_py_ver = "${PY_VERSION[0]}${PY_VERSION[2]}" + specfile_name = "${specfile_type}-${jwst_git_rev}-${short_plat}-py${short_py_ver}.00.txt" + //outdir = "/eng/ssb/websites/ssbpublic/astroconda-releases-staging" + outdir = specfile_output + outfile = "${outdir}/${specfile_name}" + sh(script: "conda list -n spec --explicit > ${outfile}") + } + } + stage ("Cleanup") { // Clean up the workspace to conserve disk space. Conda installations // especially consume a fair amount. diff --git a/manifests/jwst.yaml b/manifests/jwst.yaml index adf14c5..f5ecee5 100644 --- a/manifests/jwst.yaml +++ b/manifests/jwst.yaml @@ -6,6 +6,16 @@ git_ref_spec: 'jwst_parameterized_rev' 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-j-dev-testing' +publication_root: '/eng/ssb/websites/ssbpublic/astroconda-dev' + +# conda environment spec file generation is only performed if this field +# is populated. Allowed values are: +# 'jwstdp' - JWST Data processing release +# 'hstdp' - HST Data processing release +specfile_type: 'jwstdp' + +# Output location for produced environment spec files +specfile_output: '/eng/ssb/websites/ssbpublic/astroconda-releases-staging' + packages: - jwst diff --git a/manifests/public.yaml b/manifests/public.yaml index 151bd5a..fc73036 100644 --- a/manifests/public.yaml +++ b/manifests/public.yaml @@ -15,6 +15,7 @@ packages: - asdf-standard - astroimtools - astroquery + - asteval - asv - calcos - cfitsio |