Skip to content

Commit

Permalink
Simplify dockerfile and move a few things back to Jenkinsfile
Browse files Browse the repository at this point in the history
Bruce makes the argument that the Dockerfile should only contain things
that need to be done as root.

I don't have a strong opinion on the topic so I am accommodating this.
  • Loading branch information
james-smith-za committed Dec 3, 2024
1 parent 890d049 commit 64816a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
13 changes: 1 addition & 12 deletions Dockerfile.CI → .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,9 @@
FROM ubuntu:24.04

WORKDIR /tmp/spead2
COPY . .
COPY .ci/install-sys-pkgs.sh .

# Install dependencies
# jq and iproute2 are used to find the interface IPv4 address
RUN apt-get update && apt-get -y --no-install-recommends install libpython3-dev python3-venv jq iproute2
RUN python3 -m venv /venv
RUN .ci/install-sys-pkgs.sh
RUN PATH="/venv/bin:$PATH" .ci/py-requirements.sh

# Install Python package
RUN PATH="/venv/bin:$PATH" pip install -v \
--config-settings=setup-args=--native-file=ci.ini \
--config-settings=setup-args=-Dibv=enabled \
--config-settings=setup-args=-Dibv_hw_rate_limit=enabled \
--config-settings=setup-args=-Dmlx5dv=enabled \
.

18 changes: 17 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pipeline {
agent {
dockerfile {
label 'spead2'
filename 'Dockerfile.CI'
dir '.ci'
registryCredentialsId 'dockerhub' // Supply credentials to avoid rate limit
// These arguments allow direct access to the NVIDIA NIC with ibverbs
args '--network=host --ulimit=memlock=-1 -e NVIDIA_MOFED=enabled -e NVIDIA_VISIBLE_DEVICES=all --runtime=nvidia'
Expand All @@ -42,7 +42,23 @@ pipeline {
}

stages {
stage('Install dependencies') {
steps {
sh 'python3 -m venv /venv'
sh 'PATH="/venv/bin:$PATH" py-requirements.sh'

}
}
stage('Install Python package') {
steps {
sh '''PATH="/venv/bin:$PATH" pip install -v \
--config-settings=setup-args=--native-file=ci.ini \
--config-settings=setup-args=-Dibv=enabled \
--config-settings=setup-args=-Dibv_hw_rate_limit=enabled \
--config-settings=setup-args=-Dmlx5dv=enabled \
.'''
}
}
stage('Run tests') {
steps {
sh 'PATH="/venv/bin:$PATH" .ci/py-tests-jenkins.sh'
Expand Down

0 comments on commit 64816a1

Please sign in to comment.