diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85de556f..92268e6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,6 @@ name: Build on: - push: pull_request: jobs: @@ -13,16 +12,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - name: Update - run: apt-get update - - name: Install dependencies - run: apt-get install -y python3 docker docker.io - - name: prep - run: make prep - name: config run: make config - - name: build directory - run: mkdir ./fsw/build - name: build run: make build-fsw @@ -34,15 +25,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive - - name: Update - run: apt-get update - - name: Install dependencies - run: apt-get install -y python3 docker docker.io - - name: prep - run: make prep - name: config run: make config - - name: build directory - run: mkdir ./sims/build - name: build run: make build-sim diff --git a/Makefile b/Makefile index 678a1183..3ae18f3f 100755 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ endif # The "LOCALTGTS" defines the top-level targets that are implemented in this makefile # Any other target may also be given, in that case it will simply be passed through. -LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fprime fsw gsw launch log prep real-clean sim stop stop-gsw +LOCALTGTS := all checkout clean clean-fsw clean-sim clean-gsw config debug fsw gsw launch log prep real-clean sim stop stop-gsw OTHERTGTS := $(filter-out $(LOCALTGTS),$(MAKECMDGOALS)) # As this makefile does not build any real files, treat everything as a PHONY target @@ -52,19 +52,12 @@ build-cryptolib: $(MAKE) --no-print-directory -C $(GSWBUILDDIR) build-fsw: - - ifeq ($(FLIGHT_SOFTWARE), fprime) cd fsw/fprime/fprime-nos3 && fprime-util generate && fprime-util build - -endif - -ifeq ($(FLIGHT_SOFTWARE), cfs) +else mkdir -p $(FSWBUILDDIR) cd $(FSWBUILDDIR) && cmake $(PREP_OPTS) ../cfe $(MAKE) --no-print-directory -C $(FSWBUILDDIR) mission-install -else - pwd endif build-sim: @@ -73,7 +66,7 @@ build-sim: $(MAKE) --no-print-directory -C $(SIMBUILDDIR) install checkout: - ./scripts/docker_checkout.sh + ./scripts/checkout.sh clean: $(MAKE) clean-fsw @@ -97,58 +90,51 @@ clean-gsw: rm -rf /tmp/nos3 config: - ./scripts/config.sh + ./scripts/cfg/config.sh debug: - ./scripts/docker_debug.sh - -fprime: - ./scripts/fprime.sh + ./scripts/debug.sh fsw: - ./scripts/docker_build_fsw.sh - -fsw-launch: - ./scripts/launch_fsw.sh + ./cfg/build/fsw_build.sh gsw: - ./scripts/docker_build_cryptolib.sh + ./scripts/gsw/build_cryptolib.sh ./cfg/build/gsw_build.sh +igniter: + ./scripts/igniter_launch.sh + launch: - ./scripts/docker_launch.sh + ./cfg/build/launch.sh log: ./scripts/log.sh prep: - ./scripts/prepare.sh + ./scripts/cfg/prepare.sh prep-gsw: - ./scripts/gsw_startup.sh + ./scripts/cfg/prep_gsw.sh prep-sat: - ./scripts/sat_startup.sh - -real-clean: - $(MAKE) clean - ./scripts/real_clean.sh + ./scripts/cfg/prep_sat.sh sim: - ./scripts/docker_build_sim.sh + ./scripts/build_sim.sh start-gsw: - ./scripts/docker_launch_gsw.sh + ./scripts/gsw/launch_gsw.sh start-sat: - ./scripts/docker_launch_sat.sh + ./scripts/fsw/launch_sat.sh stop: - ./scripts/docker_stop.sh ./scripts/stop.sh stop-gsw: - ./scripts/stop_gsw.sh + ./scripts/gsw/stop_gsw.sh -igniter: - ./scripts/igniter_launch.sh +uninstall: + $(MAKE) clean + ./scripts/cfg/uninstall.sh diff --git a/README.md b/README.md index 61a19ae8..961cb777 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Will provision a VM with all required packages installed to be used immediately. 3. Clone the submodules `git submodule update --init --recursive` 4. Run `vagrant up` and wait to return to a prompt - This can take anywhere from a few minutes to hours depending on internet speeds and host PC specs -_It may also be wise at around this stage to shutdown the VM once it starts and to allocate it more resources if possible, preferably at least 4 cores and 8 GB of RAM, preferably 8 cores and 16 GB of RAM._ +_It may also be wise at around this stage to shutdown the VM once it starts and to allocate it more resources if possible, preferably 8 cores and 16 GB of RAM._ 5. In VirtualBox `Devices > Upgrade Guest Additions...` - Wait for this to complete 6. Run `vagrant reload` to finish the upgrade @@ -43,37 +43,24 @@ By default the nos3 repository is shared into the virtual machine at `/home/jsta - `make launch` 6. Stop NOS3 - `make stop` - - Note that COSMOS will remaining running in the background until `make stop-gsw` is done + - Note that OpenC3, if in use, will remaining running in the background until `make stop-gsw` is done + +To uninstall the hidden directories created, run `make uninstall`. ### Directory Layout +* `cfg` contains the configuration files for the mission and spacecraft * `components` contains the repositories for the hardware component apps - - /fsw - cFS application - - /gsw - OpenC3 (or Ball Aerospace) COSMOS database - - /sim - NOS3 simulator - - /support - Optional folder containing a standalone checkout application +* `docs` contains various documentation related to the project * `fsw` contains the repositories needed to build cFS FSW - - /apps - the open source cFS apps - - /cfe - the core flight system (cFS) source files - - /nos3_defs - cFS definitions to configure cFS for NOS3 - - /osal - operating system abstraction layer (OSAL), enables building for Linux and flight OS - - /psp - platform support package (PSP), enables use on multiple types of boards - - /tools - standard cFS provided tools * `gsw` contains the nos3 ground station files, and other ground based tools - - /cosmos - OpenC3 (or Ball Aerospace) COSMOS files - - /OrbitInviewPowerPrediction - OIPP tool for operators - - /scripts - convenience scripts +* `scripts` contains various convenience scripts * `sims` contains the nos3 simulators and configuration files - - /cfg - 42 configuration files and NOS3 top level configuration files - - /nos_time_driver - time synchronization for all components - - /sim_common - common files used by component simulators including the files that define the simulator plugin architecture - - /sim_terminal - terminal for testing on NOS Engine busses - - /truth_42_sim - interface between 42 and OpenC3 COSMOS to provide dynamics truth data ### Versioning We use [SemVer](http://semver.org/) for versioning. For the versions available, see the tags on this repository. ### License -This project is licensed under the NOSA (NASA Open Source Agreement) License. +This project is licensed under the NOSA 1.3 (NASA Open Source Agreement) License. # Issues and Features Please report issues and request features on the GitHub tracking system - [NOS3 Issues](https://www.github.com/nasa/nos3/issues). diff --git a/cfg/nos3_defs/tables/sch_def_schtbl.c b/cfg/nos3_defs/tables/sch_def_schtbl.c index b9f161d1..e9dc0c6d 100644 --- a/cfg/nos3_defs/tables/sch_def_schtbl.c +++ b/cfg/nos3_defs/tables/sch_def_schtbl.c @@ -495,7 +495,7 @@ SCH_ScheduleEntry_t SCH_DefaultScheduleTable[SCH_TABLE_ENTRIES] = /* slot #55 - Component HK */ /*{ SCH_DISABLED, SCH_ACTIVITY_SEND_MSG, 1, 0, 24, SCH_GROUP_MD_WAKEUP }, */ /* MD Wakeup */ - { SCH_ENABLED, SCH_ACTIVITY_SEND_MSG, 1, 0, 65, SCH_GROUP_CFE_HK }, /* EPS HK Request */ + { SCH_ENABLED, SCH_ACTIVITY_SEND_MSG, 5, 4, 65, SCH_GROUP_CFE_HK }, /* EPS HK Request */ { SCH_UNUSED, 0, 0, 0, 0, SCH_GROUP_NONE}, { SCH_UNUSED, 0, 0, 0, 0, SCH_GROUP_NONE}, { SCH_UNUSED, 0, 0, 0, 0, SCH_GROUP_NONE}, diff --git a/doc/NOS3_Indv_CLA.pdf b/docs/NOS3_Indv_CLA.pdf similarity index 100% rename from doc/NOS3_Indv_CLA.pdf rename to docs/NOS3_Indv_CLA.pdf diff --git a/scripts/build_fprime.sh b/scripts/build_fprime.sh deleted file mode 100755 index 52c2b85f..00000000 --- a/scripts/build_fprime.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -cd fsw/fprime/fprime-nos3 -. fprime-venv/bin/activate -fprime-util build - diff --git a/scripts/docker_build_sim.sh b/scripts/build_sim.sh similarity index 100% rename from scripts/docker_build_sim.sh rename to scripts/build_sim.sh diff --git a/scripts/config.sh b/scripts/cfg/config.sh similarity index 87% rename from scripts/config.sh rename to scripts/cfg/config.sh index d143b3c1..5718fef6 100755 --- a/scripts/config.sh +++ b/scripts/cfg/config.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 # Make flight software configuration directory mkdir -p $BASE_DIR/cfg/build @@ -15,4 +15,4 @@ cp -r $BASE_DIR/cfg/nos3_defs $BASE_DIR/cfg/build/ cp -r $BASE_DIR/cfg/sims $BASE_DIR/cfg/build/ # Configure flight software -python3 $SCRIPT_DIR/configure.py +python3 $SCRIPT_DIR/cfg/configure.py diff --git a/scripts/configure.py b/scripts/cfg/configure.py old mode 100755 new mode 100644 similarity index 94% rename from scripts/configure.py rename to scripts/cfg/configure.py index 886ff231..2918f93d --- a/scripts/configure.py +++ b/scripts/cfg/configure.py @@ -24,23 +24,16 @@ if (fsw_cfg == 'fprime'): fsw_identified = 1 - os.system('cp ./scripts/fsw_fprime_build.sh ./cfg/build/fsw_build.sh') - os.system('cp ./scripts/fsw_fprime_launch.sh ./cfg/build/fsw_launch.sh') - os.system('cp ./scripts/fprime.sh ./scripts/docker_launch.sh') - os.system('cp ./scripts/fprime_build_fsw.sh ./scripts/docker_build_fsw.sh') - + os.system('cp ./scripts/fsw/fsw_fprime_build.sh ./cfg/build/fsw_build.sh') + os.system('cp ./scripts/fsw/fsw_fprime_launch.sh ./cfg/build/launch.sh') if (fsw_cfg == 'cfs'): fsw_identified = 1 - # os.system('cp ./scripts/fsw_fprime_build.sh ./cfg/build/fsw_build.sh') - # os.system('cp ./scripts/fsw_fprime_launch.sh ./cfg/build/fsw_launch.sh') - os.system('cp ./scripts/cfs_cosmos.sh ./scripts/docker_launch.sh') - os.system('cp ./scripts/cfs_build_fsw.sh ./scripts/docker_build_fsw.sh') - + os.system('cp ./scripts/fsw/fsw_cfs_build.sh ./cfg/build/fsw_build.sh') + os.system('cp ./scripts/fsw/fsw_cfs_launch.sh ./cfg/build/launch.sh') if (fsw_identified == 0): print('Invalid FSW in configuration file!') print('Exiting due to error...') - # GSW gsw_str = 'gsw' gsw_cfg = mission_root.find(gsw_str).text @@ -50,23 +43,23 @@ if (gsw_cfg == 'openc3'): # Copy openc3 scripts into ./cfg/build gsw_identified = 1 - os.system('cp ./scripts/gsw_openc3_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw_openc3_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_openc3_build.sh ./cfg/build/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_openc3_launch.sh ./cfg/build/gsw_launch.sh') if (gsw_cfg == 'cosmos'): # Copy cosmos scripts into ./cfg/build gsw_identified = 1 - os.system('cp ./scripts/gsw_cosmos_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw_cosmos_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_cosmos_build.sh ./cfg/build/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_cosmos_launch.sh ./cfg/build/gsw_launch.sh') if (gsw_cfg == 'fprime'): # Copy fprime scripts into ./cfg/build gsw_identified = 1 - os.system('cp ./scripts/gsw_fprime_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw_fprime_launch.sh ./cfg/build/gsw_launch.sh') + os.system('cp ./scripts/gsw/gsw_fprime_build.sh ./cfg/build/gsw_build.sh') + os.system('cp ./scripts/gsw/gsw_fprime_launch.sh ./cfg/build/gsw_launch.sh') if (gsw_cfg == 'ait'): # Copy ait scripts into ./cfg/build gsw_identified = 1 - os.system('cp ./scripts/gsw_ait_build.sh ./cfg/build/gsw_build.sh') - os.system('cp ./scripts/gsw_ait_launch.sh ./cfg/build/gsw_launch.sh') + 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_identified == 0): print('Invalid GSW in configuration file!') print('Exiting due to error...') diff --git a/scripts/igniter_launch.sh b/scripts/cfg/igniter_launch.sh similarity index 88% rename from scripts/igniter_launch.sh rename to scripts/cfg/igniter_launch.sh index bbe225d1..418773ae 100755 --- a/scripts/igniter_launch.sh +++ b/scripts/cfg/igniter_launch.sh @@ -3,7 +3,7 @@ # Convenience script for NOS# development SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../env.sh echo "" echo "" diff --git a/scripts/gsw_startup.sh b/scripts/cfg/prep_gsw.sh similarity index 100% rename from scripts/gsw_startup.sh rename to scripts/cfg/prep_gsw.sh diff --git a/scripts/sat_startup.sh b/scripts/cfg/prep_sat.sh similarity index 100% rename from scripts/sat_startup.sh rename to scripts/cfg/prep_sat.sh diff --git a/scripts/prepare.sh b/scripts/cfg/prepare.sh similarity index 88% rename from scripts/prepare.sh rename to scripts/cfg/prepare.sh index fd36c809..aab0f4eb 100755 --- a/scripts/prepare.sh +++ b/scripts/cfg/prepare.sh @@ -2,18 +2,9 @@ # # Convenience script for NOS3 development # +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source $SCRIPT_DIR/../env.sh -FLIGHT_SOFTWARE="cFS" - -read_xml () -{ - local IFS=\> - read -d \< ENTITY CONTENT - local ret=$? - TAG_NAME=${ENTITY%% *} - ATTRIBUTES=${ENTITY#* } - return $ret -} SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh diff --git a/scripts/real_clean.sh b/scripts/cfg/uninstall.sh similarity index 85% rename from scripts/real_clean.sh rename to scripts/cfg/uninstall.sh index 5f13e08d..3d085178 100755 --- a/scripts/real_clean.sh +++ b/scripts/cfg/uninstall.sh @@ -18,13 +18,13 @@ 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 +$DCALL system prune -f 2> /dev/null echo "Cleaning up local user directory..." yes | rm -r $USER_NOS3_DIR 2> /dev/null echo "Removing superfluous Docker networks and such..." -yes | docker network prune -yes | docker swarm leave --force +yes | docker network prune -f 2> /dev/null +yes | docker swarm leave --force 2> /dev/null exit 0 diff --git a/scripts/cfs_build_fsw.sh b/scripts/cfs_build_fsw.sh deleted file mode 100755 index b845a734..00000000 --- a/scripts/cfs_build_fsw.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh - - -# Check that local NOS3 directory exists -if [ ! -d $USER_NOS3_DIR ]; then - echo "" - echo " Need to run make prep first!" - echo "" - exit 1 -fi - -# Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then - echo "" - echo " Need to run make config first!" - echo "" - exit 1 -fi - -# Make flight software build directory -mkdir -p $BASE_DIR/fsw/build - -# Build -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_fsw" -w $BASE_DIR $DBOX make -j$NUM_CPUS -e FLIGHT_SOFTWARE=cfs build-fsw diff --git a/scripts/cfs_cosmos.sh b/scripts/cfs_cosmos.sh deleted file mode 100755 index 5033c6d7..00000000 --- a/scripts/cfs_cosmos.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh - -# Check that local NOS3 directory exists -if [ ! -d $USER_NOS3_DIR ]; then - echo "" - echo " Need to run make prep first!" - echo "" - exit 1 -fi - -# Check that configure build directory exists -if [ ! -d $BASE_DIR/cfg/build ]; then - echo "" - echo " Need to run make config first!" - echo "" - exit 1 -fi - -echo "Make data folders..." -# FSW Side -mkdir $FSW_DIR/data 2> /dev/null -mkdir $FSW_DIR/data/cam 2> /dev/null -mkdir $FSW_DIR/data/evs 2> /dev/null -mkdir $FSW_DIR/data/hk 2> /dev/null -mkdir $FSW_DIR/data/inst 2> /dev/null -# GSW Side -mkdir /tmp/nos3 2> /dev/null -mkdir /tmp/nos3/data 2> /dev/null -mkdir /tmp/nos3/data/cam 2> /dev/null -mkdir /tmp/nos3/data/evs 2> /dev/null -mkdir /tmp/nos3/data/hk 2> /dev/null -mkdir /tmp/nos3/data/inst 2> /dev/null -mkdir /tmp/nos3/uplink 2> /dev/null -cp $BASE_DIR/fsw/build/exe/cpu1/cf/cfe_es_startup.scr /tmp/nos3/uplink/tmp0.so 2> /dev/null -cp $BASE_DIR/fsw/build/exe/cpu1/cf/sample.so /tmp/nos3/uplink/tmp1.so 2> /dev/null - -echo "Create ground networks..." -$DNETWORK create \ - --driver=bridge \ - --subnet=192.168.41.0/24 \ - --gateway=192.168.41.1 \ - nos3_core -echo "" - -echo "Launch GSW..." -echo "" -source $BASE_DIR/cfg/build/gsw_launch.sh - -echo "Create NOS interfaces..." -export GND_CFG_FILE="-f nos3-simulator.xml" -gnome-terminal --tab --title="NOS Terminal" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name "nos_terminal" --network=nos3_core -w $SIM_BIN $DBOX ./nos3-single-simulator $GND_CFG_FILE stdio-terminal -gnome-terminal --tab --title="NOS UDP Terminal" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name "nos_udp_terminal" --network=nos3_core -w $SIM_BIN $DBOX ./nos3-single-simulator $GND_CFG_FILE udp-terminal -echo "" - -# Note only currently working with a single spacecraft -export SATNUM=1 - -# -# Spacecraft Loop -# -for (( i=1; i<=$SATNUM; i++ )) -do - export SC_NUM="sc_"$i - export SC_NETNAME="nos3_"$SC_NUM - export SC_CFG_FILE="-f nos3-simulator.xml" #"-f sc_"$i"_nos3_simulator.xml" - - # Debugging - #echo "Spacecraft number = " $SC_NUM - #echo "Spacecraft network = " $SC_NETNAME - #echo "Spacecraft configuration = " $SC_CFG_FILE - - echo $SC_NUM " - Create spacecraft network..." - $DNETWORK create $SC_NETNAME 2> /dev/null - echo "" - - echo $SC_NUM " - Connect GSW " "${GSW:-cosmos_openc3-operator_1}" " to spacecraft network..." - $DNETWORK connect $SC_NETNAME "${GSW:-cosmos_openc3-operator_1}" --alias cosmos --alias active-gs - echo "" - - echo $SC_NUM " - 42..." - rm -rf $USER_NOS3_DIR/42/NOS3InOut - cp -r $BASE_DIR/cfg/build/InOut $USER_NOS3_DIR/42/NOS3InOut - xhost +local:* - gnome-terminal --tab --title=$SC_NUM" - 42" -- $DFLAGS -e DISPLAY=$DISPLAY -v $USER_NOS3_DIR:$USER_NOS3_DIR -v /tmp/.X11-unix:/tmp/.X11-unix:ro --name $SC_NUM"_fortytwo" -h fortytwo --network=$SC_NETNAME -w $USER_NOS3_DIR/42 -t $DBOX $USER_NOS3_DIR/42/42 NOS3InOut - echo "" - - echo $SC_NUM " - Flight Software..." - cd $FSW_DIR - # Debugging - # Replace `--tab` with `--window-with-profile=KeepOpen` once you've created this gnome-terminal profile manually - gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw_respawn.sh & - #gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $FSW_DIR/core-cpu1 -R PO & - echo "" - - echo $SC_NUM " - CryptoLib..." - gnome-terminal --tab --title=$SC_NUM" - CryptoLib" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_cryptolib" --network=$SC_NETNAME --network-alias=cryptolib -w $BASE_DIR/gsw/build $DBOX ./support/standalone - echo "" - - echo $SC_NUM " - Simulators..." - cd $SIM_BIN - gnome-terminal --tab --title=$SC_NUM" - NOS Engine Server" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_nos_engine_server" -h nos_engine_server --network=$SC_NETNAME -w $SIM_BIN $DBOX /usr/bin/nos_engine_server_standalone -f $SIM_BIN/nos_engine_server_config.json - gnome-terminal --tab --title=$SC_NUM" - 42 Truth Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_truth42sim" -h truth42sim --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE truth42sim - - $DNETWORK connect $SC_NETNAME nos_terminal - $DNETWORK connect $SC_NETNAME nos_udp_terminal - - # Component simulators - gnome-terminal --tab --title=$SC_NUM" - CAM Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_cam_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE camsim - gnome-terminal --tab --title=$SC_NUM" - CSS Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_css_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_css_sim - gnome-terminal --tab --title=$SC_NUM" - EPS Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_eps_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_eps_sim - gnome-terminal --tab --title=$SC_NUM" - FSS Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_fss_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_fss_sim - gnome-terminal --tab --title=$SC_NUM" - GPS Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_gps_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE gps - gnome-terminal --tab --title=$SC_NUM" - IMU Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_imu_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_imu_sim - gnome-terminal --tab --title=$SC_NUM" - MAG Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_mag_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_mag_sim - gnome-terminal --tab --title=$SC_NUM" - RW 0 Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_rw_sim0" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic-reactionwheel-sim0 - gnome-terminal --tab --title=$SC_NUM" - RW 1 Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_rw_sim1" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic-reactionwheel-sim1 - gnome-terminal --tab --title=$SC_NUM" - RW 2 Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_rw_sim2" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic-reactionwheel-sim2 - gnome-terminal --tab --title=$SC_NUM" - Radio Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_radio_sim" -h radio_sim --network=$SC_NETNAME --network-alias=radio_sim -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_radio_sim - gnome-terminal --tab --title=$SC_NUM" - Sample Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_sample_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE sample_sim - gnome-terminal --tab --title=$SC_NUM" - StarTrk Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_startrk_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_star_tracker_sim - gnome-terminal --tab --title=$SC_NUM" - Thruster Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_thruster_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_thruster_sim - gnome-terminal --tab --title=$SC_NUM" - Torquer Sim" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name $SC_NUM"_torquer_sim" --network=$SC_NETNAME -w $SIM_BIN $DBOX ./nos3-single-simulator $SC_CFG_FILE generic_torquer_sim - echo "" -done - -echo "NOS Time Driver..." -sleep 8 -gnome-terminal --tab --title="NOS Time Driver" -- $DFLAGS -v $SIM_DIR:$SIM_DIR --name nos_time_driver --network=nos3_core -w $SIM_BIN $DBOX ./nos3-single-simulator $GND_CFG_FILE time -sleep 1 -for (( i=1; i<=$SATNUM; i++ )) -do - export SC_NUM="sc_"$i - export SC_NETNAME="nos3_"$SC_NUM - export TIMENAME=$SC_NUM"_nos_time_driver" - $DNETWORK connect --alias nos_time_driver $SC_NETNAME nos_time_driver -done -echo "" - -echo "Docker launch script completed!" \ No newline at end of file diff --git a/scripts/docker_checkout.sh b/scripts/checkout.sh similarity index 100% rename from scripts/docker_checkout.sh rename to scripts/checkout.sh diff --git a/scripts/docker_debug.sh b/scripts/debug.sh similarity index 100% rename from scripts/docker_debug.sh rename to scripts/debug.sh diff --git a/scripts/docker_compose_launch.sh b/scripts/docker_compose_launch.sh deleted file mode 100755 index b072f2b0..00000000 --- a/scripts/docker_compose_launch.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh - -#echo "Make /tmp folders..." -#mkdir /tmp/data 2> /dev/null -#mkdir /tmp/data/hk 2> /dev/null -#mkdir /tmp/uplink 2> /dev/null - -echo "42..." -cd /opt/nos3/42/ -rm -rf NOS3InOut -cp -r $BASE_DIR/sims/cfg/InOut /opt/nos3/42/NOS3InOut -xhost +local:* - -echo "COSMOS Ground Station..." -cd $BASE_DIR/gsw/cosmos -export MISSION_NAME=$(echo "NOS3") -export PROCESSOR_ENDIANNESS=$(echo "LITTLE_ENDIAN") -#docker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro -e QT_X11_NO_MITSHM=1 \ -# -v /home/nos3/Desktop/github-nos3/gsw/cosmos:/cosmos/cosmos \ -# -v /home/nos3/Desktop/github-nos3/components/:/COMPONENTS -w /cosmos/cosmos -d --network=host \ -# ballaerospace/cosmos /bin/bash -c 'ruby Launcher -c nos3_launcher.txt --system nos3_system.txt && true' # true is necessary to avoid setpgrp error - -cd $SCRIPT_DIR -docker compose up -d diff --git a/scripts/docker_stop.sh b/scripts/docker_stop.sh deleted file mode 100755 index bcb11dcd..00000000 --- a/scripts/docker_stop.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh - -# NOS3 GPIO -rm -rf /tmp/gpio_fake - -# NOS3 Stored HK -rm -rf $BASE_DIR/fsw/build/exe/cpu1/scratch/* - -# Docker stop -cd $SCRIPT_DIR; $DFLAG compose down > /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 & -$DCALL ps --filter=name="influxdb*" -aq | xargs $DCALL stop > /dev/null 2>&1 & -$DCALL ps --filter=name="ttc-command*" -aq | xargs $DCALL stop > /dev/null 2>&1 & -$DCALL ps --filter ancestor="ballaerospace/cosmos:4.5.0" -aq | xargs $DCALL stop > /dev/null 2>&1 & - -# Intentionally wait to complete -wait - -# Docker cleanup -$DCALL container prune -f > /dev/null 2>&1 -$DNETWORK ls --filter=name="nos" | xargs $DNETWORK rm > /dev/null 2>&1 - -# 42 -rm -rf $USER_NOS3_DIR/42/NOS3InOut -rm -rf /tmp/gpio* - -# COSMOS -yes | rm $GSW_DIR/Gemfile > /dev/null 2>&1 -yes | rm $GSW_DIR/Gemfile.lock > /dev/null 2>&1 - -exit 0 diff --git a/scripts/docker_build_fsw.sh b/scripts/fsw/fsw_cfs_build.sh similarity index 88% rename from scripts/docker_build_fsw.sh rename to scripts/fsw/fsw_cfs_build.sh index b845a734..f9e4e261 100755 --- a/scripts/docker_build_fsw.sh +++ b/scripts/fsw/fsw_cfs_build.sh @@ -5,9 +5,9 @@ # https://github.com/nasa-itc/deployment # +# Note this is copied to ./cfg/build as part of `make config` SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh - +source $SCRIPT_DIR/../../scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then diff --git a/scripts/docker_launch.sh b/scripts/fsw/fsw_cfs_launch.sh similarity index 98% rename from scripts/docker_launch.sh rename to scripts/fsw/fsw_cfs_launch.sh index 5033c6d7..abca60d6 100755 --- a/scripts/docker_launch.sh +++ b/scripts/fsw/fsw_cfs_launch.sh @@ -5,8 +5,9 @@ # https://github.com/nasa-itc/deployment # +# Note this is copied to ./cfg/build as part of `make config` SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../../scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -96,7 +97,7 @@ do cd $FSW_DIR # Debugging # Replace `--tab` with `--window-with-profile=KeepOpen` once you've created this gnome-terminal profile manually - gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw_respawn.sh & + gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw/fsw_respawn.sh & #gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $FSW_DIR/core-cpu1 -R PO & echo "" diff --git a/scripts/fprime_build_fsw.sh b/scripts/fsw/fsw_fprime_build.sh similarity index 88% rename from scripts/fprime_build_fsw.sh rename to scripts/fsw/fsw_fprime_build.sh index 94b16bee..199c10be 100755 --- a/scripts/fprime_build_fsw.sh +++ b/scripts/fsw/fsw_fprime_build.sh @@ -5,9 +5,10 @@ # https://github.com/nasa-itc/deployment # -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[1]}" )/scripts" && pwd ) source $SCRIPT_DIR/env.sh + # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then echo "" @@ -27,5 +28,4 @@ fi # Make flight software build directory mkdir -p $BASE_DIR/fsw/build -# Build $DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR --name "nos_build_fsw" -w $BASE_DIR $DBOX make -j$NUM_CPUS -e FLIGHT_SOFTWARE=fprime build-fsw diff --git a/scripts/fprime.sh b/scripts/fsw/fsw_fprime_launch.sh similarity index 92% rename from scripts/fprime.sh rename to scripts/fsw/fsw_fprime_launch.sh index 18777659..4d041f4d 100755 --- a/scripts/fprime.sh +++ b/scripts/fsw/fsw_fprime_launch.sh @@ -5,8 +5,9 @@ # https://github.com/nasa-itc/deployment # +# Note this is copied to ./cfg/build as part of `make config` SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../../scripts/env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -94,11 +95,7 @@ do echo $SC_NUM " - Flight Software..." cd $FSW_DIR - gnome-terminal --title="FPrime" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_sample_checkout" --network=$SC_NETNAME -w $BASE_DIR $DBOX ./scripts/fsw_fprime_launch.sh - - - echo "" - #gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $FSW_DIR/core-cpu1 -R PO & + gnome-terminal --window-with-profile=KeepOpen --title="FPrime" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_fprime" --network=$SC_NETNAME -h nos_fsw -w $BASE_DIR $DBOX $SCRIPT_DIR/fsw/start_fprime.sh echo "" # Debugging @@ -151,7 +148,7 @@ echo "" sleep 1 -urlIP=$(docker container inspect sc_1_sample_checkout | grep -i IPAddress | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b") +urlIP=$(docker container inspect sc_1_fprime | grep -i IPAddress | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b") sleep 10 diff --git a/scripts/fsw_respawn.sh b/scripts/fsw/fsw_respawn.sh similarity index 93% rename from scripts/fsw_respawn.sh rename to scripts/fsw/fsw_respawn.sh index d57f00cd..a3b84af1 100755 --- a/scripts/fsw_respawn.sh +++ b/scripts/fsw/fsw_respawn.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 "fsw_respawn.sh script" diff --git a/scripts/docker_launch_sat.sh b/scripts/fsw/launch_sat.sh similarity index 99% rename from scripts/docker_launch_sat.sh rename to scripts/fsw/launch_sat.sh index 5dbc3127..61a77a87 100755 --- a/scripts/docker_launch_sat.sh +++ b/scripts/fsw/launch_sat.sh @@ -6,7 +6,7 @@ # SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then @@ -74,7 +74,7 @@ do echo $SC_NUM " - Flight Software..." cd $FSW_DIR - gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw_respawn.sh & + gnome-terminal --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $SCRIPT_DIR/fsw/fsw_respawn.sh & #gnome-terminal --window-with-profile=KeepOpen --title=$SC_NUM" - NOS3 Flight Software" -- $DFLAGS -v $BASE_DIR:$BASE_DIR --name $SC_NUM"_nos_fsw" -h nos_fsw --network=$SC_NETNAME -w $FSW_DIR --sysctl fs.mqueue.msg_max=10000 --ulimit rtprio=99 --cap-add=sys_nice $DBOX $FSW_DIR/core-cpu1 -R PO & echo "" diff --git a/scripts/fprime_launch.sh b/scripts/fsw/start_fprime.sh similarity index 66% rename from scripts/fprime_launch.sh rename to scripts/fsw/start_fprime.sh index 3e3c20f0..efb517d3 100755 --- a/scripts/fprime_launch.sh +++ b/scripts/fsw/start_fprime.sh @@ -6,10 +6,9 @@ # SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../env.sh -cd components/sample/fprime/fprime-nos3/ +cd $BASE_DIR/fsw/fprime/fprime-nos3 . fprime-venv/bin/activate -# fprime-util build -fprime-gds --gui-port 5000 --gui-addr 0.0.0.0 \ No newline at end of file +fprime-gds --gui-port 5000 --gui-addr 0.0.0.0 diff --git a/scripts/fsw_fprime_build.sh b/scripts/fsw_fprime_build.sh deleted file mode 100755 index 92999f2e..00000000 --- a/scripts/fsw_fprime_build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[1]}" )/scripts" && pwd ) -echo "SCRIPT DIR: $SCRIPT_DIR" -source $SCRIPT_DIR/env.sh - -$DFLAGS_CPUS -v $BASE_DIR:$BASE_DIR -v $USER_NOS3_DIR:$USER_NOS3_DIR --name "fprime_build" -w $BASE_DIR $DBOX ./scripts/build_fprime.sh diff --git a/scripts/fsw_fprime_launch.sh b/scripts/fsw_fprime_launch.sh deleted file mode 100755 index d9aada76..00000000 --- a/scripts/fsw_fprime_launch.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -cd fsw/fprime/fprime-nos3/ -. fprime-venv/bin/activate -# fprime-util build -fprime-gds --gui-port 5000 --gui-addr 0.0.0.0 \ No newline at end of file diff --git a/scripts/docker_build_cryptolib.sh b/scripts/gsw/build_cryptolib.sh similarity index 96% rename from scripts/docker_build_cryptolib.sh rename to scripts/gsw/build_cryptolib.sh index 63126da2..c8f47e94 100755 --- a/scripts/docker_build_cryptolib.sh +++ b/scripts/gsw/build_cryptolib.sh @@ -6,7 +6,7 @@ # SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then diff --git a/scripts/gsw_ait_build.sh b/scripts/gsw/gsw_ait_build.sh similarity index 100% rename from scripts/gsw_ait_build.sh rename to scripts/gsw/gsw_ait_build.sh diff --git a/scripts/gsw_ait_launch.sh b/scripts/gsw/gsw_ait_launch.sh similarity index 100% rename from scripts/gsw_ait_launch.sh rename to scripts/gsw/gsw_ait_launch.sh diff --git a/scripts/gsw_cosmos_build.sh b/scripts/gsw/gsw_cosmos_build.sh similarity index 100% rename from scripts/gsw_cosmos_build.sh rename to scripts/gsw/gsw_cosmos_build.sh diff --git a/scripts/gsw_cosmos_launch.sh b/scripts/gsw/gsw_cosmos_launch.sh similarity index 100% rename from scripts/gsw_cosmos_launch.sh rename to scripts/gsw/gsw_cosmos_launch.sh diff --git a/scripts/gsw_fprime_build.sh b/scripts/gsw/gsw_fprime_build.sh similarity index 100% rename from scripts/gsw_fprime_build.sh rename to scripts/gsw/gsw_fprime_build.sh diff --git a/scripts/gsw_fprime_launch.sh b/scripts/gsw/gsw_fprime_launch.sh similarity index 100% rename from scripts/gsw_fprime_launch.sh rename to scripts/gsw/gsw_fprime_launch.sh diff --git a/scripts/gsw_openc3_build.sh b/scripts/gsw/gsw_openc3_build.sh similarity index 100% rename from scripts/gsw_openc3_build.sh rename to scripts/gsw/gsw_openc3_build.sh diff --git a/scripts/gsw_openc3_launch.sh b/scripts/gsw/gsw_openc3_launch.sh similarity index 100% rename from scripts/gsw_openc3_launch.sh rename to scripts/gsw/gsw_openc3_launch.sh diff --git a/scripts/docker_launch_gsw.sh b/scripts/gsw/launch_gsw.sh similarity index 98% rename from scripts/docker_launch_gsw.sh rename to scripts/gsw/launch_gsw.sh index b820569a..d8f09616 100755 --- a/scripts/docker_launch_gsw.sh +++ b/scripts/gsw/launch_gsw.sh @@ -6,7 +6,7 @@ # SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh +source $SCRIPT_DIR/../env.sh # Check that local NOS3 directory exists if [ ! -d $USER_NOS3_DIR ]; then diff --git a/scripts/stop_gsw.sh b/scripts/gsw/stop_gsw.sh similarity index 100% rename from scripts/stop_gsw.sh rename to scripts/gsw/stop_gsw.sh diff --git a/scripts/l0.sh b/scripts/l0.sh deleted file mode 100755 index 6425169d..00000000 --- a/scripts/l0.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -BASE_DIR=$(cd `dirname $SCRIPT_DIR`/.. && pwd) -DATE=$(date "+%Y%m%d_%H%M") -COSMOS_DIR=$(cd $BASE_DIR/gsw/cosmos && pwd) -COSMOS_TOOLS_DIR=$(cd $COSMOS_DIR/tools && pwd) - -cd $COSMOS_TOOLS_DIR - -### -### Live Telemetry -### - -COSMOS_DATA=$(cd $BASE_DIR/gsw/cosmos/outputs/logs && pwd) -TLM_FILES=$(cd $COSMOS_DATA && ls 20*_tlm.bin) -for entry in $TLM_FILES -do - #echo "$entry" - #echo "${entry%.*}" - - ruby TlmExtractor --system nos3_system.txt --config ../../targets/CFS/tools/tlm_extractor/CF_HKPACKET.txt --input $entry --output $COSMOS_DATA"/"${entry%.*}"_CF_HKPACKET.csv" & - ruby TlmExtractor --system nos3_system.txt --config ../../targets/CFS/tools/tlm_extractor/CFE_EVS_PACKET.txt --input $entry --output $COSMOS_DATA"/"${entry%.*}"_CFE_EVS_PACKET.csv" & - ruby TlmExtractor --system nos3_system.txt --config ../../targets/CFS/tools/tlm_extractor/LC_HKPACKET.txt --input $entry --output $COSMOS_DATA"/"${entry%.*}"_LC_HKPACKET.csv" & - ruby TlmExtractor --system nos3_system.txt --config ../../targets/CFS/tools/tlm_extractor/SC_HKTLM.txt --input $entry --output $COSMOS_DATA"/"${entry%.*}"_SC_HKTLM.csv" & - - wait -done - -### -### DS Files -### - -#HK_DATA=$(cd $COSMOS_DATA/data/hk && pwd) -#HK_FILES=$(cd $HK_DATA && ls *.ds) -#for entry in $HK_FILES -#do -# ruby TlmExtractor --system nos3_ds_system.txt --config ../../targets/CFS/tools/tlm_extractor/CF_HKPACKET.txt --input ./data/hk/$entry --output $HK_DATA"/"${entry%.*}"_CF_HKPACKET.csv" & -# -# wait -#done - -exit 0 diff --git a/scripts/launch.sh b/scripts/launch.sh deleted file mode 100755 index b55e6efd..00000000 --- a/scripts/launch.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -i -# -# Convenience script for NOS3 development -# Use with the Dockerfile in the deployment repository -# https://github.com/nasa-itc/deployment -# - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -source $SCRIPT_DIR/env.sh - -echo "Make data folders..." -# FSW Side -mkdir $FSW_BIN/data 2> /dev/null -mkdir $FSW_BIN/data/cam 2> /dev/null -mkdir $FSW_BIN/data/evs 2> /dev/null -mkdir $FSW_BIN/data/hk 2> /dev/null -mkdir $FSW_BIN/data/inst 2> /dev/null -# GSW Side -mkdir /tmp/data 2> /dev/null -mkdir /tmp/data/cam 2> /dev/null -mkdir /tmp/data/evs 2> /dev/null -mkdir /tmp/data/hk 2> /dev/null -mkdir /tmp/data/inst 2> /dev/null -mkdir /tmp/uplink 2> /dev/null -cp $BASE_DIR/fsw/build/exe/cpu1/cf/cfe_es_startup.scr /tmp/uplink/tmp0.so 2> /dev/null -cp $BASE_DIR/fsw/build/exe/cpu1/cf/sample.so /tmp/uplink/tmp1.so 2> /dev/null - -echo "42..." -cd /opt/nos3/42/ -rm -rf NOS3InOut -cp -r $BASE_DIR/cfg/InOut /opt/nos3/42/NOS3InOut -gnome-terminal --tab --title="42 Dynamic Simulator" -- /opt/nos3/42/42 NOS3InOut - -echo "Simulators..." -cd $SIM_BIN -gnome-terminal --tab --title="NOS Engine Server" -- /usr/bin/nos_engine_server_standalone -f $SIM_BIN/nos_engine_server_config.json -gnome-terminal --tab --title="NOS STDIO Terminal" -- $SIM_BIN/nos3-single-simulator stdio-terminal -gnome-terminal --tab --title="NOS UDP Terminal" -- $SIM_BIN/nos3-single-simulator udp-terminal -gnome-terminal --tab --title="42 Truth Sim" -- $SIM_BIN/nos3-single-simulator truth42sim -gnome-terminal --tab --title='CAM Sim' -- $SIM_BIN/nos3-single-simulator camsim -gnome-terminal --tab --title='CSS Sim' -- $SIM_BIN/nos3-single-simulator generic_css_sim -gnome-terminal --tab --title='EPS Sim' -- $SIM_BIN/nos3-single-simulator generic_eps_sim -gnome-terminal --tab --title="FSS Sim" -- $SIM_BIN/nos3-single-simulator generic_fss_sim -gnome-terminal --tab --title='GPS Sim' -- $SIM_BIN/nos3-single-simulator gps -gnome-terminal --tab --title='IMU Sim' -- $SIM_BIN/nos3-single-simulator generic_imu_sim -gnome-terminal --tab --title='MAG Sim' -- $SIM_BIN/nos3-single-simulator generic_mag_sim -gnome-terminal --tab --title='Radio Sim' -- $SIM_BIN/nos3-single-simulator generic_radio_sim -gnome-terminal --tab --title='RW 0 Sim' -- $SIM_BIN/nos3-single-simulator generic-reactionwheel-sim0 -gnome-terminal --tab --title='RW 1 Sim' -- $SIM_BIN/nos3-single-simulator generic-reactionwheel-sim1 -gnome-terminal --tab --title='RW 2 Sim' -- $SIM_BIN/nos3-single-simulator generic-reactionwheel-sim2 -gnome-terminal --tab --title='Sample Sim' -- $SIM_BIN/nos3-single-simulator sample_sim -gnome-terminal --tab --title='Torquer Sim' -- $SIM_BIN/nos3-single-simulator generic_torquer_sim -gnome-terminal --tab --title='Thruster Sim' -- $SIM_BIN/nos3-single-simulator generic_thruster_sim -gnome-terminal --tab --title="NOS Time Driver" -- $SIM_BIN/nos3-single-simulator time -gnome-terminal --tab --title="SYNOPSIS Sim" -- $SIM_BIN/nos3-single-simulator synopsis - -#echo "CryptoLib..." -#mkdir $BASE_DIR/components/cryptolib/build/ -#cd $BASE_DIR/components/cryptolib/build/ -#export CFLAGS="-m32" -#cmake .. -DSUPPORT=1 && make -j2 -#gnome-terminal --tab --title="CryptoLib" -- $BASE_DIR/components/cryptolib/build/support/standalone -## Note: Can keep open if desired after a new gnome-profile is manually created -##cmake .. -DDEBUG=1 && make -j2 -##gnome-terminal --window-with-profile=KeepOpen --title="CryptoLib" -- $BASE_DIR/components/cryptolib/build/bin/standalone - -echo "COSMOS Ground Station..." -#cd $BASE_DIR/gsw/cosmos -#export MISSION_NAME=$(echo "NOS3") -#export PROCESSOR_ENDIANNESS=$(echo "LITTLE_ENDIAN") -#ruby Launcher -c nos3_launcher.txt --system nos3_system.txt & -pidof firefox > /dev/null -if [ $? -eq 1 ] -then - firefox localhost:2900 & -fi - -sleep 5 - -echo "Flight Software..." -cd $FSW_BIN -$SCRIPT_DIR/fsw_respawn.sh $FSW_BIN & -# Note: Can keep open if desired after a new gnome-profile is manually created -#gnome-terminal --window-with-profile=KeepOpen --title="NOS3 Flight Software" -- $FSW_BIN/core-cpu1 -R PO & diff --git a/scripts/stop.sh b/scripts/stop.sh index 7e930887..bcb11dcd 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -1,40 +1,41 @@ -#!/bin/bash +#!/bin/bash -i # # Convenience script for NOS3 development +# Use with the Dockerfile in the deployment repository +# https://github.com/nasa-itc/deployment # SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/env.sh -# cFS -killall -q -r -9 fsw_respawn.sh -killall -q -r -9 core-cpu* - -# COSMOS -#killall -q -9 ruby -#yes | rm $BASE_DIR/gsw/cosmos/Gemfile 2> /dev/null -#yes | rm $BASE_DIR/gsw/cosmos/Gemfile.lock 2> /dev/null -#yes | rm -r $BASE_DIR/gsw/cosmos/COMPONENTS 2> /dev/null -#killall -q -9 firefox - -# CryptoLib -killall -q -r -9 standalone - -# NOS3 -killall -q -r -9 'nos3.*simulator.*' -killall -q -r -9 nos3-* -killall -q nos_engine_server_standalone -killall -q nos-time-driver - # NOS3 GPIO rm -rf /tmp/gpio_fake # NOS3 Stored HK rm -rf $BASE_DIR/fsw/build/exe/cpu1/scratch/* +# Docker stop +cd $SCRIPT_DIR; $DFLAG compose down > /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 & +$DCALL ps --filter=name="influxdb*" -aq | xargs $DCALL stop > /dev/null 2>&1 & +$DCALL ps --filter=name="ttc-command*" -aq | xargs $DCALL stop > /dev/null 2>&1 & +$DCALL ps --filter ancestor="ballaerospace/cosmos:4.5.0" -aq | xargs $DCALL stop > /dev/null 2>&1 & + +# Intentionally wait to complete +wait + +# Docker cleanup +$DCALL container prune -f > /dev/null 2>&1 +$DNETWORK ls --filter=name="nos" | xargs $DNETWORK rm > /dev/null 2>&1 + # 42 -killall -q 42 -#rm -rf /opt/nos3/42/NOS3InOut -#rm -rf /tmp/gpio* +rm -rf $USER_NOS3_DIR/42/NOS3InOut +rm -rf /tmp/gpio* + +# COSMOS +yes | rm $GSW_DIR/Gemfile > /dev/null 2>&1 +yes | rm $GSW_DIR/Gemfile.lock > /dev/null 2>&1 -exit 0 \ No newline at end of file +exit 0