Skip to content

Commit

Permalink
update to ubuntu 24.04 (#1941)
Browse files Browse the repository at this point in the history
* update to ubuntu 24.04

* Apply suggestions from code review

* Update .github/workflows/repo.yml

* Update test.yaml

* docker builds

* bump

* no pyenv

* ugh this should just be removed

* fix

* add release/

* no openpilot

* remove those too

* build in the docker

* cleanup

* need the addons
  • Loading branch information
adeebshihadeh authored Apr 28, 2024
1 parent d4a01f7 commit 53e0f13
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/drivers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
build_socketcan:
name: socketcan build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
pre-commit-autoupdate:
name: pre-commit autoupdate
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: ghcr.io/commaai/panda:latest
steps:
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
jobs:
docker_push:
name: docker push
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 20
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/panda'
steps:
Expand All @@ -38,7 +38,7 @@ jobs:

build:
name: build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
Expand All @@ -57,7 +57,7 @@ jobs:

unit_tests:
name: unit tests
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
Expand All @@ -70,7 +70,7 @@ jobs:

safety:
name: safety
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
flags: ['', '--ubsan']
Expand All @@ -82,16 +82,13 @@ jobs:
- name: Run safety tests
timeout-minutes: 5
run: |
${{ env.RUN }} "cd .. && \
scons -c && \
scons -j$(nproc) opendbc/ cereal/ && \
cd panda && \
${{ env.RUN }} "scons -c -j$(nproc) && \
scons -j$(nproc) ${{ matrix.flags }} && \
tests/safety/test.sh"
misra:
name: MISRA C:2012
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
Expand All @@ -108,7 +105,7 @@ jobs:

python_linter:
name: python linter
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
Expand Down
72 changes: 23 additions & 49 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
make \
bzip2 \
ca-certificates \
capnproto \
clang \
curl \
g++ \
gcc-arm-none-eabi libnewlib-arm-none-eabi \
git \
libarchive-dev \
libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev \
libbz2-dev \
libcapnp-dev \
libcurl4-openssl-dev \
libffi-dev \
libtool \
libssl-dev \
libsqlite3-dev \
libusb-1.0-0 \
libzmq3-dev \
locales \
opencl-headers \
ocl-icd-opencl-dev \
make \
patch \
pkg-config \
python \
python-dev \
qt5-default \
unzip \
wget \
python3 \
python3-dev \
python3-pip \
python-is-python3 \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* && \
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
apt clean && \
cd /usr/lib/gcc/arm-none-eabi/* && \
rm -rf arm/ && \
rm -rf thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp

Expand All @@ -47,45 +39,27 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"

ENV PANDA_PATH=/tmp/openpilot/panda
ENV OPENPILOT_REF="bc4b75822a609e6897058bc83688c84004f29093"
ENV OPENDBC_REF="1745ab51825055cd18748013c4a5e3377319e390"

COPY requirements.txt /tmp/
RUN pyenv install 3.11.4 && \
pyenv global 3.11.4 && \
pyenv rehash && \
pip install --no-cache-dir -r /tmp/requirements.txt
RUN pip3 install --break-system-packages --no-cache-dir -r /tmp/requirements.txt

ENV CPPCHECK_DIR=/tmp/cppcheck
COPY tests/misra/install.sh /tmp/
RUN /tmp/install.sh
# don't try to install again
RUN /tmp/install.sh && rm -rf $CPPCHECK_DIR/.git/
ENV SKIP_CPPCHECK_INSTALL=1

RUN git config --global --add safe.directory /tmp/openpilot/panda
RUN cd /tmp && \
git clone https://github.com/commaai/openpilot.git tmppilot || true && \
cd /tmp/tmppilot && \
git fetch origin $OPENPILOT_REF && \
git checkout $OPENPILOT_REF && \
git submodule update --init cereal opendbc rednose_repo body && \
git -C opendbc fetch && \
git -C opendbc checkout $OPENDBC_REF && \
git -C opendbc reset --hard HEAD && \
git -C opendbc clean -xfd && \
mkdir /tmp/openpilot && \
cp -pR SConstruct site_scons/ tools/ selfdrive/ system/ common/ cereal/ opendbc/ rednose/ third_party/ body/ /tmp/openpilot && \
rm -rf /tmp/openpilot/panda && \
rm -rf /tmp/tmppilot

RUN cd /tmp/openpilot && \
pip install --no-cache-dir -r opendbc/requirements.txt && \
pip install --no-cache-dir --upgrade aenum lru-dict pycurl tenacity atomicwrites serial smbus2
ENV CEREAL_REF="861144c136c91f70dcbc652c2ffe99f57440ad47"
ENV OPENDBC_REF="e0d4be4a6215d44809718dc84efe1b9f0299ad63"

RUN git config --global --add safe.directory /tmp/openpilot/panda
RUN mkdir -p /tmp/openpilot/ && \
cd /tmp/openpilot/ && \
git clone --depth 1 https://github.com/commaai/cereal && \
git clone --depth 1 https://github.com/commaai/opendbc && \
cd cereal && git fetch origin $CEREAL_REF && git checkout FETCH_HEAD && rm -rf .git/ && cd .. && \
cd opendbc && git fetch origin $OPENDBC_REF && git checkout FETCH_HEAD && rm -rf .git/ && cd .. && \
cp -pR opendbc/SConstruct opendbc/site_scons/ . && \
pip3 install --break-system-packages --no-cache-dir -r opendbc/requirements.txt && \
scons -j8 --minimal opendbc/ cereal/

# for Jenkins
COPY README.md panda.tar.* /tmp/
Expand Down
2 changes: 1 addition & 1 deletion board/debug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Connect an ST-Link V2 programmer to the SWD pins on the board. The pins that nee
Make sure you're using a genuine one for boards that do not have a 3.3V panda power rail. For example, the tres runs at 1.8V, which is not supported by the clones.

## Openocd
Install openocd. For Ubuntu 20.04, the one in the package manager works fine: `sudo apt install openocd`.
Install openocd. For Ubuntu 24.04, the one in the package manager works fine: `sudo apt install openocd`.

To run, use `./debug_f4.sh (TODO)` or `./debug_h7.sh` depending on the panda.

Expand Down

0 comments on commit 53e0f13

Please sign in to comment.