forked from NVIDIA/dcgm-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Jenkinsfile and supporting Dockerfile
- Loading branch information
Showing
4 changed files
with
83 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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,18 @@ | ||
FROM nvidia/cuda:11.4.1-base-ubuntu20.04 | ||
|
||
ARG DCGM_VERSION | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
gnupg2 curl ca-certificates build-essential && \ | ||
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub | apt-key add - && \ | ||
curl -s https://storage.googleapis.com/golang/go1.16.5.linux-amd64.tar.gz| tar -v -C /usr/local -xz && \ | ||
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \ | ||
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list && \ | ||
apt-get purge --autoremove -y curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
datacenter-gpu-manager | ||
|
||
ENV PATH $PATH:/usr/local/go/bin |
This file contains 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,64 @@ | ||
@Library(['shared-libs']) _ | ||
|
||
pipeline { | ||
|
||
agent { | ||
dockerfile { | ||
label 'docker' | ||
filename 'Dockerfile' | ||
args '-v /etc/passwd:/etc/passwd:ro -v /var/run/docker.sock:/var/run/docker.sock:rw' | ||
} | ||
} | ||
|
||
options { | ||
ansiColor('xterm') | ||
timestamps() | ||
timeout(time: 1, unit: 'HOURS') | ||
gitLabConnection('GitLab Master') | ||
buildDiscarder(logRotator(numToKeepStr: '100', artifactNumToKeepStr: '10')) | ||
} | ||
|
||
environment { | ||
HOME="${WORKSPACE}" | ||
PYTHONUNBUFFERED=1 | ||
} | ||
|
||
parameters { | ||
string(name: 'REF', defaultValue: '\${gitlabBranch}', description: 'Commit to build') | ||
} | ||
|
||
stages { | ||
stage('Prep') { | ||
steps { | ||
script { | ||
updateGitlabCommitStatus(name: 'Jenkins CI', state: 'running') | ||
} | ||
} | ||
} | ||
stage('Compile') { | ||
steps { | ||
echo "building" | ||
sh "make binary" | ||
} | ||
} | ||
stage('Test') { | ||
steps { | ||
echo "Running tests" | ||
// Tests require supported GPU | ||
// make test-main | ||
sh "make check-format" | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
script{ | ||
String status = (currentBuild.currentResult == "SUCCESS") ? "success" : "failed" | ||
updateGitlabCommitStatus(name: 'Jenkins CI', state: status) | ||
} | ||
} | ||
cleanup { | ||
cleanWs() | ||
} | ||
} | ||
} |
This file contains 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