From 381a80754b25109345a7a1342d3399f1f6ac3520 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Dec 2024 12:25:59 -0500 Subject: [PATCH 1/4] adds git fetch --tags --- jenkins/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index f8c568bb..c127952f 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -88,6 +88,8 @@ pipeline { steps { sh 'python3.11 -m venv --system-site-packages $HOME' sh '''#!/bin/bash -ex + # make sure we have the git tags, since we need that to correctly version plenoptic + git fetch --tags source $HOME/bin/activate pip install -U pip pip install .[docs] From 838626c481020ee8a0841f687a8bbe349baa014b Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Tue, 10 Dec 2024 16:01:44 -0500 Subject: [PATCH 2/4] move built docs to new location --- jenkins/Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index c127952f..dc166f7e 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -98,6 +98,8 @@ pipeline { echo \$(ls \$HOME) echo \$(ls \$HOME/docs) echo \$(ls \$HOME/docs/_build) + mv docs/_build/ $HOME/build/ + echo \$(ls \$HOME/build) ''' lock('plenoptic_docs_publish') { script { @@ -118,9 +120,9 @@ pipeline { mkdir -p \$DOCS_DIR echo \$(ls \$HOME) echo \$(ls \$HOME/docs) - echo \$(ls \$HOME/docs/_build) + echo \$(ls \$HOME/build) echo \$(ls \$DOCS_DIR) - cp -rp \$HOME/docs/_build/html/* \$DOCS_DIR + cp -rp \$HOME/build/html/* \$DOCS_DIR # using -f here makes sure we add the index.html files, which are included in workshops .gitignore (since some are auto-generated) git add -A -f --verbose docs/\$PROJECT_NAME GIT_COMMITTER_EMAIL="jenkins@flatironinstitute.org" GIT_COMMITTER_NAME="Flatiron Jenkins" git commit --author='Flatiron Jenkins ' --allow-empty -m "Generated documentation for \$DOCS_DIR" -m '${env.BUILD_TAG}' From d4ac27813b24127a4c49a5d0361a8ca4b9bc1493 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Wed, 11 Dec 2024 09:53:23 -0500 Subject: [PATCH 3/4] set seed in validate metric nonneg because otherwise it occasionallyf ails --- tests/test_tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_tools.py b/tests/test_tools.py index 04ee49f5..b114d01d 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -555,6 +555,8 @@ def mean_metric(x, y): po.tools.validate.validate_metric(mean_metric, device=DEVICE) def test_validate_metric_nonnegative(self): + po.tools.set_seed(0) + def sum_metric(x, y): return (x - y).sum() From 0f9ff9fc0a2619f1c6311a8b827aebb6236e506c Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Wed, 11 Dec 2024 09:55:03 -0500 Subject: [PATCH 4/4] change name of target dir --- jenkins/Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index dc166f7e..3076346a 100644 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -98,8 +98,8 @@ pipeline { echo \$(ls \$HOME) echo \$(ls \$HOME/docs) echo \$(ls \$HOME/docs/_build) - mv docs/_build/ $HOME/build/ - echo \$(ls \$HOME/build) + mv docs/_build/ $HOME/built-docs/ + echo \$(ls \$HOME/built-docs) ''' lock('plenoptic_docs_publish') { script { @@ -120,9 +120,9 @@ pipeline { mkdir -p \$DOCS_DIR echo \$(ls \$HOME) echo \$(ls \$HOME/docs) - echo \$(ls \$HOME/build) + echo \$(ls \$HOME/built-docs) echo \$(ls \$DOCS_DIR) - cp -rp \$HOME/build/html/* \$DOCS_DIR + cp -rp \$HOME/built-docs/html/* \$DOCS_DIR # using -f here makes sure we add the index.html files, which are included in workshops .gitignore (since some are auto-generated) git add -A -f --verbose docs/\$PROJECT_NAME GIT_COMMITTER_EMAIL="jenkins@flatironinstitute.org" GIT_COMMITTER_NAME="Flatiron Jenkins" git commit --author='Flatiron Jenkins ' --allow-empty -m "Generated documentation for \$DOCS_DIR" -m '${env.BUILD_TAG}'