CI: use local scons cache instead of building a separate image (#29634)

* use local

* added ci_sim

* revert scons

* dont need these anymore

* same for sim

* fix dockerfiles
pull/26463/head
Justin Newberry 2 years ago committed by GitHub
parent 584239ceb5
commit c46965fc27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      .github/workflows/setup/action.yaml
  2. 3
      .github/workflows/tools_tests.yaml
  3. 6
      docs/docker/Dockerfile
  4. 3
      selfdrive/test/Dockerfile.scons_cache
  5. 4
      tools/sim/Dockerfile.sim

@ -1,10 +1,6 @@
name: 'openpilot env setup'
inputs:
setup_docker_scons_cache:
description: 'Whether or not to build the scons-cache docker image'
required: false
default: 'false'
git_lfs:
description: 'Whether or not to pull the git lfs'
required: false
@ -46,12 +42,4 @@ runs:
find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \;
# build our docker image
- shell: bash
run: eval ${{ env.BUILD }}
- id: setup-scons-cache-docker
name: Sets up a docker image with scons cache that can by mounted as a buildkit cache mount
shell: bash
if: ${{ inputs.setup_docker_scons_cache == 'true' }}
run: |
cp selfdrive/test/Dockerfile.scons_cache $GITHUB_WORKSPACE/.ci_cache
cd $GITHUB_WORKSPACE/.ci_cache
DOCKER_BUILDKIT=1 docker build -t scons-cache -f Dockerfile.scons_cache .
run: eval ${{ env.BUILD }}

@ -53,8 +53,6 @@ jobs:
with:
submodules: true
- uses: ./.github/workflows/setup
with:
setup_docker_scons_cache: true
- name: Build base cl image
run: eval "$BUILD_CL"
- name: Setup to push to repo
@ -76,7 +74,6 @@ jobs:
submodules: true
- uses: ./.github/workflows/setup
with:
setup_docker_scons_cache: true
git_lfs: false
- name: Setup to push to repo
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'commaai/openpilot'

@ -1,5 +1,3 @@
FROM scons-cache as scons-cache
FROM ghcr.io/commaai/openpilot-base:latest
ENV PYTHONUNBUFFERED 1
@ -31,7 +29,7 @@ COPY ./selfdrive ${OPENPILOT_PATH}/selfdrive
COPY ./system ${OPENPILOT_PATH}/system
COPY ./*.md ${OPENPILOT_PATH}/
RUN --mount=type=bind,from=scons-cache,source=/tmp/scons_cache,target=/tmp/scons_cache,rw scons -j$(nproc)
RUN --mount=type=bind,source=.ci_cache/scons_cache,target=/tmp/scons_cache,rw scons -j$(nproc)
RUN apt update && apt install doxygen -y
COPY ./docs ${OPENPILOT_PATH}/docs
@ -40,5 +38,5 @@ WORKDIR ${OPENPILOT_PATH}/docs
RUN make html
FROM nginx:1.21
COPY --from=1 /home/batman/openpilot/build/docs/html /usr/share/nginx/html
COPY --from=0 /home/batman/openpilot/build/docs/html /usr/share/nginx/html
COPY ./docs/docker/nginx.conf /etc/nginx/conf.d/default.conf

@ -1,3 +0,0 @@
FROM alpine:3
COPY ./scons_cache /tmp/scons_cache

@ -1,5 +1,3 @@
FROM scons-cache as scons-cache
FROM ghcr.io/commaai/openpilot-base-cl:latest
RUN apt-get update && apt-get install -y --no-install-recommends \
@ -31,6 +29,6 @@ COPY ./system $HOME/openpilot/system
COPY ./tools $HOME/openpilot/tools
WORKDIR $HOME/openpilot
RUN --mount=type=bind,from=scons-cache,source=/tmp/scons_cache,target=/tmp/scons_cache,rw scons -j12
RUN --mount=type=bind,source=.ci_cache/scons_cache,target=/tmp/scons_cache,rw scons -j$(nproc)
RUN python -c "from openpilot.selfdrive.test.helpers import set_params_enabled; set_params_enabled()"

Loading…
Cancel
Save