This repository has been archived by the owner on Dec 8, 2024. It is now read-only.
-
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.
Merge pull request #93 from LimaoC/add-run-script
Add run script
- Loading branch information
Showing
14 changed files
with
171 additions
and
39 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,24 @@ | ||
#!/bin/bash | ||
|
||
WARN="[\033[1;33mWARN\033[0m]" | ||
INFO="[\033[1;32mINFO\033[0m]" | ||
ERROR="[\033[1;31mERROR\033[0m]" | ||
|
||
SSHTARGET=$1 | ||
SSHUSER=$2 | ||
|
||
# Ready to rock | ||
cd scripts | ||
|
||
echo -e $INFO Bootstrapping the Pi | ||
if ! ./bootstrap.sh $SSHTARGET $SSHUSER; then | ||
exit 1; | ||
fi | ||
|
||
echo -e $INFO Deploying codebase | ||
if ! ./deploy.sh ../deploypaths.txt $SSHTARGET $SSHUSER; then | ||
exit 1; | ||
fi | ||
|
||
echo -e $INFO | ||
ssh $SSHUSER@$SSHTARGET 'bash -s' < run-garden.sh |
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
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
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,32 @@ | ||
#!/bin/bash | ||
ERROR="deploy[\033[1;31mERROR\033[0m]" | ||
|
||
sudo apt-get install build-essential \ | ||
cmake \ | ||
gfortran \ | ||
git \ | ||
wget \ | ||
curl \ | ||
graphicsmagick \ | ||
libgraphicsmagick1-dev \ | ||
libatlas-base-dev \ | ||
libavcodec-dev \ | ||
libavformat-dev \ | ||
libboost-all-dev \ | ||
libgtk2.0-dev \ | ||
libjpeg-dev \ | ||
liblapack-dev \ | ||
libswscale-dev \ | ||
pkg-config \ | ||
python3-dev \ | ||
python3-numpy \ | ||
python3-pip \ | ||
zip | ||
|
||
mkdir -p dlib | ||
git clone https://github.com/davisking/dlib.git dlib/ | ||
cd ./dlib | ||
if ! sudo python3.10 setup.py install --compiler-flags "-O3"; then | ||
echo -e "$ERROR Error building dlib" | ||
exit 1; | ||
fi |
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,23 @@ | ||
#!/bin/bash | ||
WARN="bootstrap[\033[1;33mWARN\033[0m]" | ||
INFO="bootstrap[\033[1;32mINFO\033[0m]" | ||
ERROR="bootstrap[\033[1;31mERROR\033[0m]" | ||
|
||
if ! sudo swapoff /var/swap; then | ||
echo -e $WARN Error with swapoff | ||
fi | ||
|
||
if ! sudo fallocate -l 2G /var/swap; then | ||
echo -e $ERROR Error with fallocate | ||
exit 1 | ||
fi | ||
|
||
if ! sudo mkswap /var/swap; then | ||
echo -e $ERROR Error with mkswap | ||
exit 1 | ||
fi | ||
|
||
if ! sudo swapon /var/swap; then | ||
echo -e $ERROR Error with swapon | ||
exit 1 | ||
fi |
File renamed without changes.
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,28 @@ | ||
#!/bin/bash | ||
|
||
# Usage: ./run.sh [--no-posture-model] | ||
|
||
ERROR="[\033[1;31mERROR\033[0m]" | ||
|
||
cd build/ | ||
|
||
if ! type -P python3.10 >/dev/null 2>&1; then | ||
echo -e "$ERROR python3.10 not found" | ||
exit 2 | ||
fi | ||
|
||
if ! type -P python3.11 >/dev/null 2>&1; then | ||
echo -e "$ERROR python3.11 not found" | ||
exit 2 | ||
fi | ||
|
||
if [ -n "$1" ]; then | ||
if [ $1 = "--no-posture-model" ]; then | ||
python3.10 client/overlord_overlord.py --no-posture-model | ||
else | ||
echo -e "$ERROR Unrecognised first argument: $1" | ||
exit 1 | ||
fi | ||
else | ||
python3.10 client/overlord_overlord.py | ||
fi |