forked from commaai/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
4,880 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# How to contribute | ||
|
||
Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use. | ||
|
||
Most open source development activity is coordinated through our [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/) | ||
|
||
## Getting Started | ||
|
||
* Join our [Discord](https://discord.comma.ai) | ||
* Make sure you have a [GitHub account](https://github.com/signup/free) | ||
* Fork [our repositories](https://github.com/commaai) on GitHub | ||
|
||
## Testing | ||
|
||
### Local Testing | ||
|
||
You can test your changes on your machine by running `run_docker_tests.sh`. This will run some automated tests in docker against your code. | ||
|
||
### Automated Testing | ||
|
||
All PRs are automatically checked by travis. Check out `.travis.yml` for what travis runs. Any new tests sould be added to travis. | ||
|
||
### Code Style and Linting | ||
|
||
Code is automatically check for style by travis as part of the automated tests. You can also run these yourself by running `check_code_quality.sh`. | ||
|
||
## Car Ports (openpilot) | ||
|
||
We've released a [Model Port guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for porting to Toyota/Lexus models. | ||
|
||
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty. See our bounties at [comma.ai/bounties.html](https://comma.ai/bounties.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
FROM ubuntu:16.04 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
bzip2 \ | ||
clang \ | ||
cmake \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
libarchive-dev \ | ||
libbz2-dev \ | ||
libcurl4-openssl-dev \ | ||
libeigen3-dev \ | ||
libffi-dev \ | ||
libglew-dev \ | ||
libglfw3-dev \ | ||
libglib2.0-0 \ | ||
liblzma-dev \ | ||
libmysqlclient-dev \ | ||
libomp-dev \ | ||
libopencv-dev \ | ||
libssl-dev \ | ||
libsqlite3-dev \ | ||
libusb-1.0-0-dev \ | ||
libzmq5-dev \ | ||
locales \ | ||
ocl-icd-libopencl1 \ | ||
ocl-icd-opencl-dev \ | ||
opencl-headers \ | ||
python-dev \ | ||
python-pip \ | ||
screen \ | ||
sudo \ | ||
vim \ | ||
wget | ||
|
||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
COPY ./external/opencl /tmp/openpilot/external/opencl | ||
RUN dpkg -i /tmp/openpilot/external/opencl/*.deb | ||
RUN mkdir -p /etc/OpenCL/vendors; cp /tmp/openpilot/external/opencl/intel.icd /etc/OpenCL/vendors/intel.icd | ||
|
||
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | ||
|
||
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}" | ||
RUN pyenv install 3.7.3 | ||
RUN pyenv global 3.7.3 | ||
RUN pyenv rehash | ||
|
||
RUN pip install pipenv==2018.11.26 | ||
|
||
COPY Pipfile /tmp/ | ||
COPY Pipfile.lock /tmp/ | ||
|
||
RUN python --version | ||
RUN cd /tmp && pipenv install --system --deploy --dev | ||
|
||
RUN mkdir -p /home/batman | ||
ENV HOME /home/batman | ||
ENV PATH /tmp/openpilot/external/capnp/bin/:${PATH} | ||
ENV PYTHONPATH /tmp/openpilot:${PYTHONPATH} | ||
|
||
COPY ./apk /tmp/openpilot/apk | ||
COPY ./cereal /tmp/openpilot/cereal | ||
COPY ./common /tmp/openpilot/common | ||
COPY ./external /tmp/openpilot/external | ||
COPY ./laika /tmp/openpilot/laika | ||
COPY ./models /tmp/openpilot/models | ||
COPY ./opendbc /tmp/openpilot/opendbc | ||
COPY ./tools /tmp/openpilot/tools | ||
COPY ./panda /tmp/openpilot/panda | ||
COPY ./phonelibs /tmp/openpilot/phonelibs | ||
COPY ./pyextra /tmp/openpilot/pyextra | ||
COPY ./release /tmp/openpilot/release | ||
COPY ./selfdrive /tmp/openpilot/selfdrive | ||
|
||
COPY ./xx/__init__.py /tmp/openpilot/xx/__init__.py | ||
COPY ./xx/chffr /tmp/openpilot/xx/chffr | ||
COPY ./xx/pipeline /tmp/openpilot/xx/pipeline | ||
COPY ./xx/uncommon /tmp/openpilot/xx/uncommon | ||
COPY ./xx/tools/__init__.py /tmp/openpilot/xx/tools/__init__.py | ||
COPY ./xx/tools/rldriving /tmp/openpilot/xx/tools/rldriving | ||
COPY ./xx/models /tmp/openpilot/xx/models/ | ||
COPY ./xx/tools/mlmonitoring /tmp/openpilot/xx/tools/mlmonitoring | ||
COPY ./xx/tools/reporter /tmp/openpilot/xx/tools/reporter | ||
|
||
COPY flake8_openpilot.sh /tmp/openpilot/flake8_openpilot.sh | ||
COPY pylint_openpilot.sh /tmp/openpilot/pylint_openpilot.sh | ||
COPY .pylintrc /tmp/openpilot/.pylintrc | ||
|
||
# Azure keys | ||
ENV EXTERNAL 1 | ||
ENV CI 1 | ||
ENV AZUTIL_KEYS /tmp/openpilot/selfdrive/test/commadataci.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
FROM ubuntu:16.04 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
autoconf \ | ||
build-essential \ | ||
bzip2 \ | ||
clang \ | ||
cmake \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
libarchive-dev \ | ||
libbz2-dev \ | ||
libcurl4-openssl-dev \ | ||
libeigen3-dev \ | ||
libffi-dev \ | ||
libglew-dev \ | ||
libgles2-mesa-dev \ | ||
libglfw3-dev \ | ||
libglib2.0-0 \ | ||
liblzma-dev \ | ||
libmysqlclient-dev \ | ||
libomp-dev \ | ||
libopencv-dev \ | ||
libssl-dev \ | ||
libsqlite3-dev \ | ||
libtool \ | ||
libusb-1.0-0-dev \ | ||
libzmq5-dev \ | ||
locales \ | ||
ocl-icd-libopencl1 \ | ||
ocl-icd-opencl-dev \ | ||
opencl-headers \ | ||
python-dev \ | ||
python-pip \ | ||
screen \ | ||
sudo \ | ||
vim \ | ||
wget | ||
|
||
|
||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen | ||
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}" | ||
RUN pyenv install 3.7.3 | ||
RUN pyenv global 3.7.3 | ||
RUN pyenv rehash | ||
|
||
RUN pip install pipenv==2018.11.26 | ||
|
||
COPY Pipfile /tmp/ | ||
COPY Pipfile.lock /tmp/ | ||
|
||
RUN python --version | ||
RUN cd /tmp && pipenv install --system --deploy | ||
|
||
# Install subset of dev dependencies needed for CI | ||
RUN pip install matplotlib==3.1.1 dictdiffer==0.8.0 fastcluster==1.1.25 aenum==2.2.1 scipy==1.3.1 lru-dict==1.1.6 tenacity==5.1.1 azure-common==1.1.23 azure-nspkg==3.0.2 azure-storage-blob==2.1.0 azure-storage-common==2.1.0 azure-storage-nspkg==3.1.0 pycurl==7.43.0.3 | ||
|
||
COPY phonelibs/install_capnp.sh /tmp/install_capnp.sh | ||
RUN /tmp/install_capnp.sh | ||
|
||
RUN git clone --branch v0.7 https://github.com/commaai/openpilot-tools.git /tmp/openpilot/tools | ||
|
||
ENV PYTHONPATH /tmp/openpilot:${PYTHONPATH} | ||
COPY ./.pylintrc /tmp/openpilot/.pylintrc | ||
COPY ./common /tmp/openpilot/common | ||
COPY ./cereal /tmp/openpilot/cereal | ||
COPY ./opendbc /tmp/openpilot/opendbc | ||
COPY ./selfdrive /tmp/openpilot/selfdrive | ||
COPY ./phonelibs /tmp/openpilot/phonelibs | ||
COPY ./pyextra /tmp/openpilot/pyextra | ||
COPY ./panda /tmp/openpilot/panda | ||
|
||
COPY SConstruct /tmp/openpilot/SConstruct | ||
|
||
RUN mkdir -p /tmp/openpilot/selfdrive/test/out | ||
RUN cd /tmp/openpilot && scons -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
FROM ubuntu:16.04 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
bzip2 \ | ||
clang \ | ||
cmake \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
libarchive-dev \ | ||
libbz2-dev \ | ||
libcurl4-openssl-dev \ | ||
libeigen3-dev \ | ||
libffi-dev \ | ||
libglew-dev \ | ||
libgles2-mesa-dev \ | ||
libglfw3-dev \ | ||
libglib2.0-0 \ | ||
liblzma-dev \ | ||
libmysqlclient-dev \ | ||
libomp-dev \ | ||
libopencv-dev \ | ||
libssl-dev \ | ||
libsqlite3-dev \ | ||
libusb-1.0-0-dev \ | ||
libzmq5-dev \ | ||
locales \ | ||
ocl-icd-libopencl1 \ | ||
ocl-icd-opencl-dev \ | ||
opencl-headers \ | ||
python-dev \ | ||
python-pip \ | ||
screen \ | ||
sudo \ | ||
vim \ | ||
wget | ||
|
||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
|
||
COPY ./external/opencl /tmp/openpilot/external/opencl | ||
RUN dpkg -i /tmp/openpilot/external/opencl/*.deb | ||
RUN mkdir -p /etc/OpenCL/vendors; cp /tmp/openpilot/external/opencl/intel.icd /etc/OpenCL/vendors/intel.icd | ||
|
||
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash | ||
|
||
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}" | ||
RUN pyenv install 3.7.3 | ||
RUN pyenv global 3.7.3 | ||
RUN pyenv rehash | ||
|
||
RUN pip install pipenv==2018.11.26 | ||
|
||
COPY Pipfile /tmp/ | ||
COPY Pipfile.lock /tmp/ | ||
|
||
RUN python --version | ||
RUN cd /tmp && pipenv install --system --deploy | ||
|
||
# Install subset of dev dependencies needed for CI | ||
RUN pip install matplotlib==3.1.1 dictdiffer==0.8.0 fastcluster==1.1.25 aenum==2.2.1 scipy==1.3.1 lru-dict==1.1.6 tenacity==5.1.1 azure-common==1.1.23 azure-nspkg==3.0.2 azure-storage-blob==2.1.0 azure-storage-common==2.1.0 azure-storage-nspkg==3.1.0 pycurl==7.43.0.3 | ||
|
||
|
||
RUN mkdir -p /home/batman | ||
ENV HOME /home/batman | ||
ENV PATH /tmp/openpilot/external/capnp/bin/:${PATH} | ||
ENV PYTHONPATH /tmp/openpilot:${PYTHONPATH} | ||
|
||
COPY ./apk /tmp/openpilot/apk | ||
COPY ./cereal /tmp/openpilot/cereal | ||
COPY ./common /tmp/openpilot/common | ||
COPY ./external /tmp/openpilot/external | ||
COPY ./laika /tmp/openpilot/laika | ||
COPY ./models /tmp/openpilot/models | ||
COPY ./opendbc /tmp/openpilot/opendbc | ||
COPY ./tools /tmp/openpilot/tools | ||
COPY ./panda /tmp/openpilot/panda | ||
COPY ./phonelibs /tmp/openpilot/phonelibs | ||
COPY ./pyextra /tmp/openpilot/pyextra | ||
COPY ./release /tmp/openpilot/release | ||
COPY ./selfdrive /tmp/openpilot/selfdrive | ||
|
||
COPY ./xx/__init__.py /tmp/openpilot/xx/__init__.py | ||
COPY ./xx/chffr /tmp/openpilot/xx/chffr | ||
COPY ./xx/pipeline /tmp/openpilot/xx/pipeline | ||
COPY ./xx/uncommon /tmp/openpilot/xx/uncommon | ||
COPY ./xx/tools/__init__.py /tmp/openpilot/xx/tools/__init__.py | ||
COPY ./xx/tools/rldriving /tmp/openpilot/xx/tools/rldriving | ||
COPY ./xx/models /tmp/openpilot/xx/models/ | ||
|
||
COPY flake8_openpilot.sh /tmp/openpilot/flake8_openpilot.sh | ||
COPY pylint_openpilot.sh /tmp/openpilot/pylint_openpilot.sh | ||
COPY .pylintrc /tmp/openpilot/.pylintrc | ||
COPY SConstruct /tmp/openpilot/SConstruct | ||
|
||
# Azure keys | ||
ENV EXTERNAL 1 | ||
ENV CI 1 | ||
ENV AZUTIL_KEYS /tmp/openpilot/selfdrive/test/commadataci.json | ||
|
||
RUN cd /tmp/openpilot && scons -c && scons -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
pipeline { | ||
agent any | ||
environment { | ||
AUTHOR = """${sh( | ||
returnStdout: true, | ||
script: "git --no-pager show -s --format='%an' ${GIT_COMMIT}" | ||
).trim()}""" | ||
GIT_COMMIT_DESC = """${sh( | ||
returnStdout: true, | ||
script: "git log --format=%B -n 1 ${GIT_COMMIT}" | ||
).trim()}""" | ||
GIT_COMMIT_SHORT = """${sh( | ||
returnStdout: true, | ||
script: "git rev-parse --short=8 ${GIT_COMMIT}" | ||
).trim()}""" | ||
COMMA_JWT = credentials('athena-test-jwt') | ||
} | ||
stages { | ||
stage('Builds') { | ||
parallel { | ||
stage('EON Build/Test') { | ||
steps { | ||
lock(resource: "", label: 'eon', inversePrecedence: true, variable: 'eon_name', quantity: 1){ | ||
timeout(time: 90, unit: 'MINUTES') { | ||
dir(path: 'selfdrive/test') { | ||
ansiColor('xterm') { | ||
sh './release_build.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
stage('LEON Build/Test') { | ||
steps { | ||
lock(resource: "", label: 'leon', inversePrecedence: true, variable: 'leon_name', quantity: 1){ | ||
timeout(time: 90, unit: 'MINUTES') { | ||
dir(path: 'selfdrive/test') { | ||
ansiColor('xterm') { | ||
sh './release_build.py' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
failure { | ||
slackSend(color:'danger', message:"Failed: one » ${env.JOB_NAME} [${env.BUILD_NUMBER}] (<${env.RUN_DISPLAY_URL}|Open>)\n- ${env.GIT_COMMIT_DESC} (<https://github.com/commaai/one/commit/${env.GIT_COMMIT}|${env.GIT_COMMIT_SHORT}> on ${env.GIT_BRANCH} by ${env.CHANGE_AUTHOR})") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright (c) 2018, Comma.ai, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
code_dir := $(shell pwd) | ||
|
||
# TODO: Add a global build system | ||
|
||
.PHONY: all | ||
all: | ||
cd selfdrive && PYTHONPATH=$(code_dir) PREPAREONLY=1 ./manager.py | ||
|
Oops, something went wrong.