Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nasa/nos3#80] YAMCS Integration #409

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions cfg/nos3-mission.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<nos3-mission-cfg>
<start-time>814048200.0</start-time>
<!-- Note fprime gsw and fsw only operational in sc-minimal-config.xml -->
<!-- Note fprime only operational in sc-minimal-config.xml -->

<!-- Ground Software -->
<!-- cosmos, openc3, or fprime -->
<gsw>cosmos</gsw>
<!-- cosmos, openc3, fprime, or yamcs -->
<gsw>yamcs</gsw>

<!-- Flight Software -->
<!-- cfs or fprime -->
<fsw>cfs</fsw>
<fsw>cfs</fsw>

<!-- Number of spacecraft -->
<number-spacecraft>1</number-spacecraft>

<!-- Spacecraft 1 Configuration -->
<!-- sc-full-config.xml or sc-minimal-config.xml -->
<sc-1-cfg>sc-full-config.xml</sc-1-cfg>
Expand Down
1 change: 1 addition & 0 deletions gsw/yamcs
Submodule yamcs added at 363731
7 changes: 5 additions & 2 deletions scripts/cfg/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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
Expand All @@ -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...')
Expand Down
15 changes: 10 additions & 5 deletions scripts/cfg/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions scripts/gsw/gsw_yamcs_build.sh
Original file line number Diff line number Diff line change
@@ -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 ""
17 changes: 17 additions & 0 deletions scripts/gsw/gsw_yamcs_launch.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down
Loading