Skip to content

Commit

Permalink
Add Jenkinsfile and supporting Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
glowkey committed Aug 5, 2021
1 parent f452488 commit 526a03f
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 69 deletions.
68 changes: 0 additions & 68 deletions .gitlab-ci.yml

This file was deleted.

18 changes: 18 additions & 0 deletions Dockerfile
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
64 changes: 64 additions & 0 deletions Jenkinsfile
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()
}
}
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install: binary
install -m 557 -D ./etc/dcgm-exporter/dcp-metrics-included.csv /etc/dcgm-exporter/dcp-metrics-included.csv

check-format:
test $$(gofmt -l pkg bindings | tee /dev/stderr | wc -l) -eq 0
test $$(gofmt -l pkg | tee /dev/stderr | wc -l) -eq 0

push:
$(DOCKER) push "$(REGISTRY)/dcgm-exporter:$(FULL_VERSION)-ubuntu20.04"
Expand Down

0 comments on commit 526a03f

Please sign in to comment.