-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added configuration script which generates a default user.config.json which autoloads IsaacSim extensions and also prompts the user to input their API Token for the AirLab Nucleus server * updated documentation for configuration script * mounted user.config.json as a volume in docker to autoload extensions
- Loading branch information
Showing
5 changed files
with
258 additions
and
352 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# setup | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
BOLDCYAN="\e[1;96m" | ||
YELLOW="\e[;33m" | ||
ENDCOLOR="\e[0m" | ||
|
||
confirm_no() { #https://stackoverflow.com/questions/3231804/in-bash-how-to-add-are-you-sure-y-n-to-any-command-or-alias | ||
read -r -p "${1:-Are you sure? [y/N]} " response | ||
case "$response" in | ||
[yY][eE][sS]|[yY]) | ||
true | ||
;; | ||
*) | ||
false | ||
;; | ||
esac | ||
} | ||
|
||
|
||
# Generate user.config.json | ||
USER_CONFIG_JSON_SOURCE=${SCRIPT_DIR}/simulation/isaac-sim/docker/user_TEMPLATE.config.json | ||
USER_CONFIG_JSON_DESTINATION=${SCRIPT_DIR}/simulation/isaac-sim/docker/user.config.json | ||
|
||
echo -e "${BOLDCYAN}1. Generating Default IsaacSim Config ($USER_CONFIG_JSON_DESTINATION)${ENDCOLOR}" | ||
|
||
if [ -f $USER_CONFIG_JSON_DESTINATION ]; then | ||
echo -e "${YELLOW}WARNING: The file $USER_CONFIG_JSON_DESTINATION already exists.${ENDCOLOR}" | ||
confirm_no "Do you want to reset it to the default? [y/N]" && cp $USER_CONFIG_JSON_SOURCE $USER_CONFIG_JSON_DESTINATION | ||
else | ||
cp $USER_CONFIG_JSON_SOURCE $USER_CONFIG_JSON_DESTINATION | ||
fi | ||
|
||
|
||
# AirLab Nucleus Login Config | ||
OMNI_PASS_SOURCE=${SCRIPT_DIR}/simulation/isaac-sim/docker/omni_pass_TEMPLATE.env | ||
OMNI_PASS_DESTINATION=${SCRIPT_DIR}/simulation/isaac-sim/docker/omni_pass.env | ||
|
||
echo -e "${BOLDCYAN}2. Configure AirLab Nucleus Login ($OMNI_PASS_DESTINATION)${ENDCOLOR}" | ||
|
||
echo "Go to https://airlab-storage.andrew.cmu.edu:8443/omni/web3/, log in, then right click on the cloud and click the \"API Tokens\" window to generate an API token and paste it here. Leave this blank if you want to skip this step: " | ||
if [ -f $OMNI_PASS_DESTINATION ]; then | ||
echo -e "${YELLOW}WARNING: The file $USER_CONFIG_JSON_DESTINATION already exists, leave it blank to skip.${ENDCOLOR}" | ||
fi | ||
read -r -p "API Token: " API_TOKEN | ||
|
||
if [ ! -z "${API_TOKEN}" ]; then | ||
sed "s/PASTE-YOUR-API-TOKEN/$API_TOKEN/g" $OMNI_PASS_SOURCE > $OMNI_PASS_DESTINATION | ||
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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
omni_pass.env | ||
.bash_history | ||
.bash_history | ||
user.config.json |
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
Oops, something went wrong.