From dccfd6342d5604fdc79d617b0b8ac04bf08aac79 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 28 Feb 2026 16:29:34 -0800 Subject: [PATCH] remove Dockerfile, use stock python:3.12 image in Jenkins - Delete custom Dockerfile (was ubuntu:24.04 based) - Use Jenkins agent { docker } with stock python:3.12 image - Remove apt/platform detection from setup.sh (python:3.12 has gcc, git, curl) - Fix deprecated license format in pyproject.toml - Use reuseNode to share workspace, chmod cleanup for root-owned files Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 20 -------------------- Jenkinsfile | 43 +++++++++++++++---------------------------- pyproject.toml | 2 +- setup.sh | 19 ------------------- 4 files changed, 16 insertions(+), 68 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a41d0c6f00..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:24.04 - -ENV WORKDIR=/tmp/panda/ -ENV PYTHONUNBUFFERED=1 -ENV PATH="$WORKDIR/.venv/bin:$PATH" - -WORKDIR $WORKDIR - -# deps install -COPY pyproject.toml __init__.py setup.sh $WORKDIR -RUN mkdir -p $WORKDIR/python/ $WORKDIR/board/body/ $WORKDIR/board/jungle/ && \ - touch $WORKDIR/__init__.py $WORKDIR/board/__init__.py $WORKDIR/board/body/__init__.py $WORKDIR/board/jungle/__init__.py -RUN apt-get update && apt-get install -y --no-install-recommends sudo && DEBIAN_FRONTEND=noninteractive $WORKDIR/setup.sh - -# second pass for the opendbc moving tag -ARG CACHEBUST=1 -RUN DEBIAN_FRONTEND=noninteractive $WORKDIR/setup.sh - -RUN git config --global --add safe.directory $WORKDIR/panda -COPY . $WORKDIR diff --git a/Jenkinsfile b/Jenkinsfile index a064bdc17f..9fe24f7587 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,3 @@ -def docker_run(String step_label, int timeout_mins, String cmd) { - timeout(time: timeout_mins, unit: 'MINUTES') { - sh script: "docker run --rm --privileged \ - --env PYTHONWARNINGS=error \ - --volume /dev/bus/usb:/dev/bus/usb \ - --volume /var/run/dbus:/var/run/dbus \ - --net host \ - ${env.DOCKER_IMAGE_TAG} \ - bash -c 'scons && ${cmd}'", \ - label: step_label - } -} - - def phone(String ip, String step_label, String cmd) { withCredentials([file(credentialsId: 'id_rsa', variable: 'key_file')]) { def ssh_cmd = """ @@ -69,8 +55,6 @@ pipeline { agent any environment { CI = "1" - PYTHONWARNINGS= "error" - DOCKER_IMAGE_TAG = "panda:build-${env.GIT_COMMIT}" TEST_DIR = "/data/panda" SOURCE_DIR = "/data/panda_source/" @@ -86,29 +70,32 @@ pipeline { lock(resource: "pandas") } stages { - stage('Build Docker Image') { - steps { - timeout(time: 20, unit: 'MINUTES') { - script { - dockerImage = docker.build("${env.DOCKER_IMAGE_TAG}", "--build-arg CACHEBUST=${env.GIT_COMMIT} .") - } + stage('jungle tests') { + agent { + docker { + image 'python:3.12' + args '--user=root --privileged --volume /dev/bus/usb:/dev/bus/usb --volume /var/run/dbus:/var/run/dbus --net host' + reuseNode true } } - } - stage('jungle tests') { steps { - script { + timeout(time: 10, unit: 'MINUTES') { retry (3) { - docker_run("reset hardware", 3, "python3 ./tests/hitl/reset_jungles.py") + sh './setup.sh && . .venv/bin/activate && export PYTHONWARNINGS=error && scons && python3 ./tests/hitl/reset_jungles.py' } } } + post { + always { + sh 'chmod -R 777 . || true' + } + } } stage('parallel tests') { parallel { stage('test cuatro') { - agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } } + agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root'; reuseNode true } } steps { phone_steps("panda-cuatro", [ ["build", "scons"], @@ -120,7 +107,7 @@ pipeline { } stage('test tres') { - agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } } + agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root'; reuseNode true } } steps { phone_steps("panda-tres", [ ["build", "scons"], diff --git a/pyproject.toml b/pyproject.toml index bf5418a7f3..8b647765c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.0.10" description = "Code powering the comma.ai panda" readme = "README.md" requires-python = ">=3.11,<3.13" # macOS doesn't work with 3.13 due to pycapnp from opendbc -license = {text = "MIT"} +license = "MIT" authors = [{name = "comma.ai"}] classifiers = [ "Natural Language :: English", diff --git a/setup.sh b/setup.sh index 13308a5bdb..a680222189 100755 --- a/setup.sh +++ b/setup.sh @@ -4,25 +4,6 @@ set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" cd $DIR -PLATFORM=$(uname -s) - -echo "installing dependencies" -if [[ $PLATFORM == "Darwin" ]]; then - # pass - : -elif [[ $PLATFORM == "Linux" ]]; then - # for AGNOS since we clear the apt lists - if [[ ! -d /"var/lib/apt/" ]]; then - sudo apt update - fi - - sudo apt-get install -y --no-install-recommends \ - curl ca-certificates gcc git \ - python3-dev -else - echo "WARNING: unsupported platform. skipping apt/brew install." -fi - if ! command -v uv &>/dev/null; then echo "'uv' is not installed. Installing 'uv'..." curl -LsSf https://astral.sh/uv/install.sh | sh