Skip to content

Instantly share code, notes, and snippets.

@PeterMitrano
Last active October 20, 2021 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeterMitrano/1ff99a0733b30d4ca3db89f242b4a47f to your computer and use it in GitHub Desktop.
Save PeterMitrano/1ff99a0733b30d4ca3db89f242b4a47f to your computer and use it in GitHub Desktop.
AWS setup
# NOTE: if using this outside ec2, you will need to copy your ~/.aws/credentials into the computer first
sudo apt update
sudo apt install -y g++ build-essential cmake git htop tree tmux curl openssh-server imagemagick maim vim-gtk3 i3 python3-pip python3-virtualenv libappindicator3-dev castxml qt5-style-plugins trash-cli checkinstall gparted net-tools rename libreadline-dev imagemagick policykit-1-gnome
sudo apt upgrade
git config --global user.email "peter@`echo $HOSTNAME`"
git config --global user.name "peter"
sudo apt-get install ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
sudo apt install -y nvidia-cuda-toolkit
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install -y ros-noetic-desktop-full python3-rosdep python3-catkin-tools python3-osrf-pycommon python3-wstool
sudo rosdep init
rosdep update
# install AWS cli v2
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws s3 cp s3://armlab-ec2/.bashrc_extras .
cat .bashrc_extras >> ~/.bashrc
aws s3 cp s3://armlab-ec2/git-prompt.sh .
source ~/.bashrc
# download cudnn
aws s3 cp s3://armlab-ec2/cudnn-10.2-linux-x64-v7.6.5.32.tgz .
tar -xzvf cudnn-*.tgz
sudo mkdir -p /usr/local/cuda/include
sudo mkdir -p /usr/local/cuda/lib64
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc
sudo cp cuda/include/cudnn*.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
# create catkin ws
source /opt/ros/noetic/setup.bash
mkdir catkin_ws
cd catkin_ws
mkdir src
cd src
catkin_init_workspace
virtualenv --system-site-packages venv
source venv/bin/activate
aws s3 cp s3://armlab-ec2/requirements.txt .
pip install -r requirements.txt
# generate SSH keys and add them to my account?
ssh-keygen
# get packages and build
aws s3 cp s3://armlab-ec2/.rosinstall .
wstool update
rosdep update
rosdep install -y -r --from-paths . --ignore-src
cd ..
catkin config -DOMPL_BUILD_PYBINDINGS=ON -DCATKIN_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release --merge-devel
catkin build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment