mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 20:42:09 +08:00
CL in docker (#24718)
* Move CL to base docker * Different docker for cl * add cl base docker * add to tool * cleanup Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> old-commit-hash: dc4d4f875b173b92847149918af7f1c63d78701f
This commit is contained in:
@@ -7,6 +7,7 @@ on:
|
||||
|
||||
env:
|
||||
BASE_IMAGE: openpilot-base
|
||||
CL_BASE_IMAGE: openpilot-base-cl
|
||||
DOCKER_REGISTRY: ghcr.io/commaai
|
||||
AZURE_TOKEN: ${{ secrets.AZURE_COMMADATACI_OPENPILOTCI_TOKEN }}
|
||||
|
||||
@@ -17,6 +18,13 @@ env:
|
||||
docker build --cache-from $DOCKER_REGISTRY/$BASE_IMAGE:latest -t $DOCKER_REGISTRY/$BASE_IMAGE:latest -t $BASE_IMAGE:latest -f Dockerfile.openpilot_base .
|
||||
|
||||
RUN: docker run --shm-size 1G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v /tmp/scons_cache:/tmp/scons_cache -v /tmp/comma_download_cache:/tmp/comma_download_cache $BASE_IMAGE /bin/sh -c
|
||||
|
||||
BUILD_CL: |
|
||||
docker pull $(grep -iohP '(?<=^from)\s+\S+' Dockerfile.openpilot_base_cl) || true
|
||||
docker pull $DOCKER_REGISTRY/$BASE_IMAGE:latest || true
|
||||
docker build --cache-from $DOCKER_REGISTRY/$CL_BASE_IMAGE:latest -t $DOCKER_REGISTRY/$CL_BASE_IMAGE:latest -t $CL_BASE_IMAGE:latest -f Dockerfile.openpilot_base_cl .
|
||||
RUN_CL: docker run --shm-size 1G -v $PWD:/tmp/openpilot -w /tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v /tmp/scons_cache:/tmp/scons_cache -v /tmp/comma_download_cache:/tmp/comma_download_cache $CL_BASE_IMAGE /bin/sh -c
|
||||
|
||||
UNIT_TEST: coverage run --append -m unittest discover
|
||||
|
||||
jobs:
|
||||
@@ -193,10 +201,13 @@ jobs:
|
||||
submodules: true
|
||||
- name: Build Docker image
|
||||
run: eval "$BUILD"
|
||||
- name: Build CL Docker image
|
||||
run: eval "$BUILD_CL"
|
||||
- name: Push to container registry
|
||||
run: |
|
||||
$DOCKER_LOGIN
|
||||
docker push $DOCKER_REGISTRY/$BASE_IMAGE:latest
|
||||
docker push $DOCKER_REGISTRY/$CL_BASE_IMAGE:latest
|
||||
|
||||
static_analysis:
|
||||
name: static analysis
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
|
||||
env:
|
||||
BASE_IMAGE: openpilot-base
|
||||
CL_BASE_IMAGE: openpilot-base-cl
|
||||
DOCKER_REGISTRY: ghcr.io/commaai
|
||||
DOCKER_LOGIN: docker login ghcr.io -u adeebshihadeh -p ${{ secrets.CONTAINER_TOKEN }}
|
||||
|
||||
@@ -12,6 +13,10 @@ env:
|
||||
docker pull $(grep -iohP '(?<=^from)\s+\S+' Dockerfile.openpilot_base) || true
|
||||
docker pull $DOCKER_REGISTRY/$BASE_IMAGE:latest || true
|
||||
docker build --cache-from $DOCKER_REGISTRY/$BASE_IMAGE:latest -t $DOCKER_REGISTRY/$BASE_IMAGE:latest -t $BASE_IMAGE:latest -f Dockerfile.openpilot_base .
|
||||
BUILD_CL: |
|
||||
docker pull $(grep -iohP '(?<=^from)\s+\S+' Dockerfile.openpilot_base_cl) || true
|
||||
docker pull $DOCKER_REGISTRY/$BASE_IMAGE:latest || true
|
||||
docker build --cache-from $DOCKER_REGISTRY/$CL_BASE_IMAGE:latest -t $DOCKER_REGISTRY/$CL_BASE_IMAGE:latest -t $CL_BASE_IMAGE:latest -f Dockerfile.openpilot_base_cl .
|
||||
RUN: docker run --shm-size 1G -v $PWD:/tmp/openpilot -e PYTHONPATH=/tmp/openpilot -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e \
|
||||
GITHUB_REPOSITORY -e GITHUB_RUN_ID -v /tmp/comma_download_cache:/tmp/comma_download_cache $BASE_IMAGE /bin/sh -c
|
||||
|
||||
@@ -49,8 +54,10 @@ jobs:
|
||||
run: git lfs pull
|
||||
- name: Build base image
|
||||
run: eval "$BUILD"
|
||||
- name: Build base cl image
|
||||
run: eval "$BUILD_CL"
|
||||
- name: Pull latest simulator image
|
||||
run: eval "$BUILD"docker pull $DOCKER_REGISTRY/$IMAGE_NAME:latest || true
|
||||
run: docker pull $DOCKER_REGISTRY/$IMAGE_NAME:latest || true
|
||||
- name: Build simulator image
|
||||
run: docker build --cache-from $DOCKER_REGISTRY/$IMAGE_NAME:latest -t $DOCKER_REGISTRY/$IMAGE_NAME:latest -f tools/sim/Dockerfile.sim .
|
||||
- name: Push to container registry
|
||||
|
||||
Reference in New Issue
Block a user