Skip to content

Commit

Permalink
Bump Python minimum to 3.8 and rework CI a bit
Browse files Browse the repository at this point in the history
Rather than testing every version, just maintain a Jenkins build for the
baseline and the latest. The latter can be done automatically as there's
a Docker image tagged latest, whilst the former needs a bit of manual
bumping. However, there should now be fewer places that need updating
with the version number.

Note that officially this means Ubuntu 18.04 is not supported. However,
for now, Jenkins is still using that for linux-baseline, and so we'll
need to keep it working in practice until we've migrated over to 20.04,
though probably we should jump straight to 22.04 for CI as 20.04 has a
bit under a year left to it as well.
  • Loading branch information
jrtc27 committed May 21, 2024
1 parent 196be55 commit db30c92
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 93 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build-baseline:
runs-on: ubuntu-latest
container:
image: python:3.6.0
image: python:3.8
steps:
- uses: actions/checkout@v3
- name: Install dependencies
Expand Down Expand Up @@ -49,10 +49,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
Expand Down
70 changes: 16 additions & 54 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ pipeline {
stages {
stage('Test') {
parallel {
stage('Test Python 3.6.0') {
stage('Test Python Baseline') {
agent {
dockerfile {
dir 'src/tests'
filename 'python-360.Dockerfile'
filename 'python-baseline.Dockerfile'
}
}
steps {
Expand All @@ -20,17 +20,17 @@ pipeline {
dir("tempsrc") { sh 'ls -la' }
// Avoid git chowning .git/index to root which will cause the next build to fail
// Work around old docker version in jenkins that can't change cwd:
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.6.0'
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh baseline'
dir("tempsrc") { deleteDir() }
}
junit '3.6.0-results.xml'
junit 'baseline-results.xml'
}
}
stage('Test Python 3.7.0') {
stage('Test Python Latest') {
agent {
dockerfile {
dir 'src/tests'
filename 'python-370.Dockerfile'
filename 'python-latest.Dockerfile'
}
}
steps {
Expand All @@ -39,17 +39,17 @@ pipeline {
dir("tempsrc") { sh 'ls -la' }
// Avoid git chowning .git/index to root which will cause the next build to fail
// Work around old docker version in jenkins that can't change cwd:
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.7.0'
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh latest'
dir("tempsrc") { deleteDir() }
}
junit '3.7.0-results.xml'
junit 'latest-results.xml'
}
}
stage('Test Python 3.8.0') {
stage('Test Ubuntu Baseline') {
agent {
dockerfile {
dir 'src/tests'
filename 'python-380.Dockerfile'
filename 'ubuntu-baseline.Dockerfile'
}
}
steps {
Expand All @@ -58,17 +58,17 @@ pipeline {
dir("tempsrc") { sh 'ls -la' }
// Avoid git chowning .git/index to root which will cause the next build to fail
// Work around old docker version in jenkins that can't change cwd:
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.8.0'
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh ubuntu-baseline'
dir("tempsrc") { deleteDir() }
}
junit '3.8.0-results.xml'
junit 'ubuntu-baseline-results.xml'
}
}
stage('Test Python 3.9.0') {
stage('Test Ubuntu Latest') {
agent {
dockerfile {
dir 'src/tests'
filename 'python-390.Dockerfile'
filename 'ubuntu-latest.Dockerfile'
}
}
steps {
Expand All @@ -77,48 +77,10 @@ pipeline {
dir("tempsrc") { sh 'ls -la' }
// Avoid git chowning .git/index to root which will cause the next build to fail
// Work around old docker version in jenkins that can't change cwd:
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh 3.9.0'
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh ubuntu-latest'
dir("tempsrc") { deleteDir() }
}
junit '3.9.0-results.xml'
}
}
stage('Test Python RC') {
agent {
dockerfile {
dir 'src/tests'
filename 'python-rc.Dockerfile'
}
}
steps {
ansiColor(colorMapName: 'xterm') {
dir("tempsrc") { deleteDir() }
dir("tempsrc") { sh 'ls -la' }
// Avoid git chowning .git/index to root which will cause the next build to fail
// Work around old docker version in jenkins that can't change cwd:
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh rc'
dir("tempsrc") { deleteDir() }
}
junit 'rc-results.xml'
}
}
stage('Test Ubuntu 18.04') {
agent {
dockerfile {
dir 'src/tests'
filename 'ubuntu.Dockerfile'
}
}
steps {
ansiColor(colorMapName: 'xterm') {
dir("tempsrc") { deleteDir() }
dir("tempsrc") { sh 'ls -la' }
// Avoid git chowning .git/index to root which will cause the next build to fail
// Work around old docker version in jenkins that can't change cwd:
sh 'cd tempsrc && ../src/tests/run_jenkins_tests.sh ubuntu'
dir("tempsrc") { deleteDir() }
}
junit 'ubuntu-results.xml'
junit 'ubuntu-latest-results.xml'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `cheribuild.py` - A script to build CHERI-related software (**requires Python 3.6+**)
# `cheribuild.py` - A script to build CHERI-related software (**requires Python 3.8+**)

This script automates all the steps required to build various [CHERI](http://www.chericpu.com)-related software.
For example `cheribuild.py [options] sdk-riscv64-purecap` will create an SDK that can be
Expand Down
10 changes: 0 additions & 10 deletions tests/python-370.Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions tests/python-390.Dockerfile

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6.0
FROM python:latest

LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk"

Expand Down
11 changes: 0 additions & 11 deletions tests/python-rc.Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions tests/run_jenkins_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
pytest_binary="python3 -m pytest"


case $1 in
3.6.0|3.7.0|3.8.0|3.9.0|rc|ubuntu)
case $1 in
baseline|latest|ubuntu)
test_prefix=$1
;;
*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic-20180426
FROM ubuntu:20.04

LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk"

Expand Down
12 changes: 12 additions & 0 deletions tests/ubuntu-latest.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:latest

LABEL maintainer="Alexander.Richardson@cl.cam.ac.uk"

RUN apt-get update && apt-get install -y --no-install-recommends \
make ninja-build \
gcc \
git \
python3-minimal python3-pip python3-setuptools

COPY requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt

0 comments on commit db30c92

Please sign in to comment.