Skip to content

[nasa/nos3#838] OpenC3 Gem Autoloading and Python Scripting#860

Open
kevincbruce wants to merge 9 commits into
devfrom
nos3#838-openc3-scripting
Open

[nasa/nos3#838] OpenC3 Gem Autoloading and Python Scripting#860
kevincbruce wants to merge 9 commits into
devfrom
nos3#838-openc3-scripting

Conversation

@kevincbruce

Copy link
Copy Markdown
Contributor

Summary:
Seeks to greatly improve OpenC3 COSMOS 6.3.0 integration into NOS3 with the following major updates:

  • Consistent Automatic Building and Loading of .gem files with all the ruby and python files needed present and in the folders expected by COSMOS 6.3.0's gem building tools.
  • Automatic cleanup of gems, buckets, and other residuals with a make clean, so that new gem builds can be loaded cleanly.
  • System tests for the Sample App translated from ruby into Python for COSMOS 6.3.0, with minor tweaks/adaptations to ensure they run smoothly and consistently. These may serve as a rough guide for the translation of other apps system tests when we get to them in the future.

The biggest changes are to the gsw_openc3_clean/build/launch.sh files, the addition of python versions of the sample_lib, sample_test, sample_app_test, sample_ast_test, and sample_device_test files, and minor updates to the nos3_simulator.xml (commented line for easy switching between COSMOS 4.5 and COSMOS 6.3 settings for truth42sim interface).

How to test?

  • git pull
  • git checkout nos3#838-openc3-scripting, git submodule sync, git submodule update --init --recursive
  • If not updated to the dev/1.7.5 version of the containers (particularly 42), run a make uninstall and make prep
  • Go into nos3-mission.xml and update line 12 to openc3
  • Go into nos3-simulator.xml and comment out line 518 and uncomment line 519 (so your cosmos hostname for truth42sim is set to active-gs to hook to the proper COSMOS 6.3 container). I have tested with the radio set to occulted and delay on. System tests do not use radio, so should not effect them, but did verify the radio line of sight feature works in openc3's radio interface.
  • make clean, make config, make, make launch
  • On launch, you may need to refresh firefox a few times to get openc3 up properly. Put in whatever password you want when prompted. In the terminal tab where you ran make launch, you should, after a minute or two, see the gem upload process start. Verify that once it is done spamming to the terminal, you get an upload successful or similar message, rather than an upload failure. Then, wait several minutes until all your interfaces show up as connected in the Command Telemetry Server tab of OpenC3 (may require refreshes to see, and a refresh once all interfaces (and thus microservices, as the interfaces load last) are loaded, or else some options may not show up in the menu/drop down on the left side.
  • Once in a steady state, switch to the Script Runner tab, in the file menu select Open File, and navigate to SAMPLE_DEBUG/scripts/sample_test.py (note, the ones in SAMPLE_RADIO should work as well, but will use SAMPLE_DEBUG, not the radio).
  • Once loaded, it should switch to the test runner interface. On the top option (test suite level), click Start. Verify the test runs successfully without errors. Run a few more times to verify.
  • Run a make stop to bring things down
  • Run a make launch to verify it launches again without attempting to overwrite the existing gem file. Feel free to test functionality again once it is up. It should come up much quicker with the gem already set up.
  • When done, run make stop to bring NOS3 down

Submodule PRs and actions prior to closing this:

Closes #838

kevincbruce and others added 9 commits March 27, 2026 18:48
…erly cleaned and regenerated; however, missing api key is blocking upload to openc3
…rs, rebuild, and load the gem; still not detecting scripts/procedures to pack into the gem
…ibs preprocessed as modules, and 42truthsim to link to its interface correctly (links to 42, not to openc3)
…/device test in OpenC3 (if it is working in base cosmos); fixed gem autoload to be robust. fixed gem generation to handle python so it can be globbed loaded for scripts; need to fix bus bridge for device test and ast
…s for Sim Bridge into separate target as done in COSMOS 4.5; Verified tests execute successfully (note, need to manually renable radio after test to work at the moment, it seems).
… flushing/requests for data back in due to speed increase, plus some extra waits and the like
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.06%. Comparing base (2fe9794) to head (43ac267).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #860   +/-   ##
=======================================
  Coverage   72.06%   72.06%           
=======================================
  Files         761      761           
  Lines       91123    91123           
  Branches     7289     7289           
=======================================
  Hits        65668    65668           
  Misses      25455    25455           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants