diff --git a/.gitmodules b/.gitmodules index 8a0464b1..2e3f6d36 100644 --- a/.gitmodules +++ b/.gitmodules @@ -142,3 +142,7 @@ [submodule "fsw/fprime/fprime-nos3"] path = fsw/fprime/fprime-nos3 url = https://github.com/nasa-itc/fprime-nos3.git +[submodule "gsw/yamcs"] + path = gsw/yamcs + url = https://github.com/nasa-itc/yamcs-nos3.git + branch = main diff --git a/cfg/nos3-mission.xml b/cfg/nos3-mission.xml index 7e441e4c..547b6317 100644 --- a/cfg/nos3-mission.xml +++ b/cfg/nos3-mission.xml @@ -1,18 +1,18 @@ 814048200.0 - - + + - - cosmos + + yamcs - cfs + cfs 1 - + sc-full-config.xml diff --git a/gsw/yamcs b/gsw/yamcs new file mode 160000 index 00000000..36373169 --- /dev/null +++ b/gsw/yamcs @@ -0,0 +1 @@ +Subproject commit 36373169f97807851bdfba9469821a39d9be2459 diff --git a/scripts/cfg/configure.py b/scripts/cfg/configure.py index 2918f93d..f79e5872 100644 --- a/scripts/cfg/configure.py +++ b/scripts/cfg/configure.py @@ -21,7 +21,6 @@ fsw_cfg = mission_root.find(fsw_str).text print(' ', fsw_str, ':', fsw_cfg) fsw_identified = 0 - if (fsw_cfg == 'fprime'): fsw_identified = 1 os.system('cp ./scripts/fsw/fsw_fprime_build.sh ./cfg/build/fsw_build.sh') @@ -38,7 +37,6 @@ gsw_str = 'gsw' gsw_cfg = mission_root.find(gsw_str).text print(' ', gsw_str, ':', gsw_cfg) - gsw_identified = 0 if (gsw_cfg == 'openc3'): # Copy openc3 scripts into ./cfg/build @@ -60,6 +58,11 @@ gsw_identified = 1 os.system('cp ./scripts/gsw/gsw_ait_build.sh ./cfg/build/gsw_build.sh') os.system('cp ./scripts/gsw/gsw_ait_launch.sh ./cfg/build/gsw_launch.sh') +if (gsw_cfg == 'yamcs'): + # Copy yamcs scripts into ./cfg/build + gsw_identified = 1 + os.system('cp ./scripts/gsw/gsw_yamcs_build.sh ./cfg/build/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_yamcs_launch.sh ./cfg/build/gsw_launch.sh') if (gsw_identified == 0): print('Invalid GSW in configuration file!') print('Exiting due to error...') diff --git a/scripts/cfg/uninstall.sh b/scripts/cfg/uninstall.sh index 3d085178..310ebf92 100755 --- a/scripts/cfg/uninstall.sh +++ b/scripts/cfg/uninstall.sh @@ -4,7 +4,7 @@ # SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../env.sh echo "Cleaning up all COSMOS files..." yes | rm $BASE_DIR/gsw/cosmos/Gemfile 2> /dev/null @@ -18,12 +18,17 @@ yes | rm $BASE_DIR/minicom.cap 2> /dev/null echo "Cleaning up CryptoLib build..." yes | rm $BASE_DIR/minicom.cap 2> /dev/null -$DCALL system prune -f 2> /dev/null - echo "Cleaning up local user directory..." -yes | rm -r $USER_NOS3_DIR 2> /dev/null +$DFLAGS -v $USER_NOS3_DIR:$USER_NOS3_DIR $DBOX rm -rf $USER_NOS3_DIR +rm -rf $USER_NOS3_DIR/* + +yes | rm -rf $USER_NOS3_DIR/.m2 2> /dev/null +yes | rm -rf $USER_NOS3_DIR 2> /dev/null + +echo "Removing containers..." +$DCALL system prune -f 2> /dev/null -echo "Removing superfluous Docker networks and such..." +echo "Removing container networks..." yes | docker network prune -f 2> /dev/null yes | docker swarm leave --force 2> /dev/null diff --git a/scripts/debug.sh b/scripts/debug.sh index 05f479db..877819a7 100755 --- a/scripts/debug.sh +++ b/scripts/debug.sh @@ -9,4 +9,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh mkdir -p $BASE_DIR/fsw/build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash +$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -v $MVN_DIR:$MVN_DIR -p 8090:8090 -p 5012:5012 -w $BASE_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice --name "nos3_debug" $DBOX bash diff --git a/scripts/env.sh b/scripts/env.sh index 546eaa34..b0f965df 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -20,6 +20,7 @@ NUM_CPUS="$( nproc )" USERDIR=$(cd ~/ && pwd) USER_NOS3_DIR=$(cd ~/ && pwd)/.nos3 + OPENC3_DIR=$USER_NOS3_DIR/cosmos OPENC3_PATH=$OPENC3_DIR/openc3.sh diff --git a/scripts/gsw/gsw_yamcs_build.sh b/scripts/gsw/gsw_yamcs_build.sh new file mode 100755 index 00000000..c49a7d88 --- /dev/null +++ b/scripts/gsw/gsw_yamcs_build.sh @@ -0,0 +1,13 @@ +#!/bin/bash -i +# +# Convenience script for NOS3 development +# + +CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts +source $SCRIPT_DIR/env.sh + +echo "YAMCS build..." +rm -rf $USER_NOS3_DIR/yamcs 2> /dev/null +cp -r $BASE_DIR/gsw/yamcs $USER_NOS3_DIR/ +echo "" diff --git a/scripts/gsw/gsw_yamcs_launch.sh b/scripts/gsw/gsw_yamcs_launch.sh new file mode 100755 index 00000000..477b69a6 --- /dev/null +++ b/scripts/gsw/gsw_yamcs_launch.sh @@ -0,0 +1,17 @@ +#!/bin/bash -i +# +# Convenience script for NOS3 development +# + +CFG_BUILD_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR=$CFG_BUILD_DIR/../../scripts +source $SCRIPT_DIR/env.sh + +echo "YAMCS Launch... " +gnome-terminal --tab --title="YAMCS" -- $DFLAGS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR -p 8090:8090 -p 5012:5012 --name cosmos_openc3-operator_1 -h cosmos --network=nos3_core --network-alias=cosmos -w $USER_NOS3_DIR/yamcs $DBOX mvn -Dmaven.repo.local=$USER_NOS3_DIR/.m2/repository yamcs:run + +pidof firefox > /dev/null +if [ $? -eq 1 ] +then + sleep 20 && firefox localhost:8090 & +fi diff --git a/scripts/stop.sh b/scripts/stop.sh index bcb11dcd..c4b2fbdd 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -16,6 +16,7 @@ rm -rf $BASE_DIR/fsw/build/exe/cpu1/scratch/* # Docker stop cd $SCRIPT_DIR; $DFLAG compose down > /dev/null 2>&1 +$DCALL ps --filter ancestor="$DBOX" -aq | xargs $DCALL stop > /dev/null 2>&1 & $DCALL ps --filter=name="sc_*" -aq | xargs $DCALL stop > /dev/null 2>&1 & $DCALL ps --filter=name="nos_*" -aq | xargs $DCALL stop > /dev/null 2>&1 & $DCALL ps --filter=name="ait*" -aq | xargs $DCALL stop > /dev/null 2>&1 &