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#403] CI and Repo Cleanup #404

Merged
merged 6 commits into from
Nov 7, 2024
Merged
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
17 changes: 0 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build

on:
push:
pull_request:

jobs:
Expand All @@ -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

Expand All @@ -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
56 changes: 21 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion cfg/nos3_defs/tables/sch_def_schtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
File renamed without changes.
11 changes: 0 additions & 11 deletions scripts/build_fprime.sh

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/config.sh → scripts/cfg/config.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

# Make flight software configuration directory
mkdir -p $BASE_DIR/cfg/build
Expand All @@ -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
31 changes: 12 additions & 19 deletions scripts/configure.py → scripts/cfg/configure.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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...')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 2 additions & 11 deletions scripts/prepare.sh → scripts/cfg/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/real_clean.sh → scripts/cfg/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 0 additions & 32 deletions scripts/cfs_build_fsw.sh

This file was deleted.

Loading
Loading