Skip to content

Instantly share code, notes, and snippets.

@daj
Forked from joezen777/rundeepraceronmac.md
Last active September 22, 2022 04:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save daj/ae0ab3853e2dffe2f9edced2327f6ee1 to your computer and use it in GitHub Desktop.
Save daj/ae0ab3853e2dffe2f9edced2327f6ee1 to your computer and use it in GitHub Desktop.
How to run DeepRacer locally on Mac

I took all my instructions from this page.  https://github.com/crr0004/deepracer

Here are the revised instructions for OSX (bold is console command)

  1. Change to a folder in terminal that is not case-sensitive. ~/ should be fine
  2. git clone --recurse-submodules https://github.com/crr0004/deepracer.git
  3. brew install minio/stable/minio -- you may need to install brew first -- /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. install vncviewer from here https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-6.19.325-MacOSX-x86_64.dmg
  5. cd rl_coach
  6. vim env.sh
  7. Replace
export S3_ENDPOINT_URL=http://$(hostname -i):9000

with

IPADDR=$(ifconfig|grep -e 'inet [197][970]' | awk '{print $2}')
export S3_ENDPOINT_URL=http://$IPADDR:9000
  1. add a "g" before readlink, so that it reads greadlink
  2. save and exit
  3. brew install coreutils
  4. the "source" command in linux means run a shell script. in Mac you can use "." instead of "source"
  5. . ./env.sh
  6. minio server data
  7. Browse to http://127.0.0.1:9000 and use the credentials the minio command gave you to login
  8. Create a bucket called bucket. Create a folder custom_files in the bucket. Upload the two local files from deepracer/custom_files into bucket\custom_files.
  9. Now edit the env.sh file again, this time replacing "minio" with the minio access key and "miniokey" with the access secret.
  10. Now you're all done setting up your fake s3 bucket/server
  11. Let's start Sagemaker setup, do Command T to open new terminal
  12. Go back to the "deepracer" or repo root folder cd ..
  13. python3 -m venv sagemaker_venv
  14. This assumes you already have python3 installed. You probably need both pythons installed, 2 and 3.
  15. . sagemaker_venv/bin/activate
  16. pip install PyYAML==3.11
  17. pip install urllib3==1.21.1
  18. pip install -U sagemaker-python-sdk/ awscli ipython pandas
  19. docker pull crr0004/sagemaker-rl-tensorflow:console
  20. docker tag crr0004/sagemaker-rl-tensorflow:console 520713654638.dkr.ecr.us-east-1.amazonaws.com/sagemaker-rl-tensorflow:coach0.11-cpu-py3
  21. I'm also assuming you already have docker installed and logged in with a docker account
  22. mkdir -p ~/.sagemaker && cp config.yaml ~/.sagemaker
  23. cd rl_coach
  24. export LOCAL_ENV_VAR_JSON_PATH=$(greadlink -f ./env_vars.json)
  25. cd ../.. to return to your folder holding the deepracer folder Git repo
  26. mkdir -p robo/container
  27. cd deepracer/rl_coach/
  28. ipython rl_deepracer_coach_robomaker.py
  29. Now SAGEMAKER LOCAL should be working. Now lets get Robomaker ready...
  30. Command T to open new terminal window
  31. cd ..
  32. . sagemaker_venv/bin/activate
  33. cd rl_coach
  34. . ./env.sh
  35. docker pull crr0004/deepracer_robomaker:console
  36. cd ..
  37. edit the robomaker.env file to also reference your local ip address and your aws key and secret
  38. docker run --rm --name dr --env-file ./robomaker.env --network sagemaker-local -p 8080:5900 -it crr0004/deepracer_robomaker:console
  39. Command Space, open vnc viewer, connect to 127.0.0.1:8080 to view Gazebo
@paskal
Copy link

paskal commented Dec 21, 2019

Thank you! It seems to be working.

upd: ...except map loading, I haven't figured out how to fix it. Docker tag step seems to be obsolete.

@ThirendarMin
Copy link

I havent been able to upload the custom files from my local to minIO console. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment