Skip to content

Commit

Permalink
new docker image structure (commaai#1070)
Browse files Browse the repository at this point in the history
* new structure

* fix that
  • Loading branch information
sshane authored Aug 1, 2024
1 parent 39a5345 commit cd61e17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: tests
on: [push, pull_request]

env:
RUN: docker run -v $GITHUB_WORKSPACE:/project/opendbc -w /project/opendbc -e PYTHONWARNINGS="error,default::DeprecationWarning" --shm-size 1G --rm opendbc /bin/bash -c
RUN: docker run -e PYTHONWARNINGS="error,default::DeprecationWarning" --shm-size 1G --rm opendbc /bin/bash -c
BUILD: docker buildx build --pull --load --cache-to type=inline --cache-from type=registry,ref=ghcr.io/commaai/opendbc:latest -t opendbc -f Dockerfile .
PYTHONWARNINGS: error

Expand All @@ -19,10 +19,8 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
run: eval "$BUILD"
- name: Build opendbc
run: ${{ env.RUN }} "cd ../ && scons -j$(nproc) --minimal"
- name: Unit tests
run: ${{ env.RUN }} "pytest -n logical"
run: ${{ env.RUN }} "pytest -n logical --durations=0"

static-analysis:
name: static analysis
Expand All @@ -31,13 +29,9 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
run: eval "$BUILD"
- name: Build opendbc
run: ${{ env.RUN }} "cd ../ && scons -j$(nproc) --minimal"
- name: pre-commit
# TODO: a package pre-commit installs has a warning, remove the unset once that's fixed
run: ${{ env.RUN }} "unset PYTHONWARNINGS && pre-commit run --all"
- name: Generator test
run: ${{ env.RUN }} "generator/test_generator.py"
run: ${{ env.RUN }} "git init && git add -A && unset PYTHONWARNINGS && pre-commit run --all"

docker-push:
name: docker push
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ COPY requirements.txt /tmp/
RUN pip3 install --break-system-packages --no-cache-dir -r /tmp/requirements.txt
RUN pip3 install --break-system-packages --no-cache-dir pre-commit==2.15.0 pylint==2.17.4

WORKDIR /project/opendbc
ENV PYTHONPATH=/project

RUN git config --global --add safe.directory '*'

WORKDIR /project

COPY SConstruct .
COPY . .
COPY SConstruct /project
COPY ./site_scons /project/site_scons
COPY .gitignore /project/.gitignore

RUN ls && rm -rf .git && cd ../ && \
scons -c && scons -j$(nproc) \

0 comments on commit cd61e17

Please sign in to comment.