From 0d0ac5845ed67e5dc6a5075cac6dd95285a60086 Mon Sep 17 00:00:00 2001 From: MihirGore23 Date: Wed, 28 Aug 2024 23:35:07 +0530 Subject: [PATCH] Update react component names --- .../{HumanDetectionRR.js => HumanDetRR.js} | 0 scripts/develop_academy.sh | 76 +++++++++++++++++++ 2 files changed, 76 insertions(+) rename exercises/static/exercises/human_detection_newmanager/react-components/{HumanDetectionRR.js => HumanDetRR.js} (100%) create mode 100644 scripts/develop_academy.sh diff --git a/exercises/static/exercises/human_detection_newmanager/react-components/HumanDetectionRR.js b/exercises/static/exercises/human_detection_newmanager/react-components/HumanDetRR.js similarity index 100% rename from exercises/static/exercises/human_detection_newmanager/react-components/HumanDetectionRR.js rename to exercises/static/exercises/human_detection_newmanager/react-components/HumanDetRR.js diff --git a/scripts/develop_academy.sh b/scripts/develop_academy.sh new file mode 100644 index 000000000..3ef74139e --- /dev/null +++ b/scripts/develop_academy.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +# Initialize variables with default values +ram_version="https://github.com/JdeRobot/RoboticsApplicationManager.git" +branch="humble-devel" +radi_version="humble" +gpu_mode="false" +nvidia="false" +compose_file="dev_humble_cpu" + +# Loop through the arguments using a while loop +while getopts ":r:b:i:g:n" opt; do + case $opt in + r) ram_version="$OPTARG" ;; + b) branch="$OPTARG" ;; + i) radi_version="$OPTARG" ;; + g) gpu_mode="true" ;; + n) nvidia="true" ;; + \?) echo "Invalid option: -$OPTARG" >&2 ;; # If an invalid option is provided, print an error message + esac +done + +echo "RAM src: $ram_version" +echo "RAM branch: $branch" +echo "RoboticsBackend version: $radi_version" + +# Install docker-compose if not installed +if ! command -v docker-compose &> /dev/null; then + sudo apt install docker-compose +fi + +# Clone the desired RAM fork and branch +if ! [ -d src ]; then + git clone $ram_version -b $branch src; + chown -R $(id -u):$(id -g) src/ +fi + +# Prepare nvm +export NVM_DIR=$HOME/.nvm; +source $NVM_DIR/nvm.sh; +if ! command -v nvm &> /dev/null; then + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + export NVM_DIR=$HOME/.nvm; + source $NVM_DIR/nvm.sh; +fi + +# Prepare yarn +if ! command -v yarn --version &> /dev/null; then + npm install --global yarn +fi + +# Prepare the frontend +nvm install 16 +nvm use 16 +cd react_frontend/ +yarn install +yarn build +cd .. + +# Prepare the compose file +if [ "$gpu_mode" = "true" ]; then + compose_file="dev_humble_gpu" +fi +if [ "$nvidia" = "true" ]; then + compose_file="dev_humble_nvidia" +fi +cp compose_cfg/$compose_file.yaml docker-compose.yaml + +# Proceed with docker-compose commands +if [ "$nvidia" = "true" ]; then + docker compose --compatibility up +else + docker compose up +fi +docker compose down; +rm docker-compose.yaml