-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shift a couple of stages from Jenkinsfile into Dockerfile #364
Changes from 1 commit
890d049
64816a1
54c3944
f97db81
2bf3f2e
a1fe8cf
a8c99b4
41c50b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,40 @@ | ||||||||||||||||||||||||||||||
# syntax = docker/dockerfile:1 | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
################################################################################ | ||||||||||||||||||||||||||||||
# Copyright (c) 2024, National Research Foundation (SARAO) | ||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||
# This program is free software: you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||
# the terms of the GNU Lesser General Public License as published by the Free | ||||||||||||||||||||||||||||||
# Software Foundation, either version 3 of the License, or (at your option) any | ||||||||||||||||||||||||||||||
# later version. | ||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||||||||||||||||||||||||||||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||||||||||||||||||||||||||||||
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||||||||||||||||||||||||||||||
# details. | ||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||
# You should have received a copy of the GNU Lesser General Public License | ||||||||||||||||||||||||||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||||
################################################################################ | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
FROM ubuntu:24.04 | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
WORKDIR /tmp/spead2 | ||||||||||||||||||||||||||||||
COPY . . | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
# 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 \ | ||||||||||||||||||||||||||||||
. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'd prefer to just use the Dockerfile for the stuff that needs to be done as root. I feel like one gets better debuggability if the steps that work on the code under test are done in Jenkinsfile stages so that you can get a clear stage view of what happened, how long each stage took etc, rather than just "the Dockerfile failed to build".
Suggested change
Also change |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,10 +23,10 @@ | |||||
|
||||||
pipeline { | ||||||
agent { | ||||||
docker { | ||||||
dockerfile { | ||||||
label 'spead2' | ||||||
filename 'Dockerfile.CI' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you take my suggestions above, the Dockerfile only needs the .ci directory, so it can move to
Suggested change
|
||||||
registryCredentialsId 'dockerhub' // Supply credentials to avoid rate limit | ||||||
image 'ubuntu:24.04' | ||||||
// 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' | ||||||
} | ||||||
|
@@ -42,26 +42,6 @@ pipeline { | |||||
} | ||||||
|
||||||
stages { | ||||||
stage('Install dependencies') { | ||||||
steps { | ||||||
// jq and iproute2 are used to find the interface IPv4 address | ||||||
sh 'apt-get update && apt-get -y --no-install-recommends install libpython3-dev python3-venv jq iproute2' | ||||||
sh 'python3 -m venv /venv' | ||||||
sh '.ci/install-sys-pkgs.sh' | ||||||
sh 'PATH="/venv/bin:$PATH" .ci/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 { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other files.