openc3-cosmos-tool-docs 6.2.1 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +1 -1
  3. data/tools/staticdocs/assets/images/horizontalbox-085c91cebe26fdd5f85b467556607dd4631da5bccabd84fb164d1f46e45e60c9.png +0 -0
  4. data/tools/staticdocs/assets/images/verticalbox-75738427d398302986b52afb373acef11abf3a24f60d20b8cca442688054b22b.png +0 -0
  5. data/tools/staticdocs/assets/js/1e02e6a3.12bdc98d.js +1 -0
  6. data/tools/staticdocs/assets/js/2bb7bf90.4a658ce6.js +1 -0
  7. data/tools/staticdocs/assets/js/35398c5c.fcf47881.js +1 -0
  8. data/tools/staticdocs/assets/js/5bc719f6.6d27292c.js +1 -0
  9. data/tools/staticdocs/assets/js/5c6ce5ec.652b922b.js +1 -0
  10. data/tools/staticdocs/assets/js/6b210247.6a77064a.js +1 -0
  11. data/tools/staticdocs/assets/js/6f92e431.6439052e.js +1 -0
  12. data/tools/staticdocs/assets/js/75e64983.324643a8.js +1 -0
  13. data/tools/staticdocs/assets/js/{7f5b2696.72e3b019.js → 7f5b2696.a3dc640e.js} +1 -1
  14. data/tools/staticdocs/assets/js/{9424f0b3.96e6dac4.js → 9424f0b3.3683501c.js} +1 -1
  15. data/tools/staticdocs/assets/js/964eb012.dbc2c206.js +1 -0
  16. data/tools/staticdocs/assets/js/97535711.e595488c.js +1 -0
  17. data/tools/staticdocs/assets/js/99581c43.841b4a2e.js +1 -0
  18. data/tools/staticdocs/assets/js/a9987364.b418f772.js +1 -0
  19. data/tools/staticdocs/assets/js/a9b2dc27.e01c9bb4.js +1 -0
  20. data/tools/staticdocs/assets/js/aa6b6c1b.3aad95fc.js +1 -0
  21. data/tools/staticdocs/assets/js/b062d239.535a2ceb.js +1 -0
  22. data/tools/staticdocs/assets/js/ce89ef36.6b89b0fe.js +1 -0
  23. data/tools/staticdocs/assets/js/{d8ca4191.f5da7c6d.js → d8ca4191.8df86c99.js} +1 -1
  24. data/tools/staticdocs/assets/js/db8fa1d0.f1eed806.js +1 -0
  25. data/tools/staticdocs/assets/js/{main.485b7747.js → main.8d947189.js} +2 -2
  26. data/tools/staticdocs/assets/js/runtime~main.d38c5d36.js +1 -0
  27. data/tools/staticdocs/docs/configuration/accessors.html +1 -1
  28. data/tools/staticdocs/docs/configuration/command.html +1 -1
  29. data/tools/staticdocs/docs/configuration/format.html +1 -1
  30. data/tools/staticdocs/docs/configuration/interfaces.html +1 -1
  31. data/tools/staticdocs/docs/configuration/plugins.html +1 -1
  32. data/tools/staticdocs/docs/configuration/protocols.html +1 -1
  33. data/tools/staticdocs/docs/configuration/ssl-tls.html +1 -1
  34. data/tools/staticdocs/docs/configuration/table.html +1 -1
  35. data/tools/staticdocs/docs/configuration/target.html +1 -1
  36. data/tools/staticdocs/docs/configuration/telemetry-screens.html +5 -5
  37. data/tools/staticdocs/docs/configuration/telemetry.html +1 -1
  38. data/tools/staticdocs/docs/configuration.html +1 -1
  39. data/tools/staticdocs/docs/development/curl.html +1 -1
  40. data/tools/staticdocs/docs/development/developing.html +1 -1
  41. data/tools/staticdocs/docs/development/json-api.html +1 -1
  42. data/tools/staticdocs/docs/development/log-structure.html +1 -1
  43. data/tools/staticdocs/docs/development/roadmap.html +20 -29
  44. data/tools/staticdocs/docs/development/streaming-api.html +88 -2
  45. data/tools/staticdocs/docs/development/testing.html +5 -2
  46. data/tools/staticdocs/docs/development.html +1 -1
  47. data/tools/staticdocs/docs/getting-started/cli.html +47 -0
  48. data/tools/staticdocs/docs/getting-started/generators.html +2 -2
  49. data/tools/staticdocs/docs/getting-started/gettingstarted.html +2 -2
  50. data/tools/staticdocs/docs/getting-started/installation.html +3 -3
  51. data/tools/staticdocs/docs/getting-started/{key_concepts.html → key-concepts.html} +3 -3
  52. data/tools/staticdocs/docs/getting-started/podman.html +2 -2
  53. data/tools/staticdocs/docs/getting-started/requirements.html +2 -2
  54. data/tools/staticdocs/docs/getting-started/upgrading.html +3 -3
  55. data/tools/staticdocs/docs/getting-started.html +1 -1
  56. data/tools/staticdocs/docs/guides/bridges.html +1 -1
  57. data/tools/staticdocs/docs/guides/cfs.html +1 -1
  58. data/tools/staticdocs/docs/guides/custom-widgets.html +2 -2
  59. data/tools/staticdocs/docs/guides/dynamic-packets.html +17 -0
  60. data/tools/staticdocs/docs/guides/{exposing_microservices.html → exposing-microservices.html} +2 -2
  61. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +2 -2
  62. data/tools/staticdocs/docs/guides/local-mode.html +1 -1
  63. data/tools/staticdocs/docs/guides/logging.html +1 -1
  64. data/tools/staticdocs/docs/guides/monitoring.html +1 -1
  65. data/tools/staticdocs/docs/guides/performance.html +1 -1
  66. data/tools/staticdocs/docs/guides/raspberrypi.html +1 -1
  67. data/tools/staticdocs/docs/guides/script-writing.html +1 -1
  68. data/tools/staticdocs/docs/guides/scripting-api.html +33 -3
  69. data/tools/staticdocs/docs/guides.html +1 -1
  70. data/tools/staticdocs/docs/meta/contributing.html +1 -1
  71. data/tools/staticdocs/docs/meta/licenses.html +1 -1
  72. data/tools/staticdocs/docs/meta/philosophy.html +1 -1
  73. data/tools/staticdocs/docs/meta/xtce.html +1 -1
  74. data/tools/staticdocs/docs/meta.html +1 -1
  75. data/tools/staticdocs/docs/privacy.html +1 -1
  76. data/tools/staticdocs/docs/tools/admin.html +1 -1
  77. data/tools/staticdocs/docs/tools/autonomic.html +1 -1
  78. data/tools/staticdocs/docs/tools/bucket-explorer.html +1 -1
  79. data/tools/staticdocs/docs/tools/calendar.html +1 -1
  80. data/tools/staticdocs/docs/tools/cmd-sender.html +1 -1
  81. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +1 -1
  82. data/tools/staticdocs/docs/tools/command_history.html +1 -1
  83. data/tools/staticdocs/docs/tools/data-extractor.html +1 -1
  84. data/tools/staticdocs/docs/tools/data-viewer.html +1 -1
  85. data/tools/staticdocs/docs/tools/handbooks.html +1 -1
  86. data/tools/staticdocs/docs/tools/limits-monitor.html +1 -1
  87. data/tools/staticdocs/docs/tools/packet-viewer.html +1 -1
  88. data/tools/staticdocs/docs/tools/script-runner.html +1 -1
  89. data/tools/staticdocs/docs/tools/table-manager.html +1 -1
  90. data/tools/staticdocs/docs/tools/tlm-grapher.html +1 -1
  91. data/tools/staticdocs/docs/tools/tlm-viewer.html +1 -1
  92. data/tools/staticdocs/docs/tools.html +1 -1
  93. data/tools/staticdocs/docs.html +1 -1
  94. data/tools/staticdocs/img/telemetry_viewer/widgets/horizontalbox.png +0 -0
  95. data/tools/staticdocs/img/telemetry_viewer/widgets/verticalbox.png +0 -0
  96. data/tools/staticdocs/index.html +1 -1
  97. data/tools/staticdocs/lunr-index-1743825503427.json +1 -0
  98. data/tools/staticdocs/lunr-index.json +1 -1
  99. data/tools/staticdocs/markdown-page.html +1 -1
  100. data/tools/staticdocs/search-doc-1743825503427.json +1 -0
  101. data/tools/staticdocs/search-doc.json +1 -1
  102. data/tools/staticdocs/sitemap.xml +1 -1
  103. metadata +33 -32
  104. data/tools/staticdocs/assets/images/horizontalbox-ddf82f64de700286a742a71e0c1adebbc7e9822a0dff41139f41bc476e4fc4ce.png +0 -0
  105. data/tools/staticdocs/assets/images/verticalbox-28fdba6f2c051a499b7f08a1be97edf0297ac9a9ce0dba44f02a7fe1c2616d91.png +0 -0
  106. data/tools/staticdocs/assets/js/1e02e6a3.f477eca7.js +0 -1
  107. data/tools/staticdocs/assets/js/2bb7bf90.4051cf46.js +0 -1
  108. data/tools/staticdocs/assets/js/31436304.a6b2eb4a.js +0 -1
  109. data/tools/staticdocs/assets/js/5bc719f6.b84c55e3.js +0 -1
  110. data/tools/staticdocs/assets/js/5c6ce5ec.67d1d92e.js +0 -1
  111. data/tools/staticdocs/assets/js/6b210247.ef28d4e5.js +0 -1
  112. data/tools/staticdocs/assets/js/6f92e431.d2ce2753.js +0 -1
  113. data/tools/staticdocs/assets/js/75e64983.81988bef.js +0 -1
  114. data/tools/staticdocs/assets/js/97535711.78660098.js +0 -1
  115. data/tools/staticdocs/assets/js/99581c43.5e55992d.js +0 -1
  116. data/tools/staticdocs/assets/js/a9987364.81e9c91d.js +0 -1
  117. data/tools/staticdocs/assets/js/aa6b6c1b.08f58887.js +0 -1
  118. data/tools/staticdocs/assets/js/ce89ef36.1d76e86a.js +0 -1
  119. data/tools/staticdocs/assets/js/db8fa1d0.94b76b52.js +0 -1
  120. data/tools/staticdocs/assets/js/ebec1ccb.f938ebaa.js +0 -1
  121. data/tools/staticdocs/assets/js/runtime~main.61a578da.js +0 -1
  122. data/tools/staticdocs/lunr-index-1741317069195.json +0 -1
  123. data/tools/staticdocs/search-doc-1741317069195.json +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["2669"],{4823:function(e,t,n){n.r(t),n.d(t,{default:()=>p,frontMatter:()=>o,metadata:()=>s,assets:()=>c,toc:()=>l,contentTitle:()=>a});var s=JSON.parse('{"id":"getting-started/cli","title":"Command Line Interface","description":"Using openc3.sh","source":"@site/docs/getting-started/cli.md","sourceDirName":"getting-started","slug":"/getting-started/cli","permalink":"/tools/staticdocs/docs/getting-started/cli","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/getting-started/cli.md","tags":[],"version":"current","sidebarPosition":5,"frontMatter":{"sidebar_position":5,"title":"Command Line Interface","description":"Using openc3.sh","sidebar_custom_props":{"myEmoji":"\u2328\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Upgrading","permalink":"/tools/staticdocs/docs/getting-started/upgrading"},"next":{"title":"Code Generators","permalink":"/tools/staticdocs/docs/getting-started/generators"}}'),i=n("2322"),r=n("2840");let o={sidebar_position:5,title:"Command Line Interface",description:"Using openc3.sh",sidebar_custom_props:{myEmoji:"\u2328\uFE0F"}},a=void 0,c={},l=[{value:"Rake",id:"rake",level:2},{value:"IRB",id:"irb",level:2},{value:"Script",id:"script",level:2},{value:"List",id:"list",level:3},{value:"Spawn",id:"spawn",level:3},{value:"Run",id:"run",level:3},{value:"Validate",id:"validate",level:2},{value:"Load",id:"load",level:2},{value:"List",id:"list-1",level:2},{value:"Generate",id:"generate",level:2},{value:"Bridge",id:"bridge",level:2},{value:"Pkginstall and pkguninstall",id:"pkginstall-and-pkguninstall",level:2},{value:"Rubysloc (deprecated)",id:"rubysloc-deprecated",level:2},{value:"XTCE Converter",id:"xtce-converter",level:2},{value:"CSTOL Converter",id:"cstol-converter",level:2}];function d(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["The COSMOS Command Line Interface is ",(0,i.jsx)(t.code,{children:"openc3.sh"})," and ",(0,i.jsx)(t.code,{children:"openc3.bat"})," which are included in the COSMOS ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project",children:"project"})," (more about ",(0,i.jsx)(t.a,{href:"key-concepts#projects",children:"projects"}),")."]}),"\n",(0,i.jsxs)(t.p,{children:["If you followed the ",(0,i.jsx)(t.a,{href:"/tools/staticdocs/docs/getting-started/installation",children:"Installation Guide"})," you should already be inside a cloned ",(0,i.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project",children:"openc3-project"})," which is in your PATH (necessary for openc3.bat / openc3.sh to be resolved). To see all the available type the following:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli\nUsage:\n cli help # Displays this information\n cli rake # Runs rake in the local directory\n cli irb # Runs irb in the local directory\n cli script list /PATH SCOPE # lists script names filtered by path within scope, 'DEFAULT' if not given\n cli script spawn NAME SCOPE variable1=value1 variable2=value2 # Starts named script remotely\n cli script run NAME SCOPE variable1=value1 variable2=value2 # Starts named script, monitoring status on console, by default until error or exit\n PARAMETERS name-value pairs to form the script's runtime environment\n OPTIONS: --wait 0 seconds to monitor status before detaching from the running script; ie --wait 100\n --disconnect run the script in disconnect mode\n cli script init # initialize running scripts (Enterprise Only)\n cli validate /PATH/FILENAME.gem SCOPE variables.txt # Validate a COSMOS plugin gem file\n cli load /PATH/FILENAME.gem SCOPE variables.txt # Loads a COSMOS plugin gem file\n cli list <SCOPE> # Lists installed plugins, SCOPE is DEFAULT if not given\n cli generate TYPE OPTIONS # Generate various COSMOS entities\n OPTIONS: --ruby or --python is required to specify the language in the generated code unless OPENC3_LANGUAGE is set\n cli bridge CONFIG_FILENAME # Run COSMOS host bridge\n cli bridgegem gem_name variable1=value1 variable2=value2 # Runs bridge using gem bridge.txt\n cli bridgesetup CONFIG_FILENAME # Create a default config file\n cli pkginstall PKGFILENAME SCOPE # Install loaded package (Ruby gem or python package)\n cli pkguninstall PKGFILENAME SCOPE # Uninstall loaded package (Ruby gem or python package)\n cli rubysloc # DEPRECATED: Please use scc (https://github.com/boyter/scc)\n cli xtce_converter # Convert to and from the XTCE format. Run with --help for more info.\n cli cstol_converter # Converts CSTOL files (.prc) to COSMOS. Run with --help for more info.\n"})}),"\n",(0,i.jsx)(t.admonition,{title:"seccomp profile",type:"note",children:(0,i.jsxs)(t.p,{children:["You can safely ignore ",(0,i.jsx)(t.code,{children:"WARNING: daemon is not using the default seccomp profile"})]})}),"\n",(0,i.jsx)(t.h2,{id:"rake",children:"Rake"}),"\n",(0,i.jsxs)(t.p,{children:["You can execute rake tasks using ",(0,i.jsx)(t.code,{children:"openc3.sh cli rake"}),". The most typical usage is to generate a plugin and then build it. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli rake build VERSION=1.0.0\n"})}),"\n",(0,i.jsx)(t.h2,{id:"irb",children:"IRB"}),"\n",(0,i.jsxs)(t.p,{children:["IRB stands for Interactive Ruby and is a way to start a Ruby interpreter that you can play around with. When using it from the CLI, it includes the COSMOS Ruby path so you can ",(0,i.jsx)(t.code,{children:"require 'cosmos'"})," and try out various methods. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'% openc3.sh cli irb\nirb(main):001:0> require \'cosmos\'\n=> true\nirb(main):002:0> Cosmos::Api::WHITELIST\n=>\n["get_interface",\n "get_interface_names",\n ...\n]\n'})}),"\n",(0,i.jsx)(t.h2,{id:"script",children:"Script"}),"\n",(0,i.jsx)(t.p,{children:"The script methods allow you to list the available scripts, spawn a script, and run a script while monitoring its output. Note that you must set the OPENC3_API_PASSWORD in Open Source and both the OPENC3_API_USER and OPENC3_API_PASSWORD in Enterprise."}),"\n",(0,i.jsx)(t.admonition,{title:"Offline Access Token",type:"note",children:(0,i.jsx)(t.p,{children:'You must visit the frontend Script Runner page as the OPENC3_API_USER or run "openc3.sh cli script init" in order to obtain an offline access token before the other script cli methods will work.'})}),"\n",(0,i.jsx)(t.h3,{id:"list",children:"List"}),"\n",(0,i.jsx)(t.p,{children:"List all the available scripts which includes all the files in every target directory. You can filter this list using bash to only include procedures, Ruby files, Python files, etc."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% export OPENC3_API_USER=operator\n% export OPENC3_API_PASSWORD=operator\n% openc3.sh cli script list\nEXAMPLE/cmd_tlm/example_cmds.txt\nEXAMPLE/cmd_tlm/example_tlm.txt\n...\n"})}),"\n",(0,i.jsx)(t.h3,{id:"spawn",children:"Spawn"}),"\n",(0,i.jsxs)(t.p,{children:["The ID of the spawned script is returned. You can connect to it in Script Runner by visiting ",(0,i.jsx)(t.code,{children:"http://localhost:2900/tools/scriptrunner/1"})," where the final value is the ID."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh spawn INST/procedures/checks.rb\n1\n"})}),"\n",(0,i.jsx)(t.h3,{id:"run",children:"Run"}),"\n",(0,i.jsx)(t.p,{children:"Run spawns the script and then captures the output and prints it to the shell. Note that this will not work with user input prompts so the script must be written to prevent user input. You can also pass variables to the script as shown in the CLI help."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'% openc3.sh cli script run INST/procedures/stash.rb\nFilename INST/procedures/stash.rb scope DEFAULT\n2025/03/22 19:50:40.429 (SCRIPTRUNNER): Script config/DEFAULT/targets/INST/procedures/stash.rb spawned in 0.796683293 seconds <ruby 3.2.6>\n2025/03/22 19:50:40.453 (SCRIPTRUNNER): Starting script: stash.rb, line_delay = 0.1\nAt [INST/procedures/stash.rb:3] state [running]\nAt [INST/procedures/stash.rb:4] state [running]\n2025/03/22 19:50:40.732 (stash.rb:4): key1: val1\nAt [INST/procedures/stash.rb:5] state [running]\nAt [INST/procedures/stash.rb:6] state [running]\n2025/03/22 19:50:40.936 (stash.rb:6): key2: val2\nAt [INST/procedures/stash.rb:7] state [running]\n2025/03/22 19:50:41.039 (stash.rb:7): CHECK: \'val1\' == \'val1\' is TRUE\nAt [INST/procedures/stash.rb:8] state [running]\n2025/03/22 19:50:41.146 (stash.rb:8): CHECK: \'val2\' == \'val2\' is TRUE\nAt [INST/procedures/stash.rb:9] state [running]\n2025/03/22 19:50:41.256 (stash.rb:9): CHECK: \'["key1", "key2"]\' == \'["key1", "key2"]\' is TRUE\nAt [INST/procedures/stash.rb:10] state [running]\nAt [INST/procedures/stash.rb:11] state [running]\nAt [INST/procedures/stash.rb:12] state [running]\n2025/03/22 19:50:41.556 (stash.rb:12): CHECK: \'{"key1"=>1, "key2"=>2}\' == \'{"key1"=>1, "key2"=>2}\' is TRUE\nAt [INST/procedures/stash.rb:13] state [running]\nAt [INST/procedures/stash.rb:14] state [running]\n2025/03/22 19:50:41.763 (stash.rb:14): CHECK: true == true is TRUE\nAt [INST/procedures/stash.rb:15] state [running]\nAt [INST/procedures/stash.rb:16] state [running]\nAt [INST/procedures/stash.rb:17] state [running]\nAt [INST/procedures/stash.rb:18] state [running]\n2025/03/22 19:50:42.176 (stash.rb:18): CHECK: \'[1, 2, [3, 4]]\' == \'[1, 2, [3, 4]]\' is TRUE\nAt [INST/procedures/stash.rb:19] state [running]\nAt [INST/procedures/stash.rb:21] state [running]\nAt [INST/procedures/stash.rb:22] state [running]\nAt [INST/procedures/stash.rb:23] state [running]\n2025/03/22 19:50:42.587 (stash.rb:23): CHECK: \'{"one"=>1, "two"=>2, "string"=>"string"}\' == \'{"one"=>1, "two"=>2, "string"=>"string"}\' is TRUE\nAt [INST/procedures/stash.rb:24] state [running]\n2025/03/22 19:50:42.697 (SCRIPTRUNNER): Script completed: stash.rb\nAt [INST/procedures/stash.rb:0] state [stopped]\nscript complete\n%\n'})}),"\n",(0,i.jsx)(t.h2,{id:"validate",children:"Validate"}),"\n",(0,i.jsx)(t.p,{children:"Validate is used to validate built COSMOS plugins. It walks through the installation process without actually installing the plugin."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli validate openc3-cosmos-cfdp-1.0.0.gem\nInstalling openc3-cosmos-cfdp-1.0.0.gem\nSuccessfully validated openc3-cosmos-cfdp-1.0.0.gem\n"})}),"\n",(0,i.jsx)(t.h2,{id:"load",children:"Load"}),"\n",(0,i.jsx)(t.p,{children:"Load can load a plugin into COSMOS without using the GUI. This is useful for scripts or CI/CD pipelines."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'% openc3.sh cli load openc3-cosmos-cfdp-1.0.0.gem\nLoading new plugin: openc3-cosmos-cfdp-1.0.0.gem\n{"name"=>"openc3-cosmos-cfdp-1.0.0.gem", "variables"=>{"cfdp_microservice_name"=>"CFDP", "cfdp_route_prefix"=>"/cfdp", "cfdp_port"=>"2905", "cfdp_cmd_target_name"=>"CFDP2", "cfdp_cmd_packet_name"=>"CFDP_PDU", "cfdp_cmd_item_name"=>"PDU", "cfdp_tlm_target_name"=>"CFDP2", "cfdp_tlm_packet_name"=>"CFDP_PDU", "cfdp_tlm_item_name"=>"PDU", "source_entity_id"=>"1", "destination_entity_id"=>"2", "root_path"=>"/DEFAULT/targets_modified/CFDP/tmp", "bucket"=>"config", "plugin_test_mode"=>"false"}, "plugin_txt_lines"=>["VARIABLE cfdp_microservice_name CFDP", "VARIABLE cfdp_route_prefix /cfdp", "VARIABLE cfdp_port 2905", "", "VARIABLE cfdp_cmd_target_name CFDP2", "VARIABLE cfdp_cmd_packet_name CFDP_PDU", "VARIABLE cfdp_cmd_item_name PDU", "", "VARIABLE cfdp_tlm_target_name CFDP2", "VARIABLE cfdp_tlm_packet_name CFDP_PDU", "VARIABLE cfdp_tlm_item_name PDU", "", "VARIABLE source_entity_id 1", "VARIABLE destination_entity_id 2", "VARIABLE root_path /DEFAULT/targets_modified/CFDP/tmp", "VARIABLE bucket config", "", "# Set to true to enable a test configuration", "VARIABLE plugin_test_mode \\"false\\"", "", "MICROSERVICE CFDP <%= cfdp_microservice_name %>", " WORK_DIR .", " ROUTE_PREFIX <%= cfdp_route_prefix %>", " ENV OPENC3_ROUTE_PREFIX <%= cfdp_route_prefix %>", " ENV SECRET_KEY_BASE 324973597349867207430793759437697498769349867349674", " PORT <%= cfdp_port %>", " CMD rails s -b 0.0.0.0 -p <%= cfdp_port %> -e production", " # MIB Options Follow -", " # You will need to modify these for your mission", " OPTION source_entity_id <%= source_entity_id %>", " OPTION tlm_info <%= cfdp_tlm_target_name %> <%= cfdp_tlm_packet_name %> <%= cfdp_tlm_item_name %>", " OPTION destination_entity_id <%= destination_entity_id %>", " OPTION cmd_info <%= cfdp_cmd_target_name %> <%= cfdp_cmd_packet_name %> <%= cfdp_cmd_item_name %>", " OPTION root_path <%= root_path %>", " <% if bucket.to_s.strip != \'\' %>", " OPTION bucket <%= bucket %>", " <% end %>", "", "<% include_test = (plugin_test_mode.to_s.strip.downcase == \\"true\\") %>", "<% if include_test %>", " TARGET CFDPTEST CFDP", " TARGET CFDPTEST CFDP2", "", " MICROSERVICE CFDP CFDP2", " WORK_DIR .", " ROUTE_PREFIX /cfdp2", " ENV OPENC3_ROUTE_PREFIX /cfdp2", " ENV SECRET_KEY_BASE 324973597349867207430793759437697498769349867349674", " PORT 2906", " CMD rails s -b 0.0.0.0 -p 2906 -e production", " OPTION source_entity_id <%= destination_entity_id %>", " OPTION tlm_info CFDP CFDP_PDU PDU", " OPTION destination_entity_id <%= source_entity_id %>", " OPTION cmd_info CFDP CFDP_PDU PDU", " OPTION root_path <%= root_path %>", " <% if bucket.to_s.strip != \'\' %>", " OPTION bucket <%= bucket %>", " <% end %>", "", " <% test_host = ENV[\'KUBERNETES_SERVICE_HOST\'] ? (scope.to_s.downcase + \\"-interface-cfdp2-int-service\\") : \\"openc3-operator\\" %>", " INTERFACE CFDP_INT tcpip_client_interface.rb <%= test_host %> 2907 2907 10.0 nil LENGTH 0 32 4 1 BIG_ENDIAN 0 nil nil true", " MAP_TARGET CFDP", "", " INTERFACE CFDP2_INT tcpip_server_interface.rb 2907 2907 10.0 nil LENGTH 0 32 4 1 BIG_ENDIAN 0 nil nil true", " PORT 2907", " MAP_TARGET CFDP2", "<% end %>"], "needs_dependencies"=>false, "updated_at"=>nil}\nUpdating local plugin files: /plugins/DEFAULT/openc3-cosmos-cfdp\n'})}),"\n",(0,i.jsx)(t.h2,{id:"list-1",children:"List"}),"\n",(0,i.jsx)(t.p,{children:"List displays all the installed plugins."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli list\nopenc3-cosmos-cfdp-1.0.0.gem__20250325160956\nopenc3-cosmos-demo-6.2.2.pre.beta0.20250325143120.gem__20250325160201\nopenc3-cosmos-enterprise-tool-admin-6.2.2.pre.beta0.20250325155648.gem__20250325160159\nopenc3-cosmos-tool-autonomic-6.2.2.pre.beta0.20250325155658.gem__20250325160225\nopenc3-cosmos-tool-bucketexplorer-6.2.2.pre.beta0.20250325143107.gem__20250325160227\nopenc3-cosmos-tool-calendar-6.2.2.pre.beta0.20250325155654.gem__20250325160224\nopenc3-cosmos-tool-cmdhistory-6.2.2.pre.beta0.20250325155651.gem__20250325160212\nopenc3-cosmos-tool-cmdsender-6.2.2.pre.beta0.20250325143111.gem__20250325160211\nopenc3-cosmos-tool-cmdtlmserver-6.2.2.pre.beta0.20250325143114.gem__20250325160208\nopenc3-cosmos-tool-dataextractor-6.2.2.pre.beta0.20250325143104.gem__20250325160219\nopenc3-cosmos-tool-dataviewer-6.2.2.pre.beta0.20250325143108.gem__20250325160220\nopenc3-cosmos-tool-docs-6.2.2.pre.beta0.20250325155535.gem__20250325160228\nopenc3-cosmos-tool-grafana-6.2.2.pre.beta0.20250325155658.gem__20250325160233\nopenc3-cosmos-tool-handbooks-6.2.2.pre.beta0.20250325143113.gem__20250325160222\nopenc3-cosmos-tool-iframe-6.2.2.pre.beta0.20250325143110.gem__20250325160158\nopenc3-cosmos-tool-limitsmonitor-6.2.2.pre.beta0.20250325155448.gem__20250325160209\nopenc3-cosmos-tool-packetviewer-6.2.2.pre.beta0.20250325143104.gem__20250325160215\nopenc3-cosmos-tool-scriptrunner-6.2.2.pre.beta0.20250325143111.gem__20250325160214\nopenc3-cosmos-tool-tablemanager-6.2.2.pre.beta0.20250325143116.gem__20250325160223\nopenc3-cosmos-tool-tlmgrapher-6.2.2.pre.beta0.20250325143105.gem__20250325160218\nopenc3-cosmos-tool-tlmviewer-6.2.2.pre.beta0.20250325143108.gem__20250325160216\nopenc3-enterprise-tool-base-6.2.2.pre.beta0.20250325155704.gem__20250325160153\n"})}),"\n",(0,i.jsx)(t.h2,{id:"generate",children:"Generate"}),"\n",(0,i.jsxs)(t.p,{children:["Generate is used to scaffold new COSMOS plugins, targets, conversions, and more! See the ",(0,i.jsx)(t.a,{href:"/docs/getting-started/generators",children:"Generators"})," page for more information."]}),"\n",(0,i.jsx)(t.h2,{id:"bridge",children:"Bridge"}),"\n",(0,i.jsxs)(t.p,{children:["A COSMOS Bridge is a small application that is run on the local computer to connect to hardware not available to Docker containers. A good example is connecting to a serial port on a non-linux system. See the\n",(0,i.jsx)(t.a,{href:"/docs/guides/bridges",children:"Bridge Guide"})," for more information."]}),"\n",(0,i.jsx)(t.h2,{id:"pkginstall-and-pkguninstall",children:"Pkginstall and pkguninstall"}),"\n",(0,i.jsx)(t.p,{children:"Allows you to install or remove Ruby gems or Python wheels into COSMOS. These are dependencies that are not packaged with the COSMOS plugin itself."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli pkginstall rspec-3.13.0.gem\n"})}),"\n",(0,i.jsx)(t.h2,{id:"rubysloc-deprecated",children:"Rubysloc (deprecated)"}),"\n",(0,i.jsxs)(t.p,{children:["Calculates the Ruby Source Lines of Code (SLOC) from the current directory recursively. We recommend using ",(0,i.jsx)(t.a,{href:"https://github.com/boyter/scc",children:"scc"})," as it works across any programming language, calculates many more statistics, and is blazing fast."]}),"\n",(0,i.jsx)(t.h2,{id:"xtce-converter",children:"XTCE Converter"}),"\n",(0,i.jsx)(t.p,{children:"Converts from the XTCE format to the COSMOS format and also exports XTCE files given a COSMOS plugin."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli xtce_converter\nUsage: xtce_converter [options] --import input_xtce_filename --output output_dir\n xtce_converter [options] --plugin /PATH/FILENAME.gem --output output_dir --variables variables.txt\n\n -h, --help Show this message\n -i, --import VALUE Import the specified .xtce file\n -o, --output DIRECTORY Create files in the directory\n -p, --plugin PLUGIN Export .xtce file(s) from the plugin\n -v, --variables Optional variables file to pass to the plugin\n"})}),"\n",(0,i.jsx)(t.h2,{id:"cstol-converter",children:"CSTOL Converter"}),"\n",(0,i.jsx)(t.p,{children:"Converts from the Colorado System Test and Operations Language (CSTOL) to a COSMOS Script Runner Ruby script. It currently does not support conversion to Python. Simply run it in the same directory as CSTOL files (*.prc) and it will convert them all."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"% openc3.sh cli cstol_converter\n"})})]})}function p(e={}){let{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},2840:function(e,t,n){n.d(t,{Z:function(){return a},a:function(){return o}});var s=n(2784);let i={},r=s.createContext(i);function o(e){let t=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["3824"],{7284:function(e,n,s){s.r(n),s.d(n,{default:()=>h,frontMatter:()=>r,metadata:()=>t,assets:()=>c,toc:()=>a,contentTitle:()=>l});var t=JSON.parse('{"id":"development/testing","title":"Testing COSMOS","description":"Running the Playwright integration tests and unit tests","source":"@site/docs/development/testing.md","sourceDirName":"development","slug":"/development/testing","permalink":"/tools/staticdocs/docs/development/testing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/testing.md","tags":[],"version":"current","frontMatter":{"title":"Testing COSMOS","description":"Running the Playwright integration tests and unit tests","sidebar_custom_props":{"myEmoji":"\uD83D\uDCCB"}},"sidebar":"defaultSidebar","previous":{"title":"Streaming API","permalink":"/tools/staticdocs/docs/development/streaming-api"},"next":{"title":"Meta","permalink":"/tools/staticdocs/docs/meta"}}'),o=s("2322"),i=s("2840");let r={title:"Testing COSMOS",description:"Running the Playwright integration tests and unit tests",sidebar_custom_props:{myEmoji:"\uD83D\uDCCB"}},l=void 0,c={},a=[{value:"Playwright",id:"playwright",level:2},{value:"Prerequesits",id:"prerequesits",level:3},{value:"Playwright Testing",id:"playwright-testing",level:3},{value:"Ruby Unit Tests",id:"ruby-unit-tests",level:2},{value:"Python Unit Tests",id:"python-unit-tests",level:2}];function d(e){let n={code:"code",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"playwright",children:"Playwright"}),"\n",(0,o.jsx)(n.h3,{id:"prerequesits",children:"Prerequesits"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Install Yarn"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npm install --global yarn\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Clone the COSMOS Playwright repo"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"git clone https://github.com/OpenC3/cosmos-playwright\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Install Playwright and dependencies"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn install\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"playwright-testing",children:"Playwright Testing"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Start COSMOS"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos % openc3.sh start\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:'Open COSMOS in your browser. At the login screen, set the password to "password".'}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Run tests (Note the --headed option visually displays tests, leave it off to run in the background)"}),"\n",(0,o.jsx)(n.p,{children:"Tests are split into a group that runs in parallel and a group that runs serially. This is done to improve overall execution time."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn test:parallel --headed\ncosmos-playwright % yarn test:serial --headed\n"})}),"\n",(0,o.jsx)(n.p,{children:"You can run both groups together, but the --headed option will not apply to both groups:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn test\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.em,{children:"[Optional]"})," Fix istanbul/nyc coverage source lookups (use ",(0,o.jsx)(n.code,{children:"fixwindows"})," if not on Linux)."]}),"\n",(0,o.jsx)(n.p,{children:"Tests will run successfully without this step and you will get coverage statistics, but line-by-line coverage won't work."}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn fixlinux\n"})}),"\n"]}),"\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsx)(n.p,{children:"Generate code coverage"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos-playwright % yarn coverage\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Code coverage reports can be viewed at ",(0,o.jsx)(n.code,{children:"openc3-playwright/coverage/index.html"})]}),"\n",(0,o.jsx)(n.h2,{id:"ruby-unit-tests",children:"Ruby Unit Tests"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Navigate to ",(0,o.jsx)(n.strong,{children:"cosmos/openc3"})," folder. Run the command:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos/openc3 % rake build\ncosmos/openc3 % bundle exec rspec\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Code coverage reports can be found at ",(0,o.jsx)(n.code,{children:"cosmos/openc3/coverage/index.html"})]}),"\n",(0,o.jsx)(n.h2,{id:"python-unit-tests",children:"Python Unit Tests"}),"\n",(0,o.jsxs)(n.ol,{children:["\n",(0,o.jsxs)(n.li,{children:["\n",(0,o.jsxs)(n.p,{children:["Navigate to ",(0,o.jsx)(n.strong,{children:"cosmos/openc3/python"})," folder. Run the command:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"cosmos/openc3/python % python -m pip install poetry\ncosmos/openc3/python % poetry install\ncosmos/openc3/python % poetry run coverage run -m pytest\ncosmos/openc3/python % poetry run coverage html\n"})}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Code coverage reports can be found at ",(0,o.jsx)(n.code,{children:"cosmos/openc3/python/coverage/index.html"})]})]})}function h(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},2840:function(e,n,s){s.d(n,{Z:function(){return l},a:function(){return r}});var t=s(2784);let o={},i=t.createContext(o);function r(e){let n=t.useContext(i);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),t.createElement(i.Provider,{value:n},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1615"],{3027:function(e,t,i){i.r(t),i.d(t,{default:()=>u,frontMatter:()=>l,metadata:()=>s,assets:()=>d,toc:()=>r,contentTitle:()=>c});var s=JSON.parse('{"id":"guides/custom-widgets","title":"Custom Widgets","description":"How to build custom widgets for use in Telemetry Viewer","source":"@site/docs/guides/custom-widgets.md","sourceDirName":"guides","slug":"/guides/custom-widgets","permalink":"/tools/staticdocs/docs/guides/custom-widgets","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/custom-widgets.md","tags":[],"version":"current","frontMatter":{"title":"Custom Widgets","description":"How to build custom widgets for use in Telemetry Viewer","sidebar_custom_props":{"myEmoji":"\uD83D\uDD28"}},"sidebar":"defaultSidebar","previous":{"title":"COSMOS and NASA cFS","permalink":"/tools/staticdocs/docs/guides/cfs"},"next":{"title":"Dynamic Packets","permalink":"/tools/staticdocs/docs/guides/dynamic-packets"}}'),o=i("2322"),n=i("2840");let l={title:"Custom Widgets",description:"How to build custom widgets for use in Telemetry Viewer",sidebar_custom_props:{myEmoji:"\uD83D\uDD28"}},c=void 0,d={},r=[{value:"Custom Widgets",id:"custom-widgets",level:2},{value:"Helloworld Widget",id:"helloworld-widget",level:3}];function a(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",...(0,n.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(t.p,{children:["COSMOS allows you to build custom widgets which can be deployed with your ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/plugins",children:"plugin"})," and used in ",(0,o.jsx)(t.a,{href:"/tools/staticdocs/docs/tools/tlm-viewer",children:"Telemetry Viewer"}),". Building custom widgets can utilize any javascript frameworks but since COSMOS is written with Vue.js, we will use that framework in this tutorial. Please see the ",(0,o.jsx)(t.a,{href:"../getting-started/generators#widget-generator",children:"Widget Generator"})," guide for information about generating the scaffolding for a custom widget."]}),"\n",(0,o.jsx)(t.h2,{id:"custom-widgets",children:"Custom Widgets"}),"\n",(0,o.jsxs)(t.p,{children:["We're basically going to follow the COSMOS ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo",children:"Demo"})," and explain how that custom widget was created."]}),"\n",(0,o.jsxs)(t.p,{children:["If you look at the bottom of the Demo's ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/plugin.txt",children:"plugin.txt"})," file you'll see we declare the widgets:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ruby",children:"WIDGET BIG\nWIDGET HELLOWORLD\n"})}),"\n",(0,o.jsxs)(t.p,{children:["When the plugin is deployed this causes COSMOS to look for the as-built widgets. For the BIG widget it will look for the widget at ",(0,o.jsx)(t.code,{children:"tools/widgets/BigWidget/BigWidget.umd.min.js"}),". Similarly it looks for HELLOWORLD at ",(0,o.jsx)(t.code,{children:"tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js"}),". These directories and file names may seem mysterious but it's all about how the widgets get built."]}),"\n",(0,o.jsx)(t.h3,{id:"helloworld-widget",children:"Helloworld Widget"}),"\n",(0,o.jsxs)(t.p,{children:["The Helloworld Widget source code is found in the plugin's src directory and is called ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/src/HelloworldWidget.vue",children:"HelloworldWidget.vue"}),". The basic structure is as follows:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-vue",children:'<template>\n \x3c!-- Implement widget here --\x3e\n</template>\n\n<script>\nimport { Widget } from "@openc3/vue-common/widgets";\nexport default {\n mixins: [Widget],\n data() {\n return {\n // Reactive data items\n };\n },\n};\n<\/script>\n<style scoped>\n/* widget specific style */\n</style>\n'})}),"\n",(0,o.jsx)(t.admonition,{title:"Vue & Vuetify",type:"info",children:(0,o.jsxs)(t.p,{children:["For more information about how the COSMOS frontend is built (including all the Widgets) please check out ",(0,o.jsx)(t.a,{href:"https://vuejs.org",children:"Vue.js"})," and ",(0,o.jsx)(t.a,{href:"https://vuetifyjs.com",children:"Vuetify"}),"."]})}),"\n",(0,o.jsxs)(t.p,{children:["To build this custom widget we changed the Demo ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/Rakefile",children:"Rakefile"})," to call ",(0,o.jsx)(t.code,{children:"yarn run build"})," when the plugin is built. ",(0,o.jsx)(t.code,{children:"yarn run XXX"})," looks for 'scripts' to run in the ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/package.json",children:"package.json"})," file. If we open package.json we find the following:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-json",children:' "scripts": {\n "build": "vue-cli-service build --target lib --dest tools/widgets/HelloworldWidget --formats umd-min src/HelloworldWidget.vue --name HelloworldWidget && vue-cli-service build --target lib --dest tools/widgets/BigWidget --formats umd-min src/BigWidget.vue --name BigWidget"\n },\n'})}),"\n",(0,o.jsxs)(t.p,{children:["This uses the ",(0,o.jsx)(t.code,{children:"vue-cli-service"})," to build the code found at ",(0,o.jsx)(t.code,{children:"src/HelloworldWidget.vue"})," and formats as ",(0,o.jsx)(t.code,{children:"umd-min"})," and puts it in the ",(0,o.jsx)(t.code,{children:"tools/widgets/HelloworldWidget"})," directory. So this is why the plugin looks for the plugin at ",(0,o.jsx)(t.code,{children:"tools/widgets/HelloworldWidget/HelloworldWidget.umd.min.js"}),". Click ",(0,o.jsx)(t.a,{href:"https://cli.vuejs.org/guide/cli-service.html#vue-cli-service-build",children:"here"})," for the ",(0,o.jsx)(t.code,{children:"vue-cli-service build"})," documentation."]}),"\n",(0,o.jsxs)(t.p,{children:["If you look at the Demo plugin's ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/screens/simple.txt",children:"simple.txt"})," screen you'll see we're using the widgets:"]}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-ruby",children:"SCREEN AUTO AUTO 0.5\nLABELVALUE <%= target_name %> HEALTH_STATUS CCSDSSEQCNT\nHELLOWORLD\nBIG <%= target_name %> HEALTH_STATUS TEMP1\n"})}),"\n",(0,o.jsx)(t.p,{children:"Opening this screen in Telemetry Viewer results in the following:"}),"\n",(0,o.jsx)(t.p,{children:(0,o.jsx)(t.img,{alt:"Simple Screen",src:i(6584).Z+"",width:"681",height:"210"})}),"\n",(0,o.jsx)(t.p,{children:"While this is a simple example the possibilities with custom widgets are limitless!"})]})}function u(e={}){let{wrapper:t}={...(0,n.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(a,{...e})}):a(e)}},6584:function(e,t,i){i.d(t,{Z:function(){return s}});let s=i.p+"assets/images/simple_screen-e3de1ad836c0661d73a0ba970f991c64df8ecc7e23f9e944b6508a9a43fbc33c.png"},2840:function(e,t,i){i.d(t,{Z:function(){return c},a:function(){return l}});var s=i(2784);let o={},n=s.createContext(o);function l(e){let t=s.useContext(n);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:l(e.components),s.createElement(n.Provider,{value:t},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1364"],{269:function(e,t,n){n.r(t),n.d(t,{default:()=>h,frontMatter:()=>s,metadata:()=>i,assets:()=>l,toc:()=>c,contentTitle:()=>r});var i=JSON.parse('{"id":"getting-started/gettingstarted","title":"Getting Started","description":"Getting starting with COSMOS","source":"@site/docs/getting-started/gettingstarted.md","sourceDirName":"getting-started","slug":"/getting-started/gettingstarted","permalink":"/tools/staticdocs/docs/getting-started/gettingstarted","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/getting-started/gettingstarted.md","tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_position":3,"title":"Getting Started","description":"Getting starting with COSMOS","sidebar_custom_props":{"myEmoji":"\uD83E\uDDD1\u200D\uD83D\uDCBB"}},"sidebar":"defaultSidebar","previous":{"title":"Installation","permalink":"/tools/staticdocs/docs/getting-started/installation"},"next":{"title":"Upgrading","permalink":"/tools/staticdocs/docs/getting-started/upgrading"}}'),a=n("2322"),o=n("2840");let s={sidebar_position:3,title:"Getting Started",description:"Getting starting with COSMOS",sidebar_custom_props:{myEmoji:"\uD83E\uDDD1\u200D\uD83D\uDCBB"}},r=void 0,l={},c=[{value:"Interfacing with Your Hardware",id:"interfacing-with-your-hardware",level:2},{value:"Building Your Plugin",id:"building-your-plugin",level:2}];function d(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,o.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.p,{children:"Welcome to the OpenC3 COSMOS system... Let's get started! This guide is a high level overview that will help with setting up your first COSMOS project."}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["Get COSMOS Installed onto your computer by following the ",(0,a.jsx)(t.a,{href:"installation",children:"Installation Guide"}),".","\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"You should now have COSMOS installed and a Demo project available that we can make changes to."}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["Browse to ",(0,a.jsx)(t.a,{href:"http://localhost:2900",children:"http://localhost:2900"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:'The COSMOS Command and Telemetry Server will appear. This tool provides real-time information about each "target" in the system. Targets are external systems that receive commands and generate telemetry, often over ethernet or serial connections.'}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["Experiment with other COSMOS tools. This is a DEMO environment so you can't break anything. Some things to try:","\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Use Command Sender to send individual commands."}),"\n",(0,a.jsx)(t.li,{children:"Use Limits Monitor to watch for telemetry limits violations"}),"\n",(0,a.jsx)(t.li,{children:"Run some of the example scripts in Script Runner and Test Runner"}),"\n",(0,a.jsx)(t.li,{children:"View individual Telemetry packets in Packet Viewer"}),"\n",(0,a.jsx)(t.li,{children:"View detailed telemetry displays in Telemetry Viewer"}),"\n",(0,a.jsx)(t.li,{children:"Graph some data in Telemetry Grapher"}),"\n",(0,a.jsx)(t.li,{children:"View log type data in Data Viewer"}),"\n",(0,a.jsx)(t.li,{children:"Process log data with Data Extractor"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.admonition,{title:"Browser Version Issue",type:"info",children:[(0,a.jsxs)(t.p,{children:["When you try to load the page and it fails to load, check with the built-in web development tools / DevTools. We have seen some strange things with version of browsers. You can build to a version of browser if you need to by reading about the ",(0,a.jsx)(t.a,{href:"https://github.com/browserslist/browserslist",children:"browserslist"}),". A typical failure results in:"]}),(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{children:"unexpected token ||=\n"})}),(0,a.jsxs)(t.p,{children:["To fix this make sure your browsers is compliant with the current settings in the ",(0,a.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3-cosmos-init/plugins/openc3-tool-base/.browserslistrc",children:".browserlistrc"})," file. You can change this and rebuild the image. Note: This can cause build speeds to increase or decrease."]})]}),"\n",(0,a.jsx)(t.h2,{id:"interfacing-with-your-hardware",children:"Interfacing with Your Hardware"}),"\n",(0,a.jsx)(t.p,{children:"Playing with the COSMOS Demo is fun and all, but now you want to talk to your own real hardware? Let's do it!"}),"\n",(0,a.jsx)(t.admonition,{title:"Install and Platform",type:"info",children:(0,a.jsx)(t.p,{children:"This guide assumes we're on Windows and COSMOS is installed in C:\\COSMOS. On Mac or Linux, change openc3.bat to openc3.sh and adjust paths as necessary to match your installation directory."})}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Before creating your own configuration you should uninstall the COSMOS Demo so you're working with a clean COSMOS system. Click the Admin button and the PLUGINS tab. Then click the Trash can icon next to openc3-cosmos-demo to delete it. When you go back to the Command and Telemetry Server you should have a blank table with no interfaces."}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["If you followed the ",(0,a.jsx)(t.a,{href:"installation",children:"Installation Guide"})," you should already be inside a cloned ",(0,a.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project",children:"openc3-project"})," which is in your PATH (necessary for openc3.bat / openc3.sh to be resolved). Inside this project it's recommended to edit the README.md (",(0,a.jsx)(t.a,{href:"https://www.markdownguide.org/",children:"Markdown"}),") to describe your program / project."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now we need to create a plugin. Plugins are how we add targets and microservices to COSMOS. Our plugin will contain a single target which contains all the information defining the packets (command and telemetry) that are needed to communicate with the target. Use the COSMOS plugin generator to create the correct structure."}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.admonition,{title:"Python vs Ruby",type:"info",children:(0,a.jsxs)(t.p,{children:["Each CLI command requires the use of ",(0,a.jsx)(t.code,{children:"--python"})," or ",(0,a.jsx)(t.code,{children:"--ruby"})," unless you se the OPENC3_LANGUAGE environment variable to 'python' or 'ruby'."]})}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"C:\\openc3-project> openc3.bat cli generate plugin BOB --python\nPlugin openc3-cosmos-bob successfully generated!\n"})}),"\n",(0,a.jsxs)(t.p,{children:['This should create a new directory called "openc3-cosmos-bob" with a bunch of files in it. The full description of all the files is explained by the ',(0,a.jsx)(t.a,{href:"generators#plugin-generator",children:"Plugin Generator"})," page."]}),"\n",(0,a.jsx)(t.admonition,{title:"Run as the Root user",type:"info",children:(0,a.jsxs)(t.p,{children:["The cli runs as the default COSMOS container user which is the recommended practice. If you're having issues running as that user you can run as the root user (effectively ",(0,a.jsx)(t.code,{children:"docker run --user=root"})," ) by running ",(0,a.jsx)(t.code,{children:"cliroot"})," instead of ",(0,a.jsx)(t.code,{children:"cli"})," in any of the examples."]})}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["Starting with ",(0,a.jsx)(t.a,{href:"https://openc3.com/news/2023/02/23/openc3-cosmos-5-5-0-released/",children:"COSMOS v5.5.0"}),", the plugin generator creates just the plugin framework (previously it would also create a target). From within the newly created plugin directory, we generate a target."]}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"C:\\openc3-project> cd openc3-cosmos-bob\nopenc3-cosmos-bob> openc3.bat cli generate target BOB --python\nTarget BOB successfully generated!\n"})}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.admonition,{title:"Generators",type:"info",children:(0,a.jsxs)(t.p,{children:["There are a number of generators available. Run ",(0,a.jsx)(t.code,{children:"openc3.bat cli generate"})," to see all the available options."]})}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"The target generator creates a single target named BOB. Best practice is to create a single target per plugin to make it easier to share targets and upgrade them individually. Lets see what the target generator created for us. Open the openc3-cosmos-bob/targets/BOB/cmd_tlm/cmd.txt:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:'COMMAND BOB EXAMPLE BIG_ENDIAN "Packet description"\n # Keyword Name BitSize Type Min Max Default Description\n APPEND_ID_PARAMETER ID 16 INT 1 1 1 "Identifier"\n APPEND_PARAMETER VALUE 32 FLOAT 0 10.5 2.5 "Value"\n APPEND_PARAMETER BOOL 8 UINT MIN MAX 0 "Boolean"\n STATE FALSE 0\n STATE TRUE 1\n APPEND_PARAMETER LABEL 0 STRING "OpenC3" "The label to apply"\n'})}),"\n",(0,a.jsx)(t.p,{children:"What does this all mean?"}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"We created a COMMAND for target BOB named EXAMPLE."}),"\n",(0,a.jsx)(t.li,{children:'The command is made up of BIG_ENDIAN parameters and is described by "Packet description". Here we are using the append flavor of defining parameters which stacks them back to back as it builds up the packet and you don\'t have to worry about defining the bit offset into the packet.'}),"\n",(0,a.jsx)(t.li,{children:'First we APPEND_ID_PARAMETER a parameter that is used to identify the packet called ID that is an 16-bit signed integer (INT) with a minimum value of 1, a maximum value of 1, and a default value of 1, that is described as the "Identifier".'}),"\n",(0,a.jsx)(t.li,{children:"Next we APPEND_PARAMETER a parameter called VALUE that is a 32-bit float (FLOAT) that has a minimum value of 0, a maximum value of 10.5, and a default value of 2.5."}),"\n",(0,a.jsx)(t.li,{children:"Then we APPEND_PARAMETER a third parameter called BOOL which is a 8-bit unsigned integer (UINT) with a minimum value of MIN (meaning the smallest value a UINT supports, e.g 0), a maximum value of MAX (largest value a UINT supports, e.g. 255), and a default value of 0. BOOL has two states which are just a fancy way of giving meaning to the integer values 0 and 1. The STATE FALSE has a value of 0 and the STATE TRUE has a value of 1."}),"\n",(0,a.jsx)(t.li,{children:"Finally we APPEND_PARAMETER called LABEL which is a 0-bit (meaning it takes up all the remaining space in the packet) string (STRING) with a default value of \"OpenC3\". Strings don't have minimum or maximum values as that doesn't make sense for STRING types."}),"\n"]}),"\n",(0,a.jsxs)(t.p,{children:["Check out the full ",(0,a.jsx)(t.a,{href:"../configuration/command",children:"Command"})," documentation for more."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now open the openc3-cosmos-bob/targets/BOB/cmd_tlm/tlm.txt:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:'TELEMETRY BOB STATUS BIG_ENDIAN "Telemetry description"\n # Keyword Name BitSize Type ID Description\n APPEND_ID_ITEM ID 16 INT 1 "Identifier"\n APPEND_ITEM VALUE 32 FLOAT "Value"\n APPEND_ITEM BOOL 8 UINT "Boolean"\n STATE FALSE 0\n STATE TRUE 1\n APPEND_ITEM LABEL 0 STRING "The label to apply"\n'})}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:'This time we created a TELEMETRY packet for target BOB called STATUS that contains BIG_ENDIAN items and is described as "Telemetry description".'}),"\n",(0,a.jsx)(t.li,{children:'We start by defininig an ID_ITEM called ID that is a 16-bit signed integer (INT) with an id value of 1 and described as "Identifier". Id items are used to take unidentified blobs of bytes and determine which packet they are. In this case if a blob comes in with a value of 1, at bit offset 0 (since we APPEND this item first), interpreted as a 16-bit integer, then this packet will be "identified" as STATUS. Note the first packet defined without any ID_ITEMS is a "catch-all" packet that matches all incoming data (even if the data lengths don\'t match).'}),"\n",(0,a.jsx)(t.li,{children:"Next we define three items similar to the command definition above."}),"\n"]}),"\n",(0,a.jsxs)(t.p,{children:["Check out the full ",(0,a.jsx)(t.a,{href:"../configuration/telemetry",children:"Telemetry"})," documentation for more."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["COSMOS has defined an example command and telemetry packet for our target. Most targets will obviously have more than one command and telemetry packet. To add more simply create additional COMMAND and TELEMETRY lines in your text files. Actual packets should match the structure of your command and telemetry. Be sure to add at least one unique ",(0,a.jsx)(t.a,{href:"../configuration/command#id_parameter",children:"ID_PARAMETER"})," and ",(0,a.jsx)(t.a,{href:"../configuration/telemetry#id_item",children:"ID_ITEM"})," so your packets can be distinguished from each other."]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now we need to tell COSMOS how to connect to our BOB target. Open the openc3-cosmos-bob/plugin.txt file:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:"# Set VARIABLEs here to allow variation in your plugin\n# See [Plugins](../configuration/plugins) for more information\nVARIABLE bob_target_name BOB\n\n# Modify this according to your actual target connection\n# See [Interfaces](../configuration/interfaces) for more information\nTARGET BOB <%= bob_target_name %>\nINTERFACE <%= bob_target_name %>_INT openc3/interfaces/tcpip_client_interface.py host.docker.internal 8080 8081 10.0 None BURST\n MAP_TARGET <%= bob_target_name %>\n"})}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:'This configures the plugin with a VARIABLE called bob_target_name with a default of "BOB". When you install this plugin you will have the option to change the name of this target to something other than "BOB". This is useful to avoid name conflicts and allows you to have multiple copies of the BOB target in your COSMOS system.'}),"\n",(0,a.jsx)(t.li,{children:"The TARGET line declares the new BOB target using the name from the variable. The <%= %> syntax is called ERB (embedded Ruby) and allows us to put variables into our text files, in this case referencing our bob_target_name."}),"\n",(0,a.jsxs)(t.li,{children:["The last line declares a new INTERFACE called (by default) BOB_INT that will connect as a TCP/IP client using the code in tcpip_client_interface.py to address host.docker.internal (This adds an /etc/hosts entry to the correct IP address for the host's gateway) using port 8080 for writing and 8081 for reading. It also has a write timeout of 10 seconds and reads will never timeout (nil). The TCP/IP stream will be interpreted using the COSMOS ",(0,a.jsx)(t.a,{href:"../configuration/protocols#burst-protocol",children:"BURST"})," protocol which means it will read as much data as it can from the interface. For all the details on how to configure COSMOS interfaces please see the ",(0,a.jsx)(t.a,{href:"../configuration/interfaces",children:"Interface Guide"}),". The MAP_TARGET line tells COSMOS that it will receive telemetry from and send commands to the BOB target using the BOB_INT interface."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(t.admonition,{title:"Variables Support Reusability",type:"note",children:(0,a.jsx)(t.p,{children:"In a plugin that you plan to reuse you should make things like hostnames and ports variables"})}),"\n",(0,a.jsx)(t.h2,{id:"building-your-plugin",children:"Building Your Plugin"}),"\n",(0,a.jsxs)(t.ol,{children:["\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Now we need to build our plugin and upload it to COSMOS."}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"openc3-cosmos-bob> openc3.bat cli rake build VERSION=1.0.0\n Successfully built RubyGem\n Name: openc3-cosmos-bob\n Version: 1.0.0\n File: openc3-cosmos-bob-1.0.0.gem\n"})}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsxs)(t.li,{children:["Note that the VERSION is required to specify the version to build. We recommend ",(0,a.jsx)(t.a,{href:"https://semver.org/",children:"semantic versioning"})," when building your plugin so people using your plugin (including you) know when there are breaking changes."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Once our plugin is built we need to upload it to COSMOS. Go back to the Admin page and click the Plugins Tab. Click on \"Click to install plugin\" and select the openc3-cosmos-bob-1.0.0.gem file. Then click Upload. Go back to the CmdTlmServer and you should see the plugin being deployed at which point the BOB_INT interface should appear and try to connect. Go ahead and click 'Cancel' because unless you really have something listening on port 8080 this will never connect. At this point you can explore the other CmdTlmServer tabs and other tools to see your newly defined BOB target."}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:'Let\'s modify our BOB target and then update the copy in COSMOS. If you open Command Sender in COSMOS to BOB EXAMPLE you should see the VALUE parameter has value 2.5. Open the openc3-cosmos-bob/targets/BOB/cmd_tlm/cmd.txt and change the Default value for VALUE to 5 and the description to "New Value".'}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-ruby",children:'COMMAND BOB EXAMPLE BIG_ENDIAN "Packet description"\n # Keyword Name BitSize Type Min Max Default Description\n APPEND_ID_PARAMETER ID 16 INT 1 1 1 "Identifier"\n APPEND_PARAMETER VALUE 32 FLOAT 0 10.5 5 "New Value"\n APPEND_PARAMETER BOOL 8 UINT MIN MAX 0 "Boolean"\n STATE FALSE 0\n STATE TRUE 1\n APPEND_PARAMETER LABEL 0 STRING "OpenC3" "The label to apply"\n'})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:"Rebuild the plugin with a new VERSION number. Since we didn't make any breaking changes we simply bump the patch release number:"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-batch",children:"openc3-cosmos-bob> openc3.bat cli rake build VERSION=1.0.1\n Successfully built RubyGem\n Name: openc3-cosmos-bob\n Version: 1.0.1\n File: openc3-cosmos-bob-1.0.1.gem\n"})}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsx)(t.p,{children:'Go back to the Admin page and click the Plugins Tab. This time click the clock icon next to openc3-cosmos-bob-1.0.0 to Upgrade the plugin. Browse to the newly built plugin gem and select it. This will re-prompt for the plugin variables (bob_target_name) so don\'t change the name and just click OK. You should see a message about the plugin being installed at which point the plugins list will change to openc3-cosmos-bob-1.0.1.gem. Go back to Command Sender and you should see the new Default value for VALUE is 5 and the description is "New Value". We have upgraded our plugin!'}),"\n"]}),"\n",(0,a.jsxs)(t.li,{children:["\n",(0,a.jsxs)(t.p,{children:["At this point you can create a new plugin named after your real target and start modifying the interface and command and telemetry definitions to enable COSMOS to connect to and drive your target. If you run into trouble look for solutions on our ",(0,a.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/issues",children:"Github Issues"})," page. If you would like to enquire about support contracts or professional COSMOS development please contact us at ",(0,a.jsx)(t.a,{href:"mailto:support@openc3.com",children:"support@openc3.com"}),"."]}),"\n"]}),"\n"]})]})}function h(e={}){let{wrapper:t}={...(0,o.a)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},2840:function(e,t,n){n.d(t,{Z:function(){return r},a:function(){return s}});var i=n(2784);let a={},o=i.createContext(a);function s(e){let t=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["334"],{6887:function(e,t,s){s.r(t),s.d(t,{default:()=>h,frontMatter:()=>i,metadata:()=>n,assets:()=>c,toc:()=>d,contentTitle:()=>a});var n=JSON.parse('{"id":"getting-started/key-concepts","title":"Key Concepts","description":"Projects, Containerization, Frontend, Backend","source":"@site/docs/getting-started/key-concepts.md","sourceDirName":"getting-started","slug":"/getting-started/key-concepts","permalink":"/tools/staticdocs/docs/getting-started/key-concepts","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/getting-started/key-concepts.md","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"title":"Key Concepts","description":"Projects, Containerization, Frontend, Backend","sidebar_custom_props":{"myEmoji":"\uD83D\uDCA1"}},"sidebar":"defaultSidebar","previous":{"title":"Getting Started","permalink":"/tools/staticdocs/docs/getting-started"},"next":{"title":"Installation","permalink":"/tools/staticdocs/docs/getting-started/installation"}}'),o=s("2322"),r=s("2840");let i={sidebar_position:1,title:"Key Concepts",description:"Projects, Containerization, Frontend, Backend",sidebar_custom_props:{myEmoji:"\uD83D\uDCA1"}},a="OpenC3 COSMOS Key Concepts",c={},d=[{value:"Projects",id:"projects",level:2},{value:"Containerization",id:"containerization",level:2},{value:"Images",id:"images",level:3},{value:"Containers",id:"containers",level:3},{value:"Docker Compose",id:"docker-compose",level:3},{value:"Environment File",id:"environment-file",level:3},{value:"Kubernetes",id:"kubernetes",level:3},{value:"Frontend",id:"frontend",level:2},{value:"Vue.js",id:"vuejs",level:3},{value:"Single-Spa",id:"single-spa",level:3},{value:"Astro UX",id:"astro-ux",level:3},{value:"Backend",id:"backend",level:2},{value:"Redis",id:"redis",level:3},{value:"MinIO",id:"minio",level:3},{value:"Ruby on Rails",id:"ruby-on-rails",level:3}];function l(e){let t={a:"a",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"openc3-cosmos-key-concepts",children:"OpenC3 COSMOS Key Concepts"})}),"\n",(0,o.jsx)(t.h2,{id:"projects",children:"Projects"}),"\n",(0,o.jsxs)(t.p,{children:["The main COSMOS ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos",children:"repo"})," contains all the source code used to build and run COSMOS. However, users (not developers) of COSMOS should use the COSMOS ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project",children:"project"})," to launch COSMOS. The project consists of the ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project/blob/main/openc3.sh",children:"openc3.sh"})," and ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project/blob/main/openc3.bat",children:"openc3.bat"})," files for starting and stopping COSMOS, the ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project/blob/main/compose.yaml",children:"compose.yaml"})," for configuring the COSMOS containers, and the ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project/blob/main/.env",children:".env"})," file for setting runtime variables. Additionally, the COSMOS project contains user modifiable config files for both Redis and Traefik."]}),"\n",(0,o.jsx)(t.h2,{id:"containerization",children:"Containerization"}),"\n",(0,o.jsx)(t.h3,{id:"images",children:"Images"}),"\n",(0,o.jsxs)(t.p,{children:["Per ",(0,o.jsx)(t.a,{href:"https://docs.docker.com/get-started/overview/#images",children:"Docker"}),', "An image is a read-only template with instructions for creating a Docker container." The base operating system COSMOS uses is called ',(0,o.jsx)(t.a,{href:"https://www.alpinelinux.org/",children:"Alpine Linux"}),". It is a simple and compact image with a full package system that allows us to install our dependencies. Starting with Alpine, we create a ",(0,o.jsx)(t.a,{href:"https://docs.docker.com/engine/reference/builder/",children:"Dockerfile"})," to add Ruby and Python and a few other packages to create our own docker image. We further build upon that image to create a NodeJS image to support our frontend and additional images to support our backend."]}),"\n",(0,o.jsx)(t.h3,{id:"containers",children:"Containers"}),"\n",(0,o.jsxs)(t.p,{children:["Per ",(0,o.jsx)(t.a,{href:"https://www.docker.com/resources/what-container/",children:"Docker"}),', "a container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another." Also per ',(0,o.jsx)(t.a,{href:"https://docs.docker.com/guides/walkthroughs/what-is-a-container/",children:"Docker"}),', "A container is an isolated environment for your code. This means that a container has no knowledge of your operating system, or your files. It runs on the environment provided to you by Docker Desktop. Containers have everything that your code needs in order to run, down to a base operating system." COSMOS utilizes containers to provide a consistent runtime environment. Containers make it easy to deploy to local on-prem servers, cloud environments, or air-gapped networks.']}),"\n",(0,o.jsx)(t.p,{children:"The COSMOS Open Source containers consist of the following:"}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Description"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-cosmos-init-1"}),(0,o.jsx)(t.td,{children:"Copies files to Minio and configures COSMOS then exits"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-operator-1"}),(0,o.jsx)(t.td,{children:"Main COSMOS container that runs the interfaces and target microservices"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-cosmos-cmd-tlm-api-1"}),(0,o.jsx)(t.td,{children:"Rails server that provides all the COSMOS API endpoints"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-cosmos-script-runner-api-1"}),(0,o.jsx)(t.td,{children:"Rails server that provides the Script API endpoints"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-redis-1"}),(0,o.jsx)(t.td,{children:"Serves the static target configuration"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-redis-ephemeral-1"}),(0,o.jsxs)(t.td,{children:["Serves the ",(0,o.jsx)(t.a,{href:"https://redis.io/docs/data-types/streams",children:"streams"})," containing the raw and decomutated data"]})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-minio-1"}),(0,o.jsx)(t.td,{children:"Provides a S3 like bucket storage interface and also serves as a static webserver for the tool files"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-openc3-traefik-1"}),(0,o.jsx)(t.td,{children:"Provides a reverse proxy and load balancer with routes to the COSMOS endpoints"})]})]})]}),"\n",(0,o.jsxs)(t.p,{children:["The container list for ",(0,o.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"Enterprise COSMOS"})," consists of the following:"]}),"\n",(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Description"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-enterprise-openc3-metrics-1"}),(0,o.jsx)(t.td,{children:"Rails server that provides metrics on COSMOS performance"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-enterprise-openc3-keycloak-1"}),(0,o.jsx)(t.td,{children:"Single-Sign On service for authentication"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"cosmos-enterprise-openc3-postgresql-1"}),(0,o.jsx)(t.td,{children:"SQL Database for use by Keycloak"})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:"openc3-nfs *"}),(0,o.jsx)(t.td,{children:"Network File System pod only for use in Kubernetes to share code libraries between containers"})]})]})]}),"\n",(0,o.jsx)(t.h3,{id:"docker-compose",children:"Docker Compose"}),"\n",(0,o.jsxs)(t.p,{children:["Per ",(0,o.jsx)(t.a,{href:"https://docs.docker.com/compose/",children:"Docker"}),', "Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application\'s services. Then, with a single command, you create and start all the services from your configuration." OpenC3 uses compose files to both build and run COSMOS. The ',(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project/blob/main/compose.yaml",children:"compose.yaml"})," is where ports are exposed and environment variables are used."]}),"\n",(0,o.jsx)(t.h3,{id:"environment-file",children:"Environment File"}),"\n",(0,o.jsxs)(t.p,{children:["COSMOS uses an ",(0,o.jsx)(t.a,{href:"https://docs.docker.com/compose/environment-variables/env-file/",children:"environment file"})," along with Docker Compose to pass environment variables into the COSMOS runtime. This ",(0,o.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-project/blob/main/.env",children:".env"})," file consists of simple key value pairs that contain the version of COSMOS deployed, usernames and passwords, and much more."]}),"\n",(0,o.jsx)(t.h3,{id:"kubernetes",children:"Kubernetes"}),"\n",(0,o.jsxs)(t.p,{children:["Per ",(0,o.jsx)(t.a,{href:"https://kubernetes.io/",children:"Kubernetes.io"}),', "Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery." ',(0,o.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," provides ",(0,o.jsx)(t.a,{href:"https://helm.sh/docs/topics/charts/",children:"Helm charts"})," for easy deployment to Kubernetes in various cloud environments."]}),"\n",(0,o.jsx)(t.p,{children:"COSMOS Enterprise also provides configuration to deploy COSMOS infrastructure on various cloud environments (e.g. CloudFormation template on AWS)."}),"\n",(0,o.jsx)(t.h2,{id:"frontend",children:"Frontend"}),"\n",(0,o.jsx)(t.h3,{id:"vuejs",children:"Vue.js"}),"\n",(0,o.jsxs)(t.p,{children:["The COSMOS frontend is fully browser native and is implemented in the Vue.js framework. Per ",(0,o.jsx)(t.a,{href:"https://vuejs.org/guide/introduction.html",children:"Vue.js"}),', "Vue is a JavaScript framework for building user interfaces. It builds on top of standard HTML, CSS, and JavaScript and provides a declarative and component-based programming model that helps you efficiently develop user interfaces, be they simple or complex." COSMOS utilizes Vue.js and the ',(0,o.jsx)(t.a,{href:"https://vuetifyjs.com/en/",children:"Vuetify"})," Component Framework UI library to build all the COSMOS tools which run in the browser of your choice. COSMOS 5 utilized Vue.js 2.x and Vuetify 2.x while COSMOS 6 utilizes Vue.js 3.x and Vuetify 3.x."]}),"\n",(0,o.jsx)(t.h3,{id:"single-spa",children:"Single-Spa"}),"\n",(0,o.jsxs)(t.p,{children:["While COSMOS itself is written in Vue.js, we utilize a technology called ",(0,o.jsx)(t.a,{href:"https://single-spa.js.org/",children:"single-spa"})," to allow COSMOS developers to create applications in any javascript framework they choose. Single-spa is a micro frontend framework and acts as a top level router to render the application being requested. COSMOS provides sample applications ready to plug into single-spa in Angular, React, Svelte, and Vue."]}),"\n",(0,o.jsx)(t.h3,{id:"astro-ux",children:"Astro UX"}),"\n",(0,o.jsxs)(t.p,{children:["Per ",(0,o.jsx)(t.a,{href:"https://www.astrouxds.com/",children:"AstroUXDS"}),', "The Astro Space UX Design System enables developers and designers to build rich space app experiences with established interaction patterns and best practices." COSMOS utilizes the Astro design guidelines for color, typograpy, and iconograpy. In some cases, e.g. ',(0,o.jsx)(t.a,{href:"https://www.astrouxds.com/components/clock/",children:"Astro Clock"}),", COSMOS directly incorporates Astro components."]}),"\n",(0,o.jsx)(t.h2,{id:"backend",children:"Backend"}),"\n",(0,o.jsx)(t.h3,{id:"redis",children:"Redis"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.a,{href:"https://redis.io/",children:"Redis"})," is an in-memory data store with support for strings, hashes, lists, sets, sorted sets, streams, and more. COSMOS uses Redis to store both our configuration and data. If you look back at our ",(0,o.jsx)(t.a,{href:"/docs/getting-started/key-concepts#containers",children:"container list"})," you'll notice two redis containers: cosmos-openc3-redis-1 and cosmos-openc3-redis-ephemeral-1. The ephemeral container contains all the real-time data pushed into ",(0,o.jsx)(t.a,{href:"https://redis.io/docs/data-types/streams/",children:"Redis streams"}),". The other redis container contains COSMOS configuration that is meant to persist. ",(0,o.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," provides helm charts that setup ",(0,o.jsx)(t.a,{href:"https://redis.io/docs/management/scaling/",children:"Redis Cluster"})," to perform horizontal scaling where data is shared across multiple Redis nodes."]}),"\n",(0,o.jsx)(t.h3,{id:"minio",children:"MinIO"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.a,{href:"https://min.io/",children:"MinIO"})," is a high-performance, S3 compatible object store. COSMOS uses this storage technology to host both the COSMOS tools themselves and the long term log files. ",(0,o.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," deployed in a cloud environment uses the available cloud native bucket storage technology, e.g. AWS S3, GCP Buckets, and Azure Blob Storage. Using bucket storage allows COSMOS to directly serve the tools as a static website and thus we don't need to deploy Tomcat or Nginx for example."]}),"\n",(0,o.jsx)(t.h3,{id:"ruby-on-rails",children:"Ruby on Rails"}),"\n",(0,o.jsxs)(t.p,{children:["The COSMOS API and Script Runner backends are powered by ",(0,o.jsx)(t.a,{href:"https://rubyonrails.org/",children:"Ruby on Rails"}),". Rails is a web application development framework written in the Ruby programming language. Rails (and our familiarity with Ruby) allows us to write less code while accomplishing more than many other languages and frameworks."]})]})}function h(e={}){let{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},2840:function(e,t,s){s.d(t,{Z:function(){return a},a:function(){return i}});var n=s(2784);let o={},r=n.createContext(o);function i(e){let t=n.useContext(r);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),n.createElement(r.Provider,{value:t},e.children)}}}]);