commit
d26fd5b4da
51 changed files with 281 additions and 283 deletions
@ -0,0 +1,62 @@ |
|||||||
|
name: docs |
||||||
|
|
||||||
|
on: |
||||||
|
push: |
||||||
|
branches: |
||||||
|
- master |
||||||
|
pull_request: |
||||||
|
|
||||||
|
concurrency: |
||||||
|
group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }} |
||||||
|
cancel-in-progress: true |
||||||
|
|
||||||
|
env: |
||||||
|
BASE_IMAGE: openpilot-base |
||||||
|
|
||||||
|
BUILD: selfdrive/test/docker_build.sh base |
||||||
|
|
||||||
|
RUN: docker run --shm-size 1G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e FILEREADER_CACHE=1 -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 $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/sh -c |
||||||
|
|
||||||
|
jobs: |
||||||
|
docs: |
||||||
|
name: build docs |
||||||
|
runs-on: ubuntu-20.04 |
||||||
|
timeout-minutes: 45 |
||||||
|
steps: |
||||||
|
- uses: actions/checkout@v4 |
||||||
|
with: |
||||||
|
submodules: true |
||||||
|
- uses: ./.github/workflows/setup-with-retry |
||||||
|
- name: Build openpilot |
||||||
|
run: | |
||||||
|
${{ env.RUN }} "scons -j$(nproc)" |
||||||
|
- name: Build docs |
||||||
|
run: | |
||||||
|
${{ env.RUN }} "apt update && apt install -y doxygen && cd docs && make html" |
||||||
|
|
||||||
|
- uses: actions/checkout@v4 |
||||||
|
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot' |
||||||
|
with: |
||||||
|
path: openpilot-docs |
||||||
|
ssh-key: ${{ secrets.OPENPILOT_DOCS_KEY }} |
||||||
|
repository: commaai/openpilot-docs |
||||||
|
- name: Push |
||||||
|
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/openpilot' |
||||||
|
run: | |
||||||
|
set -x |
||||||
|
|
||||||
|
source release/identity.sh |
||||||
|
|
||||||
|
cd openpilot-docs |
||||||
|
|
||||||
|
git checkout --orphan tmp |
||||||
|
git rm -rf --cached . |
||||||
|
|
||||||
|
cp -r ../build/docs/html/ docs/ |
||||||
|
touch docs/.nojekyll |
||||||
|
git add -f . |
||||||
|
|
||||||
|
git commit -m "build docs" |
||||||
|
|
||||||
|
# docs live in different repo to not bloat openpilot's full clone size |
||||||
|
git push -f origin gh-pages |
@ -1 +1 @@ |
|||||||
Subproject commit b1a1afebb8533a96ff0e8efbba7c10eb47df2af0 |
Subproject commit 24a522f6ba47aba12a9baea53020a8323673c79c |
@ -1,42 +0,0 @@ |
|||||||
FROM ghcr.io/commaai/openpilot-base:latest |
|
||||||
|
|
||||||
ENV PYTHONUNBUFFERED 1 |
|
||||||
|
|
||||||
ENV OPENPILOT_PATH /tmp/openpilot |
|
||||||
ENV PYTHONPATH ${OPENPILOT_PATH}:${PYTHONPATH} |
|
||||||
ENV POETRY_VIRUALENVS_CREATE false |
|
||||||
|
|
||||||
RUN mkdir -p ${OPENPILOT_PATH} |
|
||||||
WORKDIR ${OPENPILOT_PATH} |
|
||||||
|
|
||||||
COPY SConstruct ${OPENPILOT_PATH} |
|
||||||
|
|
||||||
COPY ./openpilot ${OPENPILOT_PATH}/openpilot |
|
||||||
COPY ./body ${OPENPILOT_PATH}/body |
|
||||||
COPY ./third_party ${OPENPILOT_PATH}/third_party |
|
||||||
COPY ./site_scons ${OPENPILOT_PATH}/site_scons |
|
||||||
COPY ./laika_repo ${OPENPILOT_PATH}/laika_repo |
|
||||||
RUN ln -s ${OPENPILOT_PATH}/laika_repo/laika/ ${OPENPILOT_PATH}/laika |
|
||||||
COPY ./rednose ${OPENPILOT_PATH}/rednose |
|
||||||
COPY ./rednose_repo ${OPENPILOT_PATH}/rednose_repo |
|
||||||
COPY ./tools ${OPENPILOT_PATH}/tools |
|
||||||
COPY ./release ${OPENPILOT_PATH}/release |
|
||||||
COPY ./common ${OPENPILOT_PATH}/common |
|
||||||
COPY ./opendbc ${OPENPILOT_PATH}/opendbc |
|
||||||
COPY ./cereal ${OPENPILOT_PATH}/cereal |
|
||||||
COPY ./panda ${OPENPILOT_PATH}/panda |
|
||||||
COPY ./selfdrive ${OPENPILOT_PATH}/selfdrive |
|
||||||
COPY ./system ${OPENPILOT_PATH}/system |
|
||||||
COPY ./*.md ${OPENPILOT_PATH}/ |
|
||||||
|
|
||||||
RUN --mount=type=bind,source=.ci_cache/scons_cache,target=/tmp/scons_cache,rw scons -j$(nproc) --cache-readonly |
|
||||||
|
|
||||||
RUN apt update && apt install doxygen -y |
|
||||||
COPY ./docs ${OPENPILOT_PATH}/docs |
|
||||||
RUN git init . |
|
||||||
WORKDIR ${OPENPILOT_PATH}/docs |
|
||||||
RUN make html |
|
||||||
|
|
||||||
FROM nginx:1.21 |
|
||||||
COPY --from=0 /tmp/openpilot/build/docs/html /usr/share/nginx/html |
|
||||||
COPY ./docs/docker/nginx.conf /etc/nginx/conf.d/default.conf |
|
@ -1,15 +0,0 @@ |
|||||||
server { |
|
||||||
listen 80; |
|
||||||
listen [::]:80; |
|
||||||
server_name localhost; |
|
||||||
|
|
||||||
gzip on; |
|
||||||
gzip_types text/html text/plain text/css text/xml text/javascript application/javascript application/x-javascript; |
|
||||||
gzip_min_length 1024; |
|
||||||
gzip_vary on; |
|
||||||
|
|
||||||
root /usr/share/nginx/html; |
|
||||||
location / { |
|
||||||
try_files $uri $uri/ /index.html; |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,50 @@ |
|||||||
|
import numpy as np |
||||||
|
from typing import List, Optional, Tuple, Any |
||||||
|
|
||||||
|
|
||||||
|
class NPQueue: |
||||||
|
def __init__(self, maxlen: int, rowsize: int) -> None: |
||||||
|
self.maxlen = maxlen |
||||||
|
self.arr = np.empty((0, rowsize)) |
||||||
|
|
||||||
|
def __len__(self) -> int: |
||||||
|
return len(self.arr) |
||||||
|
|
||||||
|
def append(self, pt: List[float]) -> None: |
||||||
|
if len(self.arr) < self.maxlen: |
||||||
|
self.arr = np.append(self.arr, [pt], axis=0) |
||||||
|
else: |
||||||
|
self.arr[:-1] = self.arr[1:] |
||||||
|
self.arr[-1] = pt |
||||||
|
|
||||||
|
|
||||||
|
class PointBuckets: |
||||||
|
def __init__(self, x_bounds: List[Tuple[float, float]], min_points: List[float], min_points_total: int, points_per_bucket: int, rowsize: int) -> None: |
||||||
|
self.x_bounds = x_bounds |
||||||
|
self.buckets = {bounds: NPQueue(maxlen=points_per_bucket, rowsize=rowsize) for bounds in x_bounds} |
||||||
|
self.buckets_min_points = dict(zip(x_bounds, min_points, strict=True)) |
||||||
|
self.min_points_total = min_points_total |
||||||
|
|
||||||
|
def bucket_lengths(self) -> List[int]: |
||||||
|
return [len(v) for v in self.buckets.values()] |
||||||
|
|
||||||
|
def __len__(self) -> int: |
||||||
|
return sum(self.bucket_lengths()) |
||||||
|
|
||||||
|
def is_valid(self) -> bool: |
||||||
|
individual_buckets_valid = all(len(v) >= min_pts for v, min_pts in zip(self.buckets.values(), self.buckets_min_points.values(), strict=True)) |
||||||
|
total_points_valid = self.__len__() >= self.min_points_total |
||||||
|
return individual_buckets_valid and total_points_valid |
||||||
|
|
||||||
|
def add_point(self, x: float, y: float, bucket_val: float) -> None: |
||||||
|
raise NotImplementedError |
||||||
|
|
||||||
|
def get_points(self, num_points: Optional[int] = None) -> Any: |
||||||
|
points = np.vstack([x.arr for x in self.buckets.values()]) |
||||||
|
if num_points is None: |
||||||
|
return points |
||||||
|
return points[np.random.choice(np.arange(len(points)), min(len(points), num_points), replace=False)] |
||||||
|
|
||||||
|
def load_points(self, points: List[List[float]]) -> None: |
||||||
|
for point in points: |
||||||
|
self.add_point(*point) |
@ -1 +1 @@ |
|||||||
ed2d58ec217fafb7b6b8f5e27ec622acd9e734f4 |
f851c7e7f90eff828a59444d20fac5df8cd7ae0c |
||||||
|
@ -1,5 +1,4 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
cd "$(dirname "$0")" |
cd "$(dirname "$0")" |
||||||
export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" |
|
||||||
export QT_QPA_PLATFORM="offscreen" |
export QT_QPA_PLATFORM="offscreen" |
||||||
exec ./_soundd |
exec ./_soundd |
||||||
|
@ -1,5 +1,4 @@ |
|||||||
#!/bin/sh |
#!/bin/sh |
||||||
cd "$(dirname "$0")" |
cd "$(dirname "$0")" |
||||||
export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" |
|
||||||
export QT_DBL_CLICK_DIST=150 |
export QT_DBL_CLICK_DIST=150 |
||||||
exec ./_ui |
exec ./_ui |
||||||
|
@ -1 +1 @@ |
|||||||
_sensord |
sensord |
||||||
|
@ -1,4 +0,0 @@ |
|||||||
#!/bin/sh |
|
||||||
cd "$(dirname "$0")" |
|
||||||
export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" |
|
||||||
exec ./_sensord |
|
@ -1 +1 @@ |
|||||||
Subproject commit d8dda2af3afcef0bb772fff580cfa8b3eabf7f69 |
Subproject commit 5a4a62ecaecb2bfd8bb0f77033aca46df4e668bd |
Loading…
Reference in new issue