From fe8798a38d3a0aaec97eeaafd37e84f956bb60c2 Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Thu, 6 Apr 2023 13:02:15 +0530 Subject: [PATCH 1/7] delete commandlinetools.zip also --- scripts/install-flowpilot-desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-flowpilot-desktop b/scripts/install-flowpilot-desktop index c53b529a..d109020f 100755 --- a/scripts/install-flowpilot-desktop +++ b/scripts/install-flowpilot-desktop @@ -30,7 +30,7 @@ wget -q --show-progress --no-clobber --tries=5 https://dl.google.com/android/rep unzip commandlinetools-linux-8092744_latest.zip mkdir -p ~/Android/Sdk/cmdline-tools/latest mv cmdline-tools/* ~/Android/Sdk/cmdline-tools/latest/ -rm -rf cmdline-tools +rm -rf cmdline-tools commandlinetools-linux-8092744_latest.zip echo 'export ANDROID_SDK_ROOT=$HOME/Android/Sdk' >> ~/.bashrc echo 'export PATH=$PATH:$HOME/Android/Sdk/cmdline-tools/latest/bin' >> ~/.bashrc export ANDROID_SDK_ROOT=$HOME/Android/Sdk From 11e4e078811a8bebf344e9a73e188a64a1c6e48a Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Fri, 7 Apr 2023 00:28:49 +0530 Subject: [PATCH 2/7] update sentry link --- requirements.txt | 2 +- selfdrive/sentry.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 47c5d7a8..15f500e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,4 +28,4 @@ smbus2==0.4.2 pycurl==7.45.1 tenacity==8.0.1 atomicwrites==1.4.0 -sentry-sdk==1.10.1 +sentry-sdk==1.19.1 diff --git a/selfdrive/sentry.py b/selfdrive/sentry.py index 6c3a5182..8cfa5f26 100644 --- a/selfdrive/sentry.py +++ b/selfdrive/sentry.py @@ -15,7 +15,7 @@ def sentry_init() -> None: env = get_short_branch() sentry_sdk.init( - dsn="https://f58fa71b8d924fa79688f57ad81a6e4f@sentry.flowdrive.ai/2", + dsn="https://faca66e781974e26b6c0f6be67a4009f@o4504388423450624.ingest.sentry.io/4504965695471616", ignore_errors=["KeyboardInterrupt"], traces_sample_rate=1.0, environment=env, From 5bb657829824cf2a7a3527999d0be8a8361da069 Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Fri, 7 Apr 2023 01:07:44 +0530 Subject: [PATCH 3/7] improve desktop installation script --- scripts/install-flowpilot-desktop | 43 ++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/scripts/install-flowpilot-desktop b/scripts/install-flowpilot-desktop index d109020f..2adc76c2 100755 --- a/scripts/install-flowpilot-desktop +++ b/scripts/install-flowpilot-desktop @@ -26,29 +26,52 @@ fail() { # install android and java sdk sudo apt update sudo apt install -y openjdk-11-jdk git -wget -q --show-progress --no-clobber --tries=5 https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip -unzip commandlinetools-linux-8092744_latest.zip -mkdir -p ~/Android/Sdk/cmdline-tools/latest -mv cmdline-tools/* ~/Android/Sdk/cmdline-tools/latest/ -rm -rf cmdline-tools commandlinetools-linux-8092744_latest.zip + +if ! [ -e ./commandlinetools-linux-8092744_latest.zip ]; then + wget -q --show-progress --no-clobber --tries=5 https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip + unzip commandlinetools-linux-8092744_latest.zip +else + info "Skipping Command Line tools download as it is already downloaded." +fi + +if ! [ -e ~/Android ]; then + mkdir -p ~/Android/Sdk/cmdline-tools/latest + mv cmdline-tools/* ~/Android/Sdk/cmdline-tools/latest/ + rm -rf cmdline-tools +else + info "Skipping Android SDK installation as it is already installed." +fi + echo 'export ANDROID_SDK_ROOT=$HOME/Android/Sdk' >> ~/.bashrc echo 'export PATH=$PATH:$HOME/Android/Sdk/cmdline-tools/latest/bin' >> ~/.bashrc + export ANDROID_SDK_ROOT=$HOME/Android/Sdk export PATH=$PATH:$HOME/Android/Sdk/cmdline-tools/latest/bin + yes | sdkmanager --licenses sdkmanager --install "platform-tools" sdkmanager --install "build-tools;32.0.0" # get python 3.9 -DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata +DEBIAN_FRONTEND=noninteractive sudo apt-get install -y tzdata sudo apt install -y software-properties-common yes | sudo add-apt-repository ppa:deadsnakes/ppa sudo apt install -y python3.9 python3.9-dev python3.9-distutils # get flowpilot -cd ~/ && git clone https://github.com/flowdriveai/flowpilot.git -cd flowpilot && git submodule update --init -pip install pipenv +if ! [ -e ~/flowpilot ]; then + cd ~/ && git clone https://github.com/flowdriveai/flowpilot.git + cd flowpilot && git submodule update --init + python3.9 -m pip install pipenv + python3.9 -m pipenv shell + ./get_dependencies.sh + ./flowpilot_env.sh + +else + cd ~/flowpilot && git pull origin master && git submodule update --init + ./get_dependencies.sh + ./flowpilot_env.sh +fi -success "Flowpilot successfully installed." +success "Flowpilot successfully installed." \ No newline at end of file From 7b88e4ccf1cfb0b1516c9e77d6fdc256fb1448d2 Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Sun, 9 Apr 2023 11:24:46 +0530 Subject: [PATCH 4/7] rewrite existing android sdk msg --- scripts/install-flowpilot-desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-flowpilot-desktop b/scripts/install-flowpilot-desktop index 2adc76c2..5dedbb7e 100755 --- a/scripts/install-flowpilot-desktop +++ b/scripts/install-flowpilot-desktop @@ -39,7 +39,7 @@ if ! [ -e ~/Android ]; then mv cmdline-tools/* ~/Android/Sdk/cmdline-tools/latest/ rm -rf cmdline-tools else - info "Skipping Android SDK installation as it is already installed." + info "Skipping Android SDK installation, ~/Android already exists" fi echo 'export ANDROID_SDK_ROOT=$HOME/Android/Sdk' >> ~/.bashrc From b7d40149a494b2fcb091a753049b01f9cbfded2d Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Mon, 28 Aug 2023 14:45:17 +0530 Subject: [PATCH 5/7] add docker support --- Dockerfile | 108 ++++++++++++++++++++++++++++++++++++++++++++ SConscript | 4 +- launch_flowpilot.sh | 48 ++++++++++---------- run_docker.sh | 7 +++ 4 files changed, 142 insertions(+), 25 deletions(-) create mode 100644 Dockerfile create mode 100755 run_docker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2342803f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,108 @@ +FROM ubuntu:20.04 + +ENV PYTHONUNBUFFERED 1 +ENV DEBIAN_FRONTEND="noninteractive" + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + sudo \ + ssh \ + tzdata \ + locales \ + git \ + nano \ + rsync \ + clang \ + libzmq3-dev \ + cmake \ + libjson11-1 \ + libjson11-1-dev \ + liblmdb-dev \ + libusb-1.0-0-dev \ + dfu-util \ + gcc-arm-none-eabi \ + libcurl4-openssl-dev \ + libssl-dev \ + ffmpeg \ + libeigen3-dev \ + software-properties-common \ + openjdk-11-jdk \ + python3.9 \ + python3.9-dev \ + python3.9-distutils \ + python3-pip \ + wget \ + unzip \ + make \ + libssl-dev \ + gcc \ + autoconf \ + automake \ + libtool \ + g++ \ + scons + +RUN yes | sudo add-apt-repository ppa:ubuntu-toolchain-r/test +RUN apt upgrade libstdc++6 -y +# RUN apt install libstdc++6 -y + +RUN apt remove locales -y +RUN wget http://launchpadlibrarian.net/560614488/libc6_2.34-0ubuntu3_amd64.deb +RUN dpkg -i libc6_2.34-0ubuntu3_amd64.deb +RUN rm -rf libc6_2.34-0ubuntu3_amd64.deb + +# 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 mkdir -p /Android/Sdk/cmdline-tools/latest +RUN wget -q --show-progress --no-clobber --tries=5 https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip +RUN unzip commandlinetools-linux-8092744_latest.zip +RUN mv cmdline-tools/* /Android/Sdk/cmdline-tools/latest/ +RUN rm -rf cmdline-tools commandlinetools-linux-8092744_latest.zip +RUN echo 'export ANDROID_SDK_ROOT=/Android/Sdk' +RUN echo 'export PATH=$PATH:/Android/Sdk/cmdline-tools/latest/bin' +RUN alias sdkmanager=/Android/Sdk/cmdline-tools/latest/bin/sdkmanager +RUN yes | /Android/Sdk/cmdline-tools/latest/bin/sdkmanager --licenses +RUN /Android/Sdk/cmdline-tools/latest/bin/sdkmanager --install "platform-tools" +RUN /Android/Sdk/cmdline-tools/latest/bin/sdkmanager --install "build-tools;32.0.0" +RUN yes | sudo add-apt-repository ppa:deadsnakes/ppa + +WORKDIR /tmp +RUN git clone https://github.com/capnproto/capnproto.git +WORKDIR /tmp/capnproto +RUN git checkout tags/v0.8.0 +WORKDIR /tmp/capnproto/c++ +RUN autoreconf -i +RUN ./configure +RUN make -j6 check +RUN sudo make install + +RUN python3.9 -m pip install \ + pipenv \ + numpy \ + pycryptodome +RUN pipenv --python 3.9 + +COPY . /flowpilot + +WORKDIR /flowpilot/libs/capnpc-java +RUN \ + if [ ! -d capnproto-java/ ]; \ + then \ + git clone https://github.com/capnproto/capnproto-java.git $DIR/capnproto-java; \ + fi +WORKDIR /flowpilot/libs/capnpc-java/capnproto-java +RUN git checkout 81d18463a8f3c98f6d21d4eae27caaca6bace4f7 +RUN make +RUN sudo make install + +WORKDIR /flowpilot +RUN pipenv run pip install pkgconfig==1.5.5 Cython==0.29.32 +RUN pipenv run pip install pycapnp==1.0.0 +RUN pipenv run pip install -r requirements.txt +RUN touch .deb_update +RUN pipenv run scons +ENV ANDROID_SDK_ROOT=/Android/Sdk +RUN ./gradlew desktop:assemble \ No newline at end of file diff --git a/SConscript b/SConscript index 02263609..e26ebeff 100644 --- a/SConscript +++ b/SConscript @@ -11,5 +11,5 @@ gen_setup_files = [ env.Command(['.env'], ['flowpilot_env.sh'], './flowpilot_env.sh') env.Command([gen_setup_files], ['setup.py'], 'pip install -e .') -env.Command('.dep_update', ['get_dependencies.sh'], './get_dependencies.sh') -env.Command('.pip_update', ['requirements.txt'], 'pip install -r requirements.txt && touch .pip_update') +# env.Command('.dep_update', ['get_dependencies.sh'], './get_dependencies.sh') +# env.Command('.pip_update', ['requirements.txt'], 'pip install -r requirements.txt && touch .pip_update') diff --git a/launch_flowpilot.sh b/launch_flowpilot.sh index 8b9673c5..c8f55723 100755 --- a/launch_flowpilot.sh +++ b/launch_flowpilot.sh @@ -1,5 +1,5 @@ set -e -source ./.env +. ./.env export WIDE_ROAD_CAMERA_SOURCE="selfdrive/assets/fcam.avi" # no affect on android export ROAD_CAMERA_SOURCE="selfdrive/assets/tmp" # no affect on android @@ -17,25 +17,27 @@ export SIMULATION="1" ## android specific ## export USE_SNPE="0" # only works for snapdragon devices. - - -if ! command -v tmux &> /dev/null -then - echo "tmux could not be found, installing.." - sudo apt-get update - sudo apt-get install tmux - echo "set -g mouse on" >> .tmux.conf # enable mouse scrolling in tmux -fi - - -if pgrep -x "flowinit" > /dev/null - then - echo "another instance of flowinit is already running" - exit - else - # start a tmux pane - tmux new-session -d -s "flowpilot" "scons && flowinit" - tmux attach -t flowpilot -fi - -while true; do sleep 1; done +export DISPLAY=:1 + + +# if ! command -v tmux &> /dev/null +# then +# echo "tmux could not be found, installing.." +# sudo apt-get update +# sudo apt-get install tmux +# echo "set -g mouse on" >> .tmux.conf # enable mouse scrolling in tmux +# fi + + +# if pgrep -x "flowinit" > /dev/null +# then +# echo "another instance of flowinit is already running" +# exit +# else +# # start a tmux pane +# tmux new-session -d -s "flowpilot" "scons && flowinit" +# tmux attach -t flowpilot +# fi + +# while true; do sleep 1; done +scons && flowinit \ No newline at end of file diff --git a/run_docker.sh b/run_docker.sh new file mode 100755 index 00000000..c06bb440 --- /dev/null +++ b/run_docker.sh @@ -0,0 +1,7 @@ +xhost + +docker run -it --rm \ + -e DISPLAY:$DISPLAY \ + -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ + --device=/dev/dri:/dev/dri \ + --mount type=volume,src=flowdrive,target=/root/.flowdrive \ + flowpilot \ No newline at end of file From 1414eb3792ceef9d56916bb9b9d30e47809164e1 Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Mon, 28 Aug 2023 14:56:05 +0530 Subject: [PATCH 6/7] update requirements.txt --- requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/requirements.txt b/requirements.txt index 15f500e8..7099fe88 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,3 +29,8 @@ pycurl==7.45.1 tenacity==8.0.1 atomicwrites==1.4.0 sentry-sdk==1.19.1 +sympy==1.11.1 +certifi==2022.12.7 +hatanaka==2.8.0 +boto3==1.26.113 +inputs==0.5 \ No newline at end of file From bb38e6c4cb8f22228f068df7edb46742a27a609d Mon Sep 17 00:00:00 2001 From: Raghav Prabhakar Date: Wed, 30 Aug 2023 22:22:52 +0530 Subject: [PATCH 7/7] add dockerfile --- Dockerfile | 10 +--------- launch_flowpilot.sh | 44 +++++++++++++++++++++----------------------- run_docker.sh | 4 ++-- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2342803f..bb1f26ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,15 +11,12 @@ RUN apt-get update && \ locales \ git \ nano \ - rsync \ clang \ libzmq3-dev \ - cmake \ libjson11-1 \ libjson11-1-dev \ liblmdb-dev \ libusb-1.0-0-dev \ - dfu-util \ gcc-arm-none-eabi \ libcurl4-openssl-dev \ libssl-dev \ @@ -40,22 +37,17 @@ RUN apt-get update && \ automake \ libtool \ g++ \ + tmux \ scons RUN yes | sudo add-apt-repository ppa:ubuntu-toolchain-r/test RUN apt upgrade libstdc++6 -y -# RUN apt install libstdc++6 -y RUN apt remove locales -y RUN wget http://launchpadlibrarian.net/560614488/libc6_2.34-0ubuntu3_amd64.deb RUN dpkg -i libc6_2.34-0ubuntu3_amd64.deb RUN rm -rf libc6_2.34-0ubuntu3_amd64.deb -# 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 mkdir -p /Android/Sdk/cmdline-tools/latest RUN wget -q --show-progress --no-clobber --tries=5 https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip RUN unzip commandlinetools-linux-8092744_latest.zip diff --git a/launch_flowpilot.sh b/launch_flowpilot.sh index c8f55723..ff096740 100755 --- a/launch_flowpilot.sh +++ b/launch_flowpilot.sh @@ -12,32 +12,30 @@ export ZMQ_MESSAGING_PROTOCOL="TCP" # TCP, INTER_PROCESS, SHARED_MEMORY #export DISCOVERABLE_PUBLISHERS="1" # if enabled, other devices on same network can access sup/pub data. #export DEVICE_ADDR="127.0.0.1" # connect to external device running flowpilot over same network. useful for livestreaming. -export SIMULATION="1" -#export FINGERPRINT="HONDA CIVIC 2016" +export SIMULATION="0" +export FINGERPRINT="HONDA CIVIC 2016" ## android specific ## export USE_SNPE="0" # only works for snapdragon devices. -export DISPLAY=:1 - - -# if ! command -v tmux &> /dev/null -# then -# echo "tmux could not be found, installing.." -# sudo apt-get update -# sudo apt-get install tmux -# echo "set -g mouse on" >> .tmux.conf # enable mouse scrolling in tmux -# fi - - -# if pgrep -x "flowinit" > /dev/null -# then -# echo "another instance of flowinit is already running" -# exit -# else -# # start a tmux pane -# tmux new-session -d -s "flowpilot" "scons && flowinit" -# tmux attach -t flowpilot -# fi + +if ! command -v tmux &> /dev/null +then + echo "tmux could not be found, installing.." + sudo apt-get update + sudo apt-get install tmux + echo "set -g mouse on" >> .tmux.conf # enable mouse scrolling in tmux +fi + + +if pgrep -x "flowinit" > /dev/null + then + echo "another instance of flowinit is already running" + exit + else + # start a tmux pane + tmux new-session -d -s "flowpilot" "scons && flowinit" + tmux attach -t flowpilot +fi # while true; do sleep 1; done scons && flowinit \ No newline at end of file diff --git a/run_docker.sh b/run_docker.sh index c06bb440..bbc04668 100755 --- a/run_docker.sh +++ b/run_docker.sh @@ -1,7 +1,7 @@ -xhost + +xhost + > /dev/null docker run -it --rm \ -e DISPLAY:$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ --device=/dev/dri:/dev/dri \ --mount type=volume,src=flowdrive,target=/root/.flowdrive \ - flowpilot \ No newline at end of file + raghav66/flowpilot:latest \ No newline at end of file