Skip to content

Commit

Permalink
feat: GPU jenkins support (#476)
Browse files Browse the repository at this point in the history
* feat: GPU jenkins support

* Update jenkins.Dockerfile

Updated Dockerfile
  • Loading branch information
gaurav274 authored Nov 7, 2022
1 parent 6f6db96 commit 821d59d
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 13 deletions.
46 changes: 33 additions & 13 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,64 @@
pipeline {
agent {
dockerfile {
filename 'docker/eva_jenkins.Dockerfile'
dockerfile {
filename 'docker/jenkins.Dockerfile'
args '--gpus all'
}
}


options{
buildDiscarder(logRotator(numToKeepStr: '8', daysToKeepStr: '20'))
}


stages {

stage('Setup and Install Packages') {
parallel {
stage('Setup Virtual Environment') {

steps {
sh '''python3 -m venv env37
. env37/bin/activate
pip install --upgrade pip
pip install scikit-build
pip install cython
pip install -e ."[dev]"'''
. env37/bin/activate
pip install --upgrade pip
pip install scikit-build
pip install cython
pip install -e ."[dev]"
'''
}
}

stage('Generate Parser Files') {

steps {
sh 'sh script/antlr4/generate_parser.sh'
}
}
}
}

stage('CUDA GPU Check') {

steps {
sh '''. env37/bin/activate
python3 -c "import torch; torch.cuda.current_device()"
'''
}
}

stage('Run Tests') {

steps {
sh '''. env37/bin/activate
sh script/test/test.sh'''
}
}
sh script/test/test.sh
'''
}
}

stage('Coverage Check') {

steps {
sh '''. env37/bin/activate
coveralls'''
coveralls'''
}
}
}
Expand Down
49 changes: 49 additions & 0 deletions docker/jenkins.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# https://www.jenkins.io/doc/book/installing/docker/ - Follow these steps for starting jenkins.
FROM nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04

# Docker image specific installation
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-numpy \
python3-pip \
python3-pytest \
python3-pytest-cov \
python3-venv \
python3-yaml \
ffmpeg \
&& \
apt-get autoremove --purge -y && \
apt-get autoclean -y && \
rm -rf /var/cache/apt/* /var/lib/apt/lists/*

# OpenCV Specific Installation
RUN apt-get -qq update && \
apt-get -qq install -y --no-install-recommends \
build-essential \
cmake \
git \
wget \
unzip \
yasm \
pkg-config \
ffmpeg \
libsm6 \
libxext6 \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libopenjp2-7-dev \
libavformat-dev \
libpq-dev \
python3-dev \
sudo \
openjdk-11-jdk \
openjdk-11-jre

# Give Permission To Home Directory To Create EVA
RUN mkdir /.eva && chmod -R 777 /.eva
RUN mkdir /.cache && chmod -R 777 /.cache
RUN mkdir /.EasyOCR && chmod -R 777 /.EasyOCR

0 comments on commit 821d59d

Please # to comment.