Skip to content

Commit

Permalink
Merge pull request #88 from arjbingly/sanchitvj-patch-2
Browse files Browse the repository at this point in the history
Create branch_Jenkinsfile
  • Loading branch information
arjbingly authored Apr 17, 2024
2 parents 82f5dbe + 6c6c12a commit c2c044b
Showing 1 changed file with 120 additions and 0 deletions.
120 changes: 120 additions & 0 deletions ci/branch_Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
pipeline {
agent any

options{
skipDefaultCheckout(true)
}
environment {
PYTHONPATH = "${env.WORKSPACE}/.venv/bin"
CUDACXX = '/usr/local/cuda-12/bin/nvcc'
CMAKE_ARGS = "-DLLAMA_CUBLAS=on"
PATH="/usr/local/cuda-12.3/bin:$PATH"
LD_LIBRARY_PATH="/usr/local/cuda-12.3/lib64:$LD_LIBRARY_PATH"
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=accept-new"
}


stages {
stage('Checkout') {
steps {
cleanWs()
checkout scm
}
}

stage('Create venv'){
steps {
sh 'python3 -m venv .venv'
}
}

stage('Install dependencies'){
steps {
withPythonEnv(PYTHONPATH){
sh 'pip install -e .'
}
}

}

stage('Config'){
steps{
withPythonEnv(PYTHONPATH){
sh 'python3 ci/modify_config.py'
sh 'rm -rf $JENKINS_HOME/ci_test_data/data/vectordb/ci_test'
sh 'cp -r $JENKINS_HOME/ci_test_data/data/backup_vectordb/ci_test $JENKINS_HOME/ci_test_data/data/vectordb'
}
}
}

stage('Linting'){
steps {
withPythonEnv(PYTHONPATH){
sh 'pip install ruff'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh 'ruff check . --exclude .pyenv-var-lib-jenkins-workspace-capstone_5-.venv-bin --output-format junit -o ruff-report.xml'
sh 'ruff format .'
}
}
}
post {
always{
withChecks('Lint Checks'){
junit 'ruff-report.xml'
}
}
}
}

stage('Static type check'){
steps {
withPythonEnv(PYTHONPATH){
sh 'pip install mypy'
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE'){
sh 'python3 -m mypy -p src.grag --junit-xml mypy-report.xml'
}
}
}
post {
always{
withChecks('Static Type Checks'){
junit 'mypy-report.xml'
}
}
}
}

stage('Tests'){
steps{
sh 'docker pull chromadb/chroma'
sh 'docker run -d --name jenkins-chroma -p 8000:8000 chromadb/chroma'
withPythonEnv(PYTHONPATH){
sh 'pip install pytest'
sh 'python3 ci/unlock_deeplake.py'
sh 'pytest src -vvv --junitxml=pytest-report.xml'
}
}
post {
always{
sh 'docker stop jenkins-chroma'
sh 'docker rm jenkins-chroma'
withChecks('Integration Tests'){
junit 'pytest-report.xml'
}
}
}
}
}
post {
cleanup{
cleanWs(
cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']]
)
}
}
}

0 comments on commit c2c044b

Please sign in to comment.