-
Notifications
You must be signed in to change notification settings - Fork 23
Add Blossom Jenkins GPU CI (A10) and conda setup #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
scal444
wants to merge
2
commits into
NVIDIA-Digital-Bio:main
Choose a base branch
from
scal444:blossom_take2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+112
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| @Library('blossom-github-lib@master') | ||
| import ipp.blossom.* | ||
|
|
||
| // Request any linux node with a GPU; no gpu_type selector so scheduling isn't | ||
| // blocked by tainted nodes. restartPolicy/backoffLimit are Pod/Job fields, not container fields. | ||
| podTemplate(cloud: 'blsm-prod-cloud', yaml: """ | ||
| spec: | ||
| containers: | ||
| - name: cuda | ||
| image: nvcr.io/nvidia/cuda:12.6.3-devel-ubuntu22.04 | ||
| command: | ||
| - cat | ||
| resources: | ||
| requests: | ||
| nvidia.com/gpu: 1 | ||
| limits: | ||
| nvidia.com/gpu: 1 | ||
| tty: true | ||
| nodeSelector: | ||
| kubernetes.io/os: linux | ||
| """) { | ||
| node(POD_LABEL) { | ||
| timeout(time: 90, unit: 'MINUTES') { | ||
| def githubHelper | ||
| stage('Get Token') { | ||
| withCredentials([usernamePassword(credentialsId: 'github-token', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { | ||
| githubHelper = GithubHelper.getInstance("${GIT_PASSWORD}", githubData) | ||
| } | ||
| } | ||
| def stageName = '' | ||
| try { | ||
| currentBuild.description = githubHelper.getBuildDescription() | ||
| stageName = 'Verify GPU' | ||
| stage(stageName) { | ||
| container('cuda') { | ||
| sh 'nvidia-smi' | ||
| } | ||
| } | ||
|
|
||
| stageName = 'Code checkout' | ||
| stage(stageName) { | ||
| githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Running", GitHubCommitState.PENDING) | ||
| if ("Open".equalsIgnoreCase(githubHelper.getPRState())) { | ||
| println 'PR State is Open' | ||
| checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: 'pr/' + githubHelper.getPRNumber()]], doGenerateSubmoduleConfigurations: false, | ||
| submoduleCfg: [], | ||
| userRemoteConfigs: [[credentialsId: 'github-token', url: githubHelper.getCloneUrl(), refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*']]] | ||
| } else if ("Merged".equalsIgnoreCase(githubHelper.getPRState())) { | ||
| println 'PR State is Merged' | ||
| checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: githubHelper.getMergedSHA()]], | ||
| doGenerateSubmoduleConfigurations: false, | ||
| submoduleCfg: [], | ||
| userRemoteConfigs: [[credentialsId: 'github-token', url: githubHelper.getCloneUrl(), refspec: '+refs/pull/*/merge:refs/remotes/origin/pr/*']]] | ||
| } | ||
| } | ||
|
|
||
| stageName = 'Build and Python tests' | ||
| stage(stageName) { | ||
| githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Running", GitHubCommitState.PENDING) | ||
| container('cuda') { | ||
| sh ''' | ||
| set -ex | ||
| cd "${WORKSPACE}" | ||
| export DEBIAN_FRONTEND=noninteractive | ||
| apt-get update | ||
| apt-get install -y --no-install-recommends \ | ||
| gcc-12 g++-12 build-essential git wget ca-certificates \ | ||
| libomp-15-dev | ||
| bash admin/setup_conda_env.sh 3.12 2024.09.6 | ||
| . /usr/local/anaconda/etc/profile.d/conda.sh && conda activate base | ||
| pip install --upgrade pip | ||
| pip install torch --index-url https://download.pytorch.org/whl/cu126 | ||
| export CC="$(command -v gcc-12)" | ||
| export CXX="$(command -v g++-12)" | ||
| export CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL:-$(nproc)}" | ||
| export NVMOLKIT_CUDA_TARGET_MODE=native | ||
| pip install -v . | ||
| cd nvmolkit/tests | ||
| pytest -v . | ||
| ''' | ||
| } | ||
| githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Complete", GitHubCommitState.SUCCESS) | ||
| } | ||
|
|
||
| githubHelper.uploadLogs(this, env.JOB_NAME, env.BUILD_NUMBER, null, null) | ||
| githubHelper.updateCommitStatus("$BUILD_URL", 'Complete', GitHubCommitState.SUCCESS) | ||
| } catch (Exception ex) { | ||
| currentBuild.result = 'FAILURE' | ||
| println ex | ||
| githubHelper.uploadLogs(this, env.JOB_NAME, env.BUILD_NUMBER, null, null) | ||
| githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Failed", GitHubCommitState.FAILURE) | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash | ||
|
|
||
| PYTHON_VERSION=$1 | ||
| RDKIT_VERSION=$2 | ||
|
|
||
|
|
||
| set -ex | ||
| apt update && apt install -y wget git | ||
|
|
||
| mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/conda-forge/miniforge/releases/download/25.3.0-3/Miniforge3-25.3.0-3-Linux-x86_64.sh && \ | ||
scal444 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bash /var/tmp/Miniforge3-25.3.0-3-Linux-x86_64.sh -b -p /usr/local/anaconda && \ | ||
| /usr/local/anaconda/bin/conda init && \ | ||
| ln -s /usr/local/anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ | ||
| . /usr/local/anaconda/etc/profile.d/conda.sh && \ | ||
| conda activate base && \ | ||
| conda config --add channels conda-forge --add channels nvidia --add channels pytorch && \ | ||
| conda install -q -y python=$PYTHON_VERSION rdkit=$RDKIT_VERSION libboost-devel libboost-headers libboost-python-devel librdkit-dev pytest pandas psutil cmake cmakelang scikit-build=0.18 eigen | ||
scal444 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.