Skip to content

Commit

Permalink
Add branch name to jenkins conda env (#128)
Browse files Browse the repository at this point in the history
* Add branch name to jenkins conda env

* Update CHANGELOG.rst

* Update Jenkinsfile

* add matrix nodes

* Update Jenkinsfile

* add missing bracket
  • Loading branch information
patricktnast authored Dec 24, 2024
1 parent 6946b55 commit 0d83c0f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ def githubUsernameToSlackName(github_author) {
}

pipeline_name="easylink"
conda_env_name="${pipeline_name}-${BUILD_NUMBER}"
conda_env_name="${pipeline_name}-${BRANCH_NAME}-${BUILD_NUMBER}"
// using /tmp for things is MUCH faster but not shared between nodes.
shared_filesystem_path="/mnt/team/simulation_science/priv/engineering/tests"
conda_env_path="${shared_filesystem_path}/venv/${conda_env_name}"
// defaults for conda and pip are a local directory /svc-simsci for improved speed.
// In the past, we used /ihme/code/* on the NFS (which is slower)
shared_jenkins_node_path="/svc-simsci"
// comma separated string list of branches to run periodic builds on
scheduled_branches = "main"
CRON_SETTINGS = scheduled_branches.split(',').collect{it.trim()}.contains(BRANCH_NAME) ? 'H H(20-23) * * *' : ''

pipeline {
// This agent runs as svc-simsci on node simsci-slurm-sbuild-p01.
// This agent runs as svc-simsci on node simsci-ci-coordinator-01.
// It has access to standard IHME filesystems and singularity
agent { label "svc-simsci" }
agent { label "coordinator" }

options {
// Keep 100 old builds.
Expand All @@ -43,7 +46,9 @@ pipeline {
description: "The Slack channel to send messages to."
)
}

triggers {
cron(CRON_SETTINGS)
}
stages {
stage("Initialization") {
steps {
Expand All @@ -63,7 +68,8 @@ pipeline {
// customWorkspace setting must be ran within a node
agent {
node {
label "svc-simsci"
// Run child tasks on slurm jenkins node.
label "slurm"
}
}
axes {
Expand Down Expand Up @@ -155,7 +161,7 @@ pipeline {
}

// TODO: Add a typecheck stage

}
} // End of quality checks

stage("Test and Build Docs") {
Expand Down Expand Up @@ -265,4 +271,4 @@ pipeline {
}
}
}
} // End of pipeline
} // End of pipeline

0 comments on commit 0d83c0f

Please sign in to comment.