openc3-cosmos-tool-docs 6.10.1 → 6.10.2
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.
- checksums.yaml +4 -4
- data/tools/staticdocs/404.html +2 -2
- data/tools/staticdocs/assets/css/{styles.9a220ac7.css → styles.6a21a146.css} +1 -1
- data/tools/staticdocs/assets/js/{019369f3.d7bbc5e1.js → 019369f3.622250b4.js} +1 -1
- data/tools/staticdocs/assets/js/{058ffc22.e446ff0d.js → 058ffc22.8edfaac4.js} +1 -1
- data/tools/staticdocs/assets/js/{0686a885.5b4c4b4d.js → 0686a885.9151d3f9.js} +1 -1
- data/tools/staticdocs/assets/js/{078dbab0.656de457.js → 078dbab0.09694602.js} +1 -1
- data/tools/staticdocs/assets/js/{0f5d161c.7e54cdcf.js → 0f5d161c.4c365bfd.js} +1 -1
- data/tools/staticdocs/assets/js/0ff569c9.7a4faa61.js +1 -0
- data/tools/staticdocs/assets/js/{10209fc9.b137dbd6.js → 10209fc9.dc70ea3f.js} +1 -1
- data/tools/staticdocs/assets/js/{103cc3be.ee6acb84.js → 103cc3be.c15dbb1d.js} +1 -1
- data/tools/staticdocs/assets/js/13196248.c70e8c44.js +1 -0
- data/tools/staticdocs/assets/js/{13c1b4e4.4c262e75.js → 13c1b4e4.c29d1c64.js} +1 -1
- data/tools/staticdocs/assets/js/1731.371fb57d.js +1 -0
- data/tools/staticdocs/assets/js/{1c0a0c05.ddb465d3.js → 1c0a0c05.35a848fc.js} +1 -1
- data/tools/staticdocs/assets/js/{2047b354.6cacf929.js → 2047b354.1fd954bf.js} +1 -1
- data/tools/staticdocs/assets/js/{22b3ac48.7b94bcf3.js → 22b3ac48.9afe5dd8.js} +1 -1
- data/tools/staticdocs/assets/js/26b8abb2.980a3452.js +1 -0
- data/tools/staticdocs/assets/js/{2bb7bf90.3bde2607.js → 2bb7bf90.aa9deeb1.js} +1 -1
- data/tools/staticdocs/assets/js/{2c15ad40.4b4b971e.js → 2c15ad40.5b907671.js} +1 -1
- data/tools/staticdocs/assets/js/3064.05d05a26.js +1 -0
- data/tools/staticdocs/assets/js/35398c5c.17c941ac.js +1 -0
- data/tools/staticdocs/assets/js/{3dd7ef3b.0221eef2.js → 3dd7ef3b.60465ff4.js} +1 -1
- data/tools/staticdocs/assets/js/{40365d27.41de4945.js → 40365d27.a658985c.js} +1 -1
- data/tools/staticdocs/assets/js/{411898ad.6f36be2d.js → 411898ad.9843564e.js} +1 -1
- data/tools/staticdocs/assets/js/42170351.0865881a.js +1 -0
- data/tools/staticdocs/assets/js/{43652efd.e2fc7748.js → 43652efd.6c00e2f7.js} +1 -1
- data/tools/staticdocs/assets/js/5191.15b90810.js +1 -0
- data/tools/staticdocs/assets/js/{53ca7c5b.eccd9100.js → 53ca7c5b.576d6c45.js} +1 -1
- data/tools/staticdocs/assets/js/{54d0d530.cec50ece.js → 54d0d530.2278fc39.js} +1 -1
- data/tools/staticdocs/assets/js/{567dad64.50613669.js → 567dad64.89733625.js} +1 -1
- data/tools/staticdocs/assets/js/{5738ba7a.cede7d7a.js → 5738ba7a.c1945cad.js} +1 -1
- data/tools/staticdocs/assets/js/{59ed27a4.1b2efe08.js → 59ed27a4.53f184ee.js} +1 -1
- data/tools/staticdocs/assets/js/{5b233ba7.9faed769.js → 5b233ba7.e3319d37.js} +1 -1
- data/tools/staticdocs/assets/js/{5bc719f6.789ebf64.js → 5bc719f6.2fc3c8f6.js} +1 -1
- data/tools/staticdocs/assets/js/{5c6ce5ec.16226a4e.js → 5c6ce5ec.87929366.js} +1 -1
- data/tools/staticdocs/assets/js/5e3ed378.dcffdeae.js +1 -0
- data/tools/staticdocs/assets/js/{5fe211ef.bfe87c27.js → 5fe211ef.e2df613c.js} +1 -1
- data/tools/staticdocs/assets/js/6317.78aef81b.js +4 -0
- data/tools/staticdocs/assets/js/6321.2b2e50c9.js +101 -0
- data/tools/staticdocs/assets/js/6831b732.5cffcb1b.js +1 -0
- data/tools/staticdocs/assets/js/{696b4199.7520348a.js → 696b4199.e21ac90d.js} +1 -1
- data/tools/staticdocs/assets/js/{6b210247.fc77f080.js → 6b210247.6948ce0a.js} +1 -1
- data/tools/staticdocs/assets/js/{6b65133b.f2b11b07.js → 6b65133b.9a650bf4.js} +1 -1
- data/tools/staticdocs/assets/js/{6f92e431.26f4227b.js → 6f92e431.42d18623.js} +1 -1
- data/tools/staticdocs/assets/js/{72c6d8a8.0b8c5d2f.js → 72c6d8a8.f72ab546.js} +1 -1
- data/tools/staticdocs/assets/js/{75e64983.8112c73c.js → 75e64983.e1b9bc7d.js} +1 -1
- data/tools/staticdocs/assets/js/8330.134a0142.js +1 -0
- data/tools/staticdocs/assets/js/{867640d5.6bc9ed72.js → 867640d5.a8e8538f.js} +1 -1
- data/tools/staticdocs/assets/js/{89e76475.6411e788.js → 89e76475.32c89b40.js} +1 -1
- data/tools/staticdocs/assets/js/{8b939c74.5e039b7a.js → 8b939c74.99379b35.js} +1 -1
- data/tools/staticdocs/assets/js/{8f7843ee.fb130406.js → 8f7843ee.e62c6e1f.js} +1 -1
- data/tools/staticdocs/assets/js/{9424f0b3.90296433.js → 9424f0b3.bf3ec778.js} +1 -1
- data/tools/staticdocs/assets/js/{964eb012.94a1dac1.js → 964eb012.4e5410df.js} +1 -1
- data/tools/staticdocs/assets/js/{97535711.3e76daa6.js → 97535711.b76a8c8c.js} +1 -1
- data/tools/staticdocs/assets/js/{99581c43.48391a19.js → 99581c43.c34f316a.js} +1 -1
- data/tools/staticdocs/assets/js/{9d6e81d0.c9e12517.js → 9d6e81d0.09ec34de.js} +1 -1
- data/tools/staticdocs/assets/js/{9fb6059a.2473a196.js → 9fb6059a.88b86038.js} +1 -1
- data/tools/staticdocs/assets/js/{a677c089.4e7df83d.js → a677c089.08bdd6d4.js} +1 -1
- data/tools/staticdocs/assets/js/{a9987364.5ca31d27.js → a9987364.f143fcf5.js} +1 -1
- data/tools/staticdocs/assets/js/a9b2dc27.307c7457.js +1 -0
- data/tools/staticdocs/assets/js/aa6b6c1b.daef5095.js +1 -0
- data/tools/staticdocs/assets/js/b062d239.09ce80e1.js +1 -0
- data/tools/staticdocs/assets/js/{b38a6d74.b0b07b64.js → b38a6d74.00258c8b.js} +1 -1
- data/tools/staticdocs/assets/js/{b4596165.8792340f.js → b4596165.fa18ea16.js} +1 -1
- data/tools/staticdocs/assets/js/b6d70f94.22bbfe27.js +1 -0
- data/tools/staticdocs/assets/js/{b9f60ba6.f2b60175.js → b9f60ba6.f6e2591d.js} +1 -1
- data/tools/staticdocs/assets/js/{bd0034eb.f33ae892.js → bd0034eb.b3071da1.js} +1 -1
- data/tools/staticdocs/assets/js/{c24eae19.4d25de93.js → c24eae19.4d680f8b.js} +1 -1
- data/tools/staticdocs/assets/js/{c956ad1e.38882e03.js → c956ad1e.fa55a414.js} +1 -1
- data/tools/staticdocs/assets/js/{cb8c3f08.7ca03d18.js → cb8c3f08.9d7767a0.js} +1 -1
- data/tools/staticdocs/assets/js/{cd879be4.f77d4fff.js → cd879be4.207fcb79.js} +1 -1
- data/tools/staticdocs/assets/js/cf1c01b8.85934be0.js +1 -0
- data/tools/staticdocs/assets/js/{d1b923aa.a5b3429d.js → d1b923aa.b31315e3.js} +1 -1
- data/tools/staticdocs/assets/js/d1bfc316.16fb4147.js +1 -0
- data/tools/staticdocs/assets/js/{d24bf9b6.f380debf.js → d24bf9b6.c8d15feb.js} +1 -1
- data/tools/staticdocs/assets/js/{d57a4b5d.7ce9d24e.js → d57a4b5d.90256479.js} +1 -1
- data/tools/staticdocs/assets/js/{d59d8a14.41f22286.js → d59d8a14.2ecf6a7b.js} +1 -1
- data/tools/staticdocs/assets/js/d5d77c37.1de06b83.js +1 -0
- data/tools/staticdocs/assets/js/{d66bf9c0.c87e9dc0.js → d66bf9c0.be6ef286.js} +1 -1
- data/tools/staticdocs/assets/js/{d8ca4191.b24de36d.js → d8ca4191.4cf3e03b.js} +1 -1
- data/tools/staticdocs/assets/js/d9b92eba.13b9d3a8.js +1 -0
- data/tools/staticdocs/assets/js/db8fa1d0.0714f6fa.js +1 -0
- data/tools/staticdocs/assets/js/{dbe31111.4f18bf2b.js → dbe31111.ae534424.js} +1 -1
- data/tools/staticdocs/assets/js/{dc5f7beb.d439e98e.js → dc5f7beb.28bc7f0f.js} +1 -1
- data/tools/staticdocs/assets/js/{e501b0d1.e7e284e5.js → e501b0d1.9b902145.js} +1 -1
- data/tools/staticdocs/assets/js/{f15615f1.7dcf0c73.js → f15615f1.7835e26e.js} +1 -1
- data/tools/staticdocs/assets/js/{f75a5f33.a7c7ff1d.js → f75a5f33.8fcf0643.js} +1 -1
- data/tools/staticdocs/assets/js/fd886806.efd66dbe.js +1 -0
- data/tools/staticdocs/assets/js/{main.81fa15db.js → main.355b79aa.js} +6 -6
- data/tools/staticdocs/assets/js/{runtime~main.e35f5fea.js → runtime~main.4a381777.js} +1 -1
- data/tools/staticdocs/docs/configuration/accessors.html +46 -46
- data/tools/staticdocs/docs/configuration/command.html +87 -87
- data/tools/staticdocs/docs/configuration/conversions.html +47 -47
- data/tools/staticdocs/docs/configuration/format.html +21 -21
- data/tools/staticdocs/docs/configuration/interfaces.html +55 -55
- data/tools/staticdocs/docs/configuration/limits-response.html +10 -10
- data/tools/staticdocs/docs/configuration/plugins.html +129 -124
- data/tools/staticdocs/docs/configuration/processors.html +15 -15
- data/tools/staticdocs/docs/configuration/protocols.html +66 -66
- data/tools/staticdocs/docs/configuration/ssl-tls.html +15 -15
- data/tools/staticdocs/docs/configuration/table.html +44 -44
- data/tools/staticdocs/docs/configuration/target.html +21 -21
- data/tools/staticdocs/docs/configuration/telemetry-screens.html +253 -253
- data/tools/staticdocs/docs/configuration/telemetry.html +83 -83
- data/tools/staticdocs/docs/configuration.html +2 -2
- data/tools/staticdocs/docs/development/curl.html +14 -14
- data/tools/staticdocs/docs/development/developing.html +16 -16
- data/tools/staticdocs/docs/development/json-api.html +15 -15
- data/tools/staticdocs/docs/development/log-structure.html +11 -11
- data/tools/staticdocs/docs/development/roadmap.html +4 -4
- data/tools/staticdocs/docs/development/streaming-api.html +24 -24
- data/tools/staticdocs/docs/development/testing.html +17 -17
- data/tools/staticdocs/docs/development.html +2 -2
- data/tools/staticdocs/docs/getting-started/cli.html +42 -42
- data/tools/staticdocs/docs/getting-started/generators.html +24 -24
- data/tools/staticdocs/docs/getting-started/gettingstarted.html +19 -19
- data/tools/staticdocs/docs/getting-started/installation.html +49 -19
- data/tools/staticdocs/docs/getting-started/key-concepts.html +20 -20
- data/tools/staticdocs/docs/getting-started/podman.html +23 -23
- data/tools/staticdocs/docs/getting-started/requirements.html +19 -19
- data/tools/staticdocs/docs/getting-started/upgrading.html +44 -44
- data/tools/staticdocs/docs/getting-started/util.html +25 -25
- data/tools/staticdocs/docs/getting-started.html +2 -2
- data/tools/staticdocs/docs/guides/bridges.html +14 -14
- data/tools/staticdocs/docs/guides/cfs.html +32 -32
- data/tools/staticdocs/docs/guides/custom-widgets.html +33 -33
- data/tools/staticdocs/docs/guides/dynamic-packets.html +7 -6
- data/tools/staticdocs/docs/guides/exposing-microservices.html +11 -11
- data/tools/staticdocs/docs/guides/little-endian-bitfields.html +4 -4
- data/tools/staticdocs/docs/guides/local-mode.html +13 -13
- data/tools/staticdocs/docs/guides/logging.html +9 -9
- data/tools/staticdocs/docs/guides/monitoring.html +18 -18
- data/tools/staticdocs/docs/guides/performance.html +10 -10
- data/tools/staticdocs/docs/guides/raspberrypi.html +4 -4
- data/tools/staticdocs/docs/guides/reference-architectures.html +6 -6
- data/tools/staticdocs/docs/guides/roles-permissions.html +29 -29
- data/tools/staticdocs/docs/guides/script-writing.html +75 -68
- data/tools/staticdocs/docs/guides/scripting-api.html +672 -667
- data/tools/staticdocs/docs/guides/troubleshooting.html +7 -7
- data/tools/staticdocs/docs/guides.html +2 -2
- data/tools/staticdocs/docs/meta/contributing.html +12 -12
- data/tools/staticdocs/docs/meta/licenses.html +9 -9
- data/tools/staticdocs/docs/meta/philosophy.html +3 -3
- data/tools/staticdocs/docs/meta/vulnerabilities.html +5 -5
- data/tools/staticdocs/docs/meta/xtce.html +12 -12
- data/tools/staticdocs/docs/meta.html +2 -2
- data/tools/staticdocs/docs/privacy.html +17 -17
- data/tools/staticdocs/docs/tools/admin.html +28 -28
- data/tools/staticdocs/docs/tools/autonomic.html +19 -19
- data/tools/staticdocs/docs/tools/bucket-explorer.html +11 -11
- data/tools/staticdocs/docs/tools/calendar.html +24 -24
- data/tools/staticdocs/docs/tools/cmd-sender.html +13 -13
- data/tools/staticdocs/docs/tools/cmd-tlm-server.html +24 -24
- data/tools/staticdocs/docs/tools/command-history.html +6 -6
- data/tools/staticdocs/docs/tools/command-queue.html +8 -8
- data/tools/staticdocs/docs/tools/data-extractor.html +23 -23
- data/tools/staticdocs/docs/tools/data-viewer.html +10 -10
- data/tools/staticdocs/docs/tools/handbooks.html +4 -4
- data/tools/staticdocs/docs/tools/limits-monitor.html +15 -15
- data/tools/staticdocs/docs/tools/log-explorer.html +9 -9
- data/tools/staticdocs/docs/tools/packet-viewer.html +10 -10
- data/tools/staticdocs/docs/tools/script-runner.html +36 -36
- data/tools/staticdocs/docs/tools/systemhealth.html +21 -21
- data/tools/staticdocs/docs/tools/table-manager.html +10 -10
- data/tools/staticdocs/docs/tools/tlm-grapher.html +20 -20
- data/tools/staticdocs/docs/tools/tlm-viewer.html +15 -15
- data/tools/staticdocs/docs/tools.html +2 -2
- data/tools/staticdocs/docs.html +11 -11
- data/tools/staticdocs/index.html +2 -2
- data/tools/staticdocs/lunr-index-1765917283926.json +1 -0
- data/tools/staticdocs/lunr-index.json +1 -1
- data/tools/staticdocs/markdown-page.html +3 -3
- data/tools/staticdocs/search-doc-1765917283926.json +1 -0
- data/tools/staticdocs/search-doc.json +1 -1
- metadata +92 -92
- data/tools/staticdocs/assets/js/0ff569c9.9566d390.js +0 -1
- data/tools/staticdocs/assets/js/1202.d22d6899.js +0 -101
- data/tools/staticdocs/assets/js/13196248.8bbc13cd.js +0 -1
- data/tools/staticdocs/assets/js/1596.e0bc0cb8.js +0 -1
- data/tools/staticdocs/assets/js/26b8abb2.237c47e9.js +0 -1
- data/tools/staticdocs/assets/js/3140.8b312c79.js +0 -1
- data/tools/staticdocs/assets/js/35398c5c.0f3180d9.js +0 -1
- data/tools/staticdocs/assets/js/42170351.3618f599.js +0 -1
- data/tools/staticdocs/assets/js/4581.bbe04eae.js +0 -4
- data/tools/staticdocs/assets/js/5e3ed378.9ad2dcd2.js +0 -1
- data/tools/staticdocs/assets/js/6831b732.1790429a.js +0 -1
- data/tools/staticdocs/assets/js/7399.857e78fe.js +0 -1
- data/tools/staticdocs/assets/js/9601.e8389133.js +0 -1
- data/tools/staticdocs/assets/js/a9b2dc27.1f8d5c81.js +0 -1
- data/tools/staticdocs/assets/js/aa6b6c1b.750dc927.js +0 -1
- data/tools/staticdocs/assets/js/b062d239.cd8e5784.js +0 -1
- data/tools/staticdocs/assets/js/b6d70f94.43a5cd5a.js +0 -1
- data/tools/staticdocs/assets/js/cf1c01b8.f5a9a237.js +0 -1
- data/tools/staticdocs/assets/js/d1bfc316.7c605bc5.js +0 -1
- data/tools/staticdocs/assets/js/d5d77c37.ae6fba94.js +0 -1
- data/tools/staticdocs/assets/js/d9b92eba.b08eeda4.js +0 -1
- data/tools/staticdocs/assets/js/db8fa1d0.a05e2bae.js +0 -1
- data/tools/staticdocs/assets/js/fd886806.4b383c00.js +0 -1
- data/tools/staticdocs/lunr-index-1765340262146.json +0 -1
- data/tools/staticdocs/search-doc-1765340262146.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5746"],{6001:function(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>p,frontMatter:()=>s,contentTitle:()=>a,toc:()=>l,assets:()=>d});var i=JSON.parse('{"id":"guides/bridges","title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","source":"@site/docs/guides/bridges.md","sourceDirName":"guides","slug":"/guides/bridges","permalink":"/tools/staticdocs/docs/guides/bridges","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/bridges.md","tags":[],"version":"current","frontMatter":{"title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","sidebar_custom_props":{"myEmoji":"\u{1F309}"}},"sidebar":"defaultSidebar","previous":{"title":"Guides","permalink":"/tools/staticdocs/docs/guides"},"next":{"title":"COSMOS and NASA cFS","permalink":"/tools/staticdocs/docs/guides/cfs"}}'),r=t(7259),o=t(9796);let s={title:"Bridges",description:"Bridge data into COSMOS from serial ports, PCI, etc",sidebar_custom_props:{myEmoji:"\u{1F309}"}},a,d={},l=[{value:"Bridges are Generally Just an Interface and Router",id:"bridges-are-generally-just-an-interface-and-router",level:2},{value:"Host Requirements for Running Bridges",id:"host-requirements-for-running-bridges",level:2},{value:"Bridge Configuration: bridge.txt",id:"bridge-configuration-bridgetxt",level:2},{value:"Bridge Commands: openc3cli",id:"bridge-commands-openc3cli",level:2},{value:"Python Bridge Commands: openc3pycli",id:"python-bridge-commands-openc3pycli",level:2},{value:"Example Bridge Gems",id:"example-bridge-gems",level:2},{value:"Note on Serial Ports",id:"note-on-serial-ports",level:2}];function c(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components},{TabItem:t,Tabs:i}=n;return t||u("TabItem",!0),i||u("Tabs",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.\nSerial ports are the most common, but other devices such as USB, PCI cards, and Bluetooth devices can also be\nsupported by using bridges to convert from a host computer accessible device, into an Ethernet byte stream that COSMOS can process from inside of containers."}),"\n",(0,r.jsx)(n.admonition,{title:"Bridges are Meant to be Dumb",type:"warning",children:(0,r.jsx)(n.p,{children:"The purpose of bridges is to get bytes into COSMOS. Processing should be done in COSMOS itself, including details such as\npacket delineation."})}),"\n",(0,r.jsx)(n.h2,{id:"bridges-are-generally-just-an-interface-and-router",children:"Bridges are Generally Just an Interface and Router"}),"\n",(0,r.jsx)(n.p,{children:"Bridges are generally made up of a COSMOS Interface class that pull data from a host connected device, and a Router that forwards that data to\nCOSMOS over TCP/IP. In most cases, data can be safely sent to COSMOS using the BURST protocol, and let the COSMOS side use the correct packet delineation\nprotocol like LENGTH."}),"\n",(0,r.jsx)(n.h2,{id:"host-requirements-for-running-bridges",children:"Host Requirements for Running Bridges"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Requires a host Ruby installation (Ruby 3)"}),"\n",(0,r.jsxs)(n.li,{children:["Install the OpenC3 gem","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"gem install openc3"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["Make sure the Ruby gem executable path is in your PATH environment variable","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["You can find this path by running ",(0,r.jsx)(n.code,{children:"gem environment"})," and looking for EXECUTABLE DIRECTORY"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["If successful, you should be able to run ",(0,r.jsx)(n.code,{children:"openc3cli"})," from a terminal"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"bridge-configuration-bridgetxt",children:"Bridge Configuration: bridge.txt"}),"\n",(0,r.jsx)(n.p,{children:"Bridges are run using an configuration file named bridge.txt. This file is a subset of the plugin.txt configuration syntax supporting VARIABLE, INTERFACE, ROUTER, and associated modifier keywords. However, BRIDGES HAVE NO KNOWLEDGE OF TARGETS. So instead of MAP_TARGETS, the INTERFACE is associated with the ROUTER using the ROUTE keyword."}),"\n",(0,r.jsxs)(n.p,{children:["The following is the default bridge.txt that is generated by running ",(0,r.jsx)(n.code,{children:"openc3cli bridgesetup"})]}),"\n",(0,r.jsxs)(i,{groupId:"script-language",children:[(0,r.jsx)(t,{value:"ruby",label:"Ruby Example",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT serial_interface.rb <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER tcpip_server_interface.rb <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})})}),(0,r.jsx)(t,{value:"python",label:"Python Example",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT openc3/interfaces/serial_interface.py <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER openc3/interfaces/tcpip_server_interface.py <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})})})]}),"\n",(0,r.jsx)(n.p,{children:"VARIABLE provides default values to variables that can be changed when the bridge is started. This example shows an INTERFACE that is configured to use the serial_interface.rb class. It also includes a standard ROUTER using tcpip_server_interface.rb that COSMOS can connect to and get the data from the serial port. The LISTEN_ADDRESS is set to 127.0.0.1 in this example to prevent access from outside of the host system. Docker running on the same machine can access\nthis server using the host.docker.internal hostname and the configured port (2950 in this example)."}),"\n",(0,r.jsx)(n.h2,{id:"bridge-commands-openc3cli",children:"Bridge Commands: openc3cli"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridgesetup"})}),"\n",(0,r.jsx)(n.p,{children:"Generates a bridge.txt example file"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridgegem [gem_name] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge using the bridge.txt provided in a bridge gem. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.h2,{id:"python-bridge-commands-openc3pycli",children:"Python Bridge Commands: openc3pycli"}),"\n",(0,r.jsx)(n.p,{children:"To use the openc3pycli, first run"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"python3 -m pip install -e ."})}),"\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/cli.py",children:"cosmos/openc3/python/openc3/cli.py"})," directory. A venv may be required to be activated prior to running the pip install. If so, run the following:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"python3 -m venv /path/to/your/venv\nsource /path/to/your/venv/bin/activate\npython3 -m pip install -e . \n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3pycli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.h2,{id:"example-bridge-gems",children:"Example Bridge Gems"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Serial Port: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-serial",children:"openc3-cosmos-bridge-serial"})]}),"\n",(0,r.jsxs)(n.li,{children:["Host: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-host",children:"openc3-cosmos-bridge-host"})]}),"\n",(0,r.jsxs)(n.li,{children:["HIDAPI: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-hidapi",children:"openc3-cosmos-bridge-hidapi"})]}),"\n",(0,r.jsxs)(n.li,{children:["PS5 Dual Sense Controller: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-dualsense",children:"openc3-cosmos-bridge-dualsense"})]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"note-on-serial-ports",children:"Note on Serial Ports"}),"\n",(0,r.jsx)(n.p,{children:"Serial ports can be used directly without bridges on Linux Docker installations."}),"\n",(0,r.jsx)(n.p,{children:"Add the following to the operator service in compose.yaml:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:' devices:\n - "/dev/ttyUSB0:/dev/ttyUSB0"\n'})}),"\n",(0,r.jsx)(n.p,{children:"Make sure the serial device has permissions for the user running Docker to access:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo chmod 666 /dev/ttyUSB0\n"})})]})}function p(e={}){let{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}function u(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},9796:function(e,n,t){t.d(n,{R:()=>s,x:()=>a});var i=t(6363);let r={},o=i.createContext(r);function s(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5746"],{9094:function(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>p,frontMatter:()=>s,contentTitle:()=>a,toc:()=>l,assets:()=>d});var i=JSON.parse('{"id":"guides/bridges","title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","source":"@site/docs/guides/bridges.md","sourceDirName":"guides","slug":"/guides/bridges","permalink":"/tools/staticdocs/docs/guides/bridges","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/bridges.md","tags":[],"version":"current","frontMatter":{"title":"Bridges","description":"Bridge data into COSMOS from serial ports, PCI, etc","sidebar_custom_props":{"myEmoji":"\u{1F309}"}},"sidebar":"defaultSidebar","previous":{"title":"Guides","permalink":"/tools/staticdocs/docs/guides"},"next":{"title":"COSMOS and NASA cFS","permalink":"/tools/staticdocs/docs/guides/cfs"}}'),r=t(5656),o=t(5395);let s={title:"Bridges",description:"Bridge data into COSMOS from serial ports, PCI, etc",sidebar_custom_props:{myEmoji:"\u{1F309}"}},a,d={},l=[{value:"Bridges are Generally Just an Interface and Router",id:"bridges-are-generally-just-an-interface-and-router",level:2},{value:"Host Requirements for Running Bridges",id:"host-requirements-for-running-bridges",level:2},{value:"Bridge Configuration: bridge.txt",id:"bridge-configuration-bridgetxt",level:2},{value:"Bridge Commands: openc3cli",id:"bridge-commands-openc3cli",level:2},{value:"Python Bridge Commands: openc3pycli",id:"python-bridge-commands-openc3pycli",level:2},{value:"Example Bridge Gems",id:"example-bridge-gems",level:2},{value:"Note on Serial Ports",id:"note-on-serial-ports",level:2}];function c(e){let n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components},{TabItem:t,Tabs:i}=n;return t||u("TabItem",!0),i||u("Tabs",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"COSMOS Bridges provide an easy solution for getting data from devices that don't speak Ethernet into COSMOS.\nSerial ports are the most common, but other devices such as USB, PCI cards, and Bluetooth devices can also be\nsupported by using bridges to convert from a host computer accessible device, into an Ethernet byte stream that COSMOS can process from inside of containers."}),"\n",(0,r.jsx)(n.admonition,{title:"Bridges are Meant to be Dumb",type:"warning",children:(0,r.jsx)(n.p,{children:"The purpose of bridges is to get bytes into COSMOS. Processing should be done in COSMOS itself, including details such as\npacket delineation."})}),"\n",(0,r.jsx)(n.h2,{id:"bridges-are-generally-just-an-interface-and-router",children:"Bridges are Generally Just an Interface and Router"}),"\n",(0,r.jsx)(n.p,{children:"Bridges are generally made up of a COSMOS Interface class that pull data from a host connected device, and a Router that forwards that data to\nCOSMOS over TCP/IP. In most cases, data can be safely sent to COSMOS using the BURST protocol, and let the COSMOS side use the correct packet delineation\nprotocol like LENGTH."}),"\n",(0,r.jsx)(n.h2,{id:"host-requirements-for-running-bridges",children:"Host Requirements for Running Bridges"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Requires a host Ruby installation (Ruby 3)"}),"\n",(0,r.jsxs)(n.li,{children:["Install the OpenC3 gem","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"gem install openc3"}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["Make sure the Ruby gem executable path is in your PATH environment variable","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["You can find this path by running ",(0,r.jsx)(n.code,{children:"gem environment"})," and looking for EXECUTABLE DIRECTORY"]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["If successful, you should be able to run ",(0,r.jsx)(n.code,{children:"openc3cli"})," from a terminal"]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"bridge-configuration-bridgetxt",children:"Bridge Configuration: bridge.txt"}),"\n",(0,r.jsx)(n.p,{children:"Bridges are run using an configuration file named bridge.txt. This file is a subset of the plugin.txt configuration syntax supporting VARIABLE, INTERFACE, ROUTER, and associated modifier keywords. However, BRIDGES HAVE NO KNOWLEDGE OF TARGETS. So instead of MAP_TARGETS, the INTERFACE is associated with the ROUTER using the ROUTE keyword."}),"\n",(0,r.jsxs)(n.p,{children:["The following is the default bridge.txt that is generated by running ",(0,r.jsx)(n.code,{children:"openc3cli bridgesetup"})]}),"\n",(0,r.jsxs)(i,{groupId:"script-language",children:[(0,r.jsx)(t,{value:"ruby",label:"Ruby Example",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT serial_interface.rb <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER tcpip_server_interface.rb <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})})}),(0,r.jsx)(t,{value:"python",label:"Python Example",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ruby",children:"# Write serial port name\nVARIABLE write_port_name COM1\n\n# Read serial port name\nVARIABLE read_port_name COM1\n\n# Baud Rate\nVARIABLE baud_rate 115200\n\n# Parity - NONE, ODD, or EVEN\nVARIABLE parity NONE\n\n# Stop bits - 0, 1, or 2\nVARIABLE stop_bits 1\n\n# Write Timeout\nVARIABLE write_timeout 10.0\n\n# Read Timeout\nVARIABLE read_timeout nil\n\n# Flow Control - NONE, or RTSCTS\nVARIABLE flow_control NONE\n\n# Data bits per word - Typically 8\nVARIABLE data_bits 8\n\n# Port to listen for connections from COSMOS - Plugin must match\nVARIABLE router_port 2950\n\n# Port to listen on for connections from COSMOS. Defaults to localhost for security. Will need to be opened\n# if COSMOS is on another machine.\nVARIABLE router_listen_address 127.0.0.1\n\nINTERFACE SERIAL_INT openc3/interfaces/serial_interface.py <%= write_port_name %> <%= read_port_name %> <%= baud_rate %> <%= parity %> <%= stop_bits %> <%= write_timeout %> <%= read_timeout %>\n OPTION FLOW_CONTROL <%= flow_control %>\n OPTION DATA_BITS <%= data_bits %>\n\nROUTER SERIAL_ROUTER openc3/interfaces/tcpip_server_interface.py <%= router_port %> <%= router_port %> 10.0 nil BURST\n ROUTE SERIAL_INT\n OPTION LISTEN_ADDRESS <%= router_listen_address %>\n"})})})]}),"\n",(0,r.jsx)(n.p,{children:"VARIABLE provides default values to variables that can be changed when the bridge is started. This example shows an INTERFACE that is configured to use the serial_interface.rb class. It also includes a standard ROUTER using tcpip_server_interface.rb that COSMOS can connect to and get the data from the serial port. The LISTEN_ADDRESS is set to 127.0.0.1 in this example to prevent access from outside of the host system. Docker running on the same machine can access\nthis server using the host.docker.internal hostname and the configured port (2950 in this example)."}),"\n",(0,r.jsx)(n.h2,{id:"bridge-commands-openc3cli",children:"Bridge Commands: openc3cli"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridgesetup"})}),"\n",(0,r.jsx)(n.p,{children:"Generates a bridge.txt example file"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3cli bridgegem [gem_name] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge using the bridge.txt provided in a bridge gem. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.h2,{id:"python-bridge-commands-openc3pycli",children:"Python Bridge Commands: openc3pycli"}),"\n",(0,r.jsx)(n.p,{children:"To use the openc3pycli, first run"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"python3 -m pip install -e ."})}),"\n",(0,r.jsxs)(n.p,{children:["In the ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/python/openc3/cli.py",children:"cosmos/openc3/python/openc3/cli.py"})," directory. A venv may be required to be activated prior to running the pip install. If so, run the following:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"python3 -m venv /path/to/your/venv\nsource /path/to/your/venv/bin/activate\npython3 -m pip install -e . \n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.code,{children:"openc3pycli bridge [filename] [variable1=value1] [variable2=value2]"})}),"\n",(0,r.jsx)(n.p,{children:"Runs a bridge from a given configuration file. Defaults to bridge.txt in the current directory. Variables can also be passed into to override VARIABLE defaults."}),"\n",(0,r.jsx)(n.h2,{id:"example-bridge-gems",children:"Example Bridge Gems"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Serial Port: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-serial",children:"openc3-cosmos-bridge-serial"})]}),"\n",(0,r.jsxs)(n.li,{children:["Host: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-host",children:"openc3-cosmos-bridge-host"})]}),"\n",(0,r.jsxs)(n.li,{children:["HIDAPI: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-hidapi",children:"openc3-cosmos-bridge-hidapi"})]}),"\n",(0,r.jsxs)(n.li,{children:["PS5 Dual Sense Controller: ",(0,r.jsx)(n.a,{href:"https://github.com/OpenC3/openc3-cosmos-bridge-dualsense",children:"openc3-cosmos-bridge-dualsense"})]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"note-on-serial-ports",children:"Note on Serial Ports"}),"\n",(0,r.jsx)(n.p,{children:"Serial ports can be used directly without bridges on Linux Docker installations."}),"\n",(0,r.jsx)(n.p,{children:"Add the following to the operator service in compose.yaml:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:' devices:\n - "/dev/ttyUSB0:/dev/ttyUSB0"\n'})}),"\n",(0,r.jsx)(n.p,{children:"Make sure the serial device has permissions for the user running Docker to access:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"sudo chmod 666 /dev/ttyUSB0\n"})})]})}function p(e={}){let{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}function u(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},5395:function(e,n,t){t.d(n,{R:()=>s,x:()=>a});var i=t(7140);let r={},o=i.createContext(r);function s(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["6090"],{7566:function(e,n,o){o.r(n),o.d(n,{metadata:()=>s,default:()=>p,frontMatter:()=>c,contentTitle:()=>r,toc:()=>a,assets:()=>l});var s=JSON.parse('{"id":"development/developing","title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","source":"@site/docs/development/developing.md","sourceDirName":"development","slug":"/development/developing","permalink":"/tools/staticdocs/docs/development/developing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/developing.md","tags":[],"version":"current","frontMatter":{"title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","sidebar_custom_props":{"myEmoji":"\u{1F4BB}"}},"sidebar":"defaultSidebar","previous":{"title":"Testing with Curl","permalink":"/tools/staticdocs/docs/development/curl"},"next":{"title":"JSON API","permalink":"/tools/staticdocs/docs/development/json-api"}}'),t=o(7259),i=o(9796);let c={title:"Developing COSMOS",description:"Building COSMOS and developing the frontend and backend",sidebar_custom_props:{myEmoji:"\u{1F4BB}"}},r="Developing COSMOS",l={},a=[{value:"Development Tools",id:"development-tools",level:2},{value:"Running a Frontend Application",id:"running-a-frontend-application",level:2},{value:"Running a Backend Server",id:"running-a-backend-server",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"developing-cosmos",children:"Developing COSMOS"})}),"\n",(0,t.jsxs)(n.p,{children:["So you want to help develop COSMOS? All of our COSMOS Core code is on ",(0,t.jsx)(n.a,{href:"https://github.com/",children:"Github"})," so the first thing to do is get an ",(0,t.jsx)(n.a,{href:"https://github.com/join",children:"account"}),". Next ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository",children:"clone"})," the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos",children:"COSMOS"})," repository. We accept contributions from others as ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests",children:"Pull Requests"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"development-tools",children:"Development Tools"}),"\n",(0,t.jsxs)(n.p,{children:["The OpenC3 team develops with the ",(0,t.jsx)(n.a,{href:"https://code.visualstudio.com/",children:"Visual Studio Code"})," editor and we highly recommend it. We also utilize a number of extensions including docker, kubernetes, gitlens, prettier, eslint, python, vetur, and ruby. We commit our ",(0,t.jsx)(n.code,{children:"openc3.code-workspace"})," configuration for VSCode to help configure these plugins. You also need ",(0,t.jsx)(n.a,{href:"https://www.docker.com/products/docker-desktop",children:"Docker Desktop"})," which you should already have as it is a requirement to run COSMOS. You'll also need ",(0,t.jsx)(n.a,{href:"https://nodejs.org/en/download/",children:"NodeJS"})," and ",(0,t.jsx)(n.a,{href:"https://pnpm.io/installation",children:"pnpm"})," installed."]}),"\n",(0,t.jsx)(n.h1,{id:"building-cosmos",children:"Building COSMOS"}),"\n",(0,t.jsx)(n.p,{children:"Note: We primarily develop COSMOS in MacOS so the commands here will reference bash scripts but the same files exist in Windows as batch scripts."}),"\n",(0,t.jsxs)(n.p,{children:["Build COSMOS using the ",(0,t.jsx)(n.code,{children:"openc3.sh"})," script:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh build\n"})}),"\n",(0,t.jsx)(n.p,{children:"This will pull all the COSMOS container dependencies and build our local containers. Note: This can take a long time especially for your first build!"}),"\n",(0,t.jsx)(n.p,{children:"Once the build completes you can see the built images with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker image ls | grep "openc3"\nopenc3inc/openc3-cosmos-init latest 4cac7a3ea9d3 29 hours ago 446MB\nopenc3inc/openc3-cosmos-script-runner-api latest 4aacbaf49f7a 29 hours ago 431MB\nopenc3inc/openc3-cosmos-cmd-tlm-api latest 9a8806bd4be3 3 days ago 432MB\nopenc3inc/openc3-operator latest 223e98129fe9 3 days ago 405MB\nopenc3inc/openc3-base latest 98df5c0378c2 3 days ago 405MB\nopenc3inc/openc3-redis latest 5a3003a49199 8 days ago 111MB\nopenc3inc/openc3-traefik latest ec13a8d16a2f 8 days ago 104MB\nopenc3inc/openc3-minio latest 787f6e3fc0be 8 days ago 238MB\nopenc3inc/openc3-node latest b3ee86d3620a 8 days ago 372MB\nopenc3inc/openc3-ruby latest aa158bbb9539 8 days ago 326MB\n'})}),"\n",(0,t.jsxs)(n.admonition,{title:"Offline Building",type:"info",children:[(0,t.jsxs)(n.p,{children:["If you're building in a offline environment or want to use a private Rubygems, NPM or APK server (e.g. Nexus), you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos/blob/main/.env",children:".env"})," file. Example values:"]}),(0,t.jsxs)(n.p,{children:["ALPINE_VERSION=3.22",(0,t.jsx)("br",{}),"\nALPINE_BUILD=2",(0,t.jsx)("br",{}),"\nRUBYGEMS_URL=",(0,t.jsx)(n.a,{href:"https://rubygems.org",children:"https://rubygems.org"}),(0,t.jsx)("br",{}),"\nNPM_URL=",(0,t.jsx)(n.a,{href:"https://registry.npmjs.org",children:"https://registry.npmjs.org"}),(0,t.jsx)("br",{}),"\nAPK_URL=",(0,t.jsx)(n.a,{href:"http://dl-cdn.alpinelinux.org",children:"http://dl-cdn.alpinelinux.org"}),(0,t.jsx)("br",{})]})]}),"\n",(0,t.jsx)(n.h1,{id:"running-cosmos",children:"Running COSMOS"}),"\n",(0,t.jsxs)(n.p,{children:["Running COSMOS in development mode enables localhost access to internal API ports as well as sets ",(0,t.jsx)(n.code,{children:"RAILS_ENV=development"})," in the cmd-tlm-api and script-runner-api Rails servers. To run in development mode:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh run\n"})}),"\n",(0,t.jsx)(n.p,{children:"You can now see the running containers (I removed CONTAINER ID, CREATED and STATUS to save space):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker ps\nIMAGE COMMAND PORTS NAMES\nopenc3/openc3-cmd-tlm-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2901->2901/tcp cosmos-openc3-cmd-tlm-api-1\nopenc3/openc3-script-runner-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2902->2902/tcp cosmos-openc3-script-runner-api-1\nopenc3/openc3-traefik:latest "/entrypoint.sh trae\u2026" 0.0.0.0:2900->80/tcp cosmos-openc3-traefik-1\nopenc3/openc3-operator:latest "/sbin/tini -- ruby \u2026" cosmos-openc3-operator-1\nopenc3/openc3-minio:latest "/usr/bin/docker-ent\u2026" 127.0.0.1:9000->9000/tcp cosmos-openc3-minio-1\nopenc3/openc3-redis:latest "docker-entrypoint.s\u2026" 127.0.0.1:6379->6379/tcp cosmos-openc3-redis-1\n'})}),"\n",(0,t.jsx)(n.p,{children:"If you go to localhost:2900 you should see COSMOS up and running!"}),"\n",(0,t.jsx)(n.h2,{id:"running-a-frontend-application",children:"Running a Frontend Application"}),"\n",(0,t.jsx)(n.p,{children:"So now that you have COSMOS up and running how do you develop an individual COSMOS application?"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Bootstrap the frontend with pnpm"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init/plugins % pnpm install --frozen-lockfile --ignore-scripts\nopenc3-init/plugins % pnpm build:common\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Serve a local COSMOS application (CmdTlmServer, ScriptRunner, etc)"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init % cd plugins/packages/openc3-tool-scriptrunner\nopenc3-tool-scriptrunner % pnpm serve\nbuilt in 128722ms\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Set the ",(0,t.jsx)(n.a,{href:"https://single-spa.js.org/",children:"single SPA"})," override for the application"]}),"\n",(0,t.jsxs)(n.p,{children:["Visit localhost:2900 and Right-click 'Inspect'",(0,t.jsx)("br",{}),"\nIn the console paste:"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-javascript",children:'localStorage.setItem("devtools", true);\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Refresh and you should see ",(0,t.jsx)(n.code,{children:"{...}"})," in the bottom right",(0,t.jsx)("br",{}),"\nClick the Default button next to the application (@openc3/tool-scriptrunner)",(0,t.jsx)("br",{}),"\nPaste in the development path which is dependent on the port returned by the local pnpm serve and the tool name (scriptrunner)"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"http://localhost:2914/tools/scriptrunner/main.js",children:"http://localhost:2914/tools/scriptrunner/main.js"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Refresh the page and you should see your local copy of the application (Script Runner in this example). If you dynamically add code (like ",(0,t.jsx)(n.code,{children:"console.log"}),") the pnpm window should re-compile and the browser should refresh displaying your new code. It is highly recommended to get familiar with your browser's ",(0,t.jsx)(n.a,{href:"https://developer.chrome.com/docs/devtools/overview/",children:"development tools"})," if you plan to do frontend development."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"running-a-backend-server",children:"Running a Backend Server"}),"\n",(0,t.jsx)(n.p,{children:"If the code you want to develop is the cmd-tlm-api or script-runner-api backend servers there are several steps to enable access to a development copy."}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a development version of traefik. COSMOS uses traefik to direct API requests to the correct locations."}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-traefik\nopenc3-traefik % docker ps\n# Look for the container with name including traefik\nopenc3-traefik % docker stop cosmos-openc3-traefik-1\nopenc3-traefik % docker build --build-arg TRAEFIK_CONFIG=traefik-dev.yaml -t openc3-traefik-dev .\nopenc3-traefik % docker run --network=openc3-cosmos-network -p 2900:2900 -it --rm openc3-traefik-dev\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a local copy of the cmd-tlm-api or script-runner-api"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-cosmos-cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker ps\n# Look for the container with name including cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker stop cosmos-openc3-cosmos-cmd-tlm-api-1\n# Run the following on Windows:\nopenc3-cosmos-cmd-tlm-api> dev_server.bat\n# In Linux, set all the environment variables in the .env file, but override REDIS to be local\nopenc3-cosmos-cmd-tlm-api % set -a; source ../.env; set +a\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_EPHEMERAL_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % bundle install\nopenc3-cosmos-cmd-tlm-api % bundle exec rails s\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Once the ",(0,t.jsx)(n.code,{children:"bundle exec rails s"})," command returns you should see API requests coming from interactions in the frontend code. If you add code (like Ruby debugging statements) to the cmd-tlm-api code you need to stop the server (CTRL-C) and restart it to see the effect."]}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},9796:function(e,n,o){o.d(n,{R:()=>c,x:()=>r});var s=o(6363);let t={},i=s.createContext(t);function c(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:c(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["6090"],{8617:function(e,n,o){o.r(n),o.d(n,{metadata:()=>s,default:()=>p,frontMatter:()=>c,contentTitle:()=>r,toc:()=>a,assets:()=>l});var s=JSON.parse('{"id":"development/developing","title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","source":"@site/docs/development/developing.md","sourceDirName":"development","slug":"/development/developing","permalink":"/tools/staticdocs/docs/development/developing","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/development/developing.md","tags":[],"version":"current","frontMatter":{"title":"Developing COSMOS","description":"Building COSMOS and developing the frontend and backend","sidebar_custom_props":{"myEmoji":"\u{1F4BB}"}},"sidebar":"defaultSidebar","previous":{"title":"Testing with Curl","permalink":"/tools/staticdocs/docs/development/curl"},"next":{"title":"JSON API","permalink":"/tools/staticdocs/docs/development/json-api"}}'),t=o(5656),i=o(5395);let c={title:"Developing COSMOS",description:"Building COSMOS and developing the frontend and backend",sidebar_custom_props:{myEmoji:"\u{1F4BB}"}},r="Developing COSMOS",l={},a=[{value:"Development Tools",id:"development-tools",level:2},{value:"Running a Frontend Application",id:"running-a-frontend-application",level:2},{value:"Running a Backend Server",id:"running-a-backend-server",level:2}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"developing-cosmos",children:"Developing COSMOS"})}),"\n",(0,t.jsxs)(n.p,{children:["So you want to help develop COSMOS? All of our COSMOS Core code is on ",(0,t.jsx)(n.a,{href:"https://github.com/",children:"Github"})," so the first thing to do is get an ",(0,t.jsx)(n.a,{href:"https://github.com/join",children:"account"}),". Next ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository",children:"clone"})," the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos",children:"COSMOS"})," repository. We accept contributions from others as ",(0,t.jsx)(n.a,{href:"https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests",children:"Pull Requests"}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"development-tools",children:"Development Tools"}),"\n",(0,t.jsxs)(n.p,{children:["The OpenC3 team develops with the ",(0,t.jsx)(n.a,{href:"https://code.visualstudio.com/",children:"Visual Studio Code"})," editor and we highly recommend it. We also utilize a number of extensions including docker, kubernetes, gitlens, prettier, eslint, python, vetur, and ruby. We commit our ",(0,t.jsx)(n.code,{children:"openc3.code-workspace"})," configuration for VSCode to help configure these plugins. You also need ",(0,t.jsx)(n.a,{href:"https://www.docker.com/products/docker-desktop",children:"Docker Desktop"})," which you should already have as it is a requirement to run COSMOS. You'll also need ",(0,t.jsx)(n.a,{href:"https://nodejs.org/en/download/",children:"NodeJS"})," and ",(0,t.jsx)(n.a,{href:"https://pnpm.io/installation",children:"pnpm"})," installed."]}),"\n",(0,t.jsx)(n.h1,{id:"building-cosmos",children:"Building COSMOS"}),"\n",(0,t.jsx)(n.p,{children:"Note: We primarily develop COSMOS in MacOS so the commands here will reference bash scripts but the same files exist in Windows as batch scripts."}),"\n",(0,t.jsxs)(n.p,{children:["Build COSMOS using the ",(0,t.jsx)(n.code,{children:"openc3.sh"})," script:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh build\n"})}),"\n",(0,t.jsx)(n.p,{children:"This will pull all the COSMOS container dependencies and build our local containers. Note: This can take a long time especially for your first build!"}),"\n",(0,t.jsx)(n.p,{children:"Once the build completes you can see the built images with the following command:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker image ls | grep "openc3"\nopenc3inc/openc3-cosmos-init latest 4cac7a3ea9d3 29 hours ago 446MB\nopenc3inc/openc3-cosmos-script-runner-api latest 4aacbaf49f7a 29 hours ago 431MB\nopenc3inc/openc3-cosmos-cmd-tlm-api latest 9a8806bd4be3 3 days ago 432MB\nopenc3inc/openc3-operator latest 223e98129fe9 3 days ago 405MB\nopenc3inc/openc3-base latest 98df5c0378c2 3 days ago 405MB\nopenc3inc/openc3-redis latest 5a3003a49199 8 days ago 111MB\nopenc3inc/openc3-traefik latest ec13a8d16a2f 8 days ago 104MB\nopenc3inc/openc3-minio latest 787f6e3fc0be 8 days ago 238MB\nopenc3inc/openc3-node latest b3ee86d3620a 8 days ago 372MB\nopenc3inc/openc3-ruby latest aa158bbb9539 8 days ago 326MB\n'})}),"\n",(0,t.jsxs)(n.admonition,{title:"Offline Building",type:"info",children:[(0,t.jsxs)(n.p,{children:["If you're building in a offline environment or want to use a private Rubygems, NPM or APK server (e.g. Nexus), you can update the following environment variables: RUBYGEMS_URL, NPM_URL, APK_URL, and more in the ",(0,t.jsx)(n.a,{href:"https://github.com/openc3/cosmos/blob/main/.env",children:".env"})," file. Example values:"]}),(0,t.jsxs)(n.p,{children:["ALPINE_VERSION=3.22",(0,t.jsx)("br",{}),"\nALPINE_BUILD=2",(0,t.jsx)("br",{}),"\nRUBYGEMS_URL=",(0,t.jsx)(n.a,{href:"https://rubygems.org",children:"https://rubygems.org"}),(0,t.jsx)("br",{}),"\nNPM_URL=",(0,t.jsx)(n.a,{href:"https://registry.npmjs.org",children:"https://registry.npmjs.org"}),(0,t.jsx)("br",{}),"\nAPK_URL=",(0,t.jsx)(n.a,{href:"http://dl-cdn.alpinelinux.org",children:"http://dl-cdn.alpinelinux.org"}),(0,t.jsx)("br",{})]})]}),"\n",(0,t.jsx)(n.h1,{id:"running-cosmos",children:"Running COSMOS"}),"\n",(0,t.jsxs)(n.p,{children:["Running COSMOS in development mode enables localhost access to internal API ports as well as sets ",(0,t.jsx)(n.code,{children:"RAILS_ENV=development"})," in the cmd-tlm-api and script-runner-api Rails servers. To run in development mode:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% ./openc3.sh run\n"})}),"\n",(0,t.jsx)(n.p,{children:"You can now see the running containers (I removed CONTAINER ID, CREATED and STATUS to save space):"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'% docker ps\nIMAGE COMMAND PORTS NAMES\nopenc3/openc3-cmd-tlm-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2901->2901/tcp cosmos-openc3-cmd-tlm-api-1\nopenc3/openc3-script-runner-api:latest "/sbin/tini -- rails\u2026" 127.0.0.1:2902->2902/tcp cosmos-openc3-script-runner-api-1\nopenc3/openc3-traefik:latest "/entrypoint.sh trae\u2026" 0.0.0.0:2900->80/tcp cosmos-openc3-traefik-1\nopenc3/openc3-operator:latest "/sbin/tini -- ruby \u2026" cosmos-openc3-operator-1\nopenc3/openc3-minio:latest "/usr/bin/docker-ent\u2026" 127.0.0.1:9000->9000/tcp cosmos-openc3-minio-1\nopenc3/openc3-redis:latest "docker-entrypoint.s\u2026" 127.0.0.1:6379->6379/tcp cosmos-openc3-redis-1\n'})}),"\n",(0,t.jsx)(n.p,{children:"If you go to localhost:2900 you should see COSMOS up and running!"}),"\n",(0,t.jsx)(n.h2,{id:"running-a-frontend-application",children:"Running a Frontend Application"}),"\n",(0,t.jsx)(n.p,{children:"So now that you have COSMOS up and running how do you develop an individual COSMOS application?"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Bootstrap the frontend with pnpm"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init/plugins % pnpm install --frozen-lockfile --ignore-scripts\nopenc3-init/plugins % pnpm build:common\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Serve a local COSMOS application (CmdTlmServer, ScriptRunner, etc)"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"openc3-init % cd plugins/packages/openc3-tool-scriptrunner\nopenc3-tool-scriptrunner % pnpm serve\nbuilt in 128722ms\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Set the ",(0,t.jsx)(n.a,{href:"https://single-spa.js.org/",children:"single SPA"})," override for the application"]}),"\n",(0,t.jsxs)(n.p,{children:["Visit localhost:2900 and Right-click 'Inspect'",(0,t.jsx)("br",{}),"\nIn the console paste:"]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-javascript",children:'localStorage.setItem("devtools", true);\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Refresh and you should see ",(0,t.jsx)(n.code,{children:"{...}"})," in the bottom right",(0,t.jsx)("br",{}),"\nClick the Default button next to the application (@openc3/tool-scriptrunner)",(0,t.jsx)("br",{}),"\nPaste in the development path which is dependent on the port returned by the local pnpm serve and the tool name (scriptrunner)"]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.a,{href:"http://localhost:2914/tools/scriptrunner/main.js",children:"http://localhost:2914/tools/scriptrunner/main.js"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Refresh the page and you should see your local copy of the application (Script Runner in this example). If you dynamically add code (like ",(0,t.jsx)(n.code,{children:"console.log"}),") the pnpm window should re-compile and the browser should refresh displaying your new code. It is highly recommended to get familiar with your browser's ",(0,t.jsx)(n.a,{href:"https://developer.chrome.com/docs/devtools/overview/",children:"development tools"})," if you plan to do frontend development."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"running-a-backend-server",children:"Running a Backend Server"}),"\n",(0,t.jsx)(n.p,{children:"If the code you want to develop is the cmd-tlm-api or script-runner-api backend servers there are several steps to enable access to a development copy."}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a development version of traefik. COSMOS uses traefik to direct API requests to the correct locations."}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-traefik\nopenc3-traefik % docker ps\n# Look for the container with name including traefik\nopenc3-traefik % docker stop cosmos-openc3-traefik-1\nopenc3-traefik % docker build --build-arg TRAEFIK_CONFIG=traefik-dev.yaml -t openc3-traefik-dev .\nopenc3-traefik % docker run --network=openc3-cosmos-network -p 2900:2900 -it --rm openc3-traefik-dev\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsx)(n.li,{children:"Run a local copy of the cmd-tlm-api or script-runner-api"}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"% cd openc3-cosmos-cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker ps\n# Look for the container with name including cmd-tlm-api\nopenc3-cosmos-cmd-tlm-api % docker stop cosmos-openc3-cosmos-cmd-tlm-api-1\n# Run the following on Windows:\nopenc3-cosmos-cmd-tlm-api> dev_server.bat\n# In Linux, set all the environment variables in the .env file, but override REDIS to be local\nopenc3-cosmos-cmd-tlm-api % set -a; source ../.env; set +a\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % export OPENC3_REDIS_EPHEMERAL_HOSTNAME=127.0.0.1\nopenc3-cosmos-cmd-tlm-api % bundle install\nopenc3-cosmos-cmd-tlm-api % bundle exec rails s\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Once the ",(0,t.jsx)(n.code,{children:"bundle exec rails s"})," command returns you should see API requests coming from interactions in the frontend code. If you add code (like Ruby debugging statements) to the cmd-tlm-api code you need to stop the server (CTRL-C) and restart it to see the effect."]}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},5395:function(e,n,o){o.d(n,{R:()=>c,x:()=>r});var s=o(7140);let t={},i=s.createContext(t);function c(e){let n=s.useContext(i);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:c(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4752"],{
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["4752"],{1960:function(e,t,s){s.r(t),s.d(t,{metadata:()=>i,default:()=>a,frontMatter:()=>d,contentTitle:()=>c,toc:()=>o,assets:()=>l});var i=JSON.parse('{"id":"meta/vulnerabilities","title":"Security Vulnerabilities","description":"Known security vulnerabilities and issues","source":"@site/docs/meta/vulnerabilities.md","sourceDirName":"meta","slug":"/meta/vulnerabilities","permalink":"/tools/staticdocs/docs/meta/vulnerabilities","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/meta/vulnerabilities.md","tags":[],"version":"current","frontMatter":{"title":"Security Vulnerabilities","description":"Known security vulnerabilities and issues","sidebar_custom_props":{"myEmoji":"\u{1F6E1}\uFE0F"}},"sidebar":"defaultSidebar","previous":{"title":"Philosophy","permalink":"/tools/staticdocs/docs/meta/philosophy"},"next":{"title":"XTCE Support","permalink":"/tools/staticdocs/docs/meta/xtce"}}'),n=s(5656),r=s(5395);let d={title:"Security Vulnerabilities",description:"Known security vulnerabilities and issues",sidebar_custom_props:{myEmoji:"\u{1F6E1}\uFE0F"}},c,l={},o=[{value:"Patched",id:"patched",level:2},{value:"Open",id:"open",level:2}];function h(e){let t={a:"a",code:"code",h2:"h2",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(t.p,{children:["Below is a list of CVEs reported in COSMOS. This does not include CVEs in our dependencies - you can find those in our ",(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/actions/workflows/post_release_trivy.yml",children:"Trivy scans"}),"."]}),"\n",(0,n.jsx)(t.h2,{id:"patched",children:"Patched"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"CVE"}),(0,n.jsx)(t.th,{children:"Patched Version"}),(0,n.jsx)(t.th,{children:"Affected Editions"}),(0,n.jsx)(t.th,{children:"Description"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2024-43795",children:"CVE-2024-43795"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v5.19.0",children:"5.19.0"})}),(0,n.jsx)(t.td,{children:"Core only"}),(0,n.jsx)(t.td,{children:"XSS exploit in login screen"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2024-46977",children:"CVE-2024-46977"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v5.19.0",children:"5.19.0"})}),(0,n.jsx)(t.td,{children:"Core & Enterprise"}),(0,n.jsxs)(t.td,{children:["Path traversal for .txt files via LocalMode's ",(0,n.jsx)(t.code,{children:"open_local_file"})," function"]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2024-47529",children:"CVE-2024-47529"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v5.19.0",children:"5.19.0"})}),(0,n.jsx)(t.td,{children:"Core only"}),(0,n.jsx)(t.td,{children:"Plaintext storage of password in browser LocalStorage"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28380",children:"CVE-2025-28380"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v6.0.2",children:"6.0.2"})}),(0,n.jsx)(t.td,{children:"Core & Enterprise"}),(0,n.jsx)(t.td,{children:"XSS exploit via crafted URLs to the Documentation Tool or via stored screens with the IFRAME widget in Telemetry Viewer"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28381",children:"CVE-2025-28381"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v6.0.2",children:"6.0.2"})}),(0,n.jsx)(t.td,{children:"Core & Enterprise"}),(0,n.jsx)(t.td,{children:"Certain Docker credentials were leaked through environment variables, readable by authenticated users in Script Runner"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28382",children:"CVE-2025-28382"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v6.1.0",children:"6.1.0"})}),(0,n.jsx)(t.td,{children:"Core & Enterprise"}),(0,n.jsx)(t.td,{children:"Arbitrary file read/copy/delete via the Table Manager API"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28384",children:"CVE-2025-28384"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v6.1.0",children:"6.1.0"})}),(0,n.jsx)(t.td,{children:"Core & Enterprise"}),(0,n.jsx)(t.td,{children:"Arbitrary file read via the Script Runner API"})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28388",children:"CVE-2025-28388"})}),(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/releases/tag/v6.0.2",children:"6.0.2"})}),(0,n.jsx)(t.td,{children:"Core only"}),(0,n.jsx)(t.td,{children:"Hardcoded credentials for the service account (used by running scripts to access the API - no admin permissions)"})]})]})]}),"\n",(0,n.jsx)(t.h2,{id:"open",children:"Open"}),"\n",(0,n.jsxs)(t.table,{children:[(0,n.jsx)(t.thead,{children:(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.th,{children:"CVE"}),(0,n.jsx)(t.th,{children:"Affected Editions"}),(0,n.jsx)(t.th,{children:"Description"}),(0,n.jsx)(t.th,{children:"Why is it still open?"})]})}),(0,n.jsxs)(t.tbody,{children:[(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28386",children:"CVE-2025-28386"})}),(0,n.jsx)(t.td,{children:"Core & Enterprise"}),(0,n.jsx)(t.td,{children:"RCE via installing a plugin"}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.strong,{children:"Won't fix:"})," this is inherent to the functionality of plugins - if plugins couldn't execute code, you couldn't customize COSMOS. Only authenticated users can load code for execution, and in Enterprise that user must have admin permissions."]})]}),(0,n.jsxs)(t.tr,{children:[(0,n.jsx)(t.td,{children:(0,n.jsx)(t.a,{href:"https://nvd.nist.gov/vuln/detail/cve-2025-28389",children:"CVE-2025-28389"})}),(0,n.jsx)(t.td,{children:"Core only"}),(0,n.jsx)(t.td,{children:"API accepts plaintext passwords for authentication"}),(0,n.jsxs)(t.td,{children:[(0,n.jsx)(t.strong,{children:"Breaking change:"})," some users depend on this functionality in our API. Anticipate a patch in COSMOS v7.0 (",(0,n.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/issues/2461",children:"GitHub issue"}),"). Note that exploiting this vulnerability still requires brute-forcing the password; it is just generally easier to brute force a plaintext password than a token or hash with the use of dictionary tools."]})]})]})]})]})}function a(e={}){let{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},5395:function(e,t,s){s.d(t,{R:()=>d,x:()=>c});var i=s(7140);let n={},r=i.createContext(n);function d(e){let t=i.useContext(r);return i.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(n):e.components||n:d(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1873"],{
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1873"],{4960:function(e,t,n){n.r(t),n.d(t,{metadata:()=>s,default:()=>m,frontMatter:()=>i,contentTitle:()=>o,toc:()=>r,assets:()=>c});var s=JSON.parse('{"id":"tools/cmd-sender","title":"Command Sender","description":"Send individual commands","source":"@site/docs/tools/cmd-sender.md","sourceDirName":"tools","slug":"/tools/cmd-sender","permalink":"/tools/staticdocs/docs/tools/cmd-sender","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/cmd-sender.md","tags":[],"version":"current","frontMatter":{"title":"Command Sender","description":"Send individual commands","sidebar_custom_props":{"myEmoji":"\u{1F4E2}"}},"sidebar":"defaultSidebar","previous":{"title":"Calendar (Enterprise)","permalink":"/tools/staticdocs/docs/tools/calendar"},"next":{"title":"Command and Telemetry Server","permalink":"/tools/staticdocs/docs/tools/cmd-tlm-server"}}'),a=n(5656),d=n(5395);let i={title:"Command Sender",description:"Send individual commands",sidebar_custom_props:{myEmoji:"\u{1F4E2}"}},o,c={},r=[{value:"Introduction",id:"introduction",level:2},{value:"Command Sender Menus",id:"command-sender-menus",level:2},{value:"Mode Menu Items",id:"mode-menu-items",level:3},{value:"Sending Commands",id:"sending-commands",level:2},{value:"Hazardous Commands",id:"hazardous-commands",level:3}];function l(e){let t={a:"a",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",ul:"ul",...(0,d.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.h2,{id:"introduction",children:"Introduction"}),"\n",(0,a.jsx)(t.p,{children:"Command Sender provides the ability to send any command defined by COSMOS. Commands are selected using the Target and Packet drop down fields which populate the command parameter (if any). A command history is stored which is also editable. Commands in the command history can be re-executed by pressing Enter. Related telemetry or screens are displayed in the bottom right next to the command history."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"Command Sender",src:n(3302).A+"",width:"2578",height:"1436"})}),"\n",(0,a.jsx)(t.h2,{id:"command-sender-menus",children:"Command Sender Menus"}),"\n",(0,a.jsx)(t.h3,{id:"mode-menu-items",children:"Mode Menu Items"}),"\n",(0,a.jsx)("img",{src:n(9546).A,alt:"Mode Menu",style:{float:"left","margin-right":"50px",height:"120px"}}),"\n",(0,a.jsxs)(t.ul,{children:["\n",(0,a.jsx)(t.li,{children:"Ignores parameter range checking"}),"\n",(0,a.jsx)(t.li,{children:"Displays parameter state values in hex"}),"\n",(0,a.jsx)(t.li,{children:"Shows ignored parameters"}),"\n",(0,a.jsx)(t.li,{children:"Disables all parameter conversions"}),"\n"]}),"\n",(0,a.jsx)(t.h2,{id:"sending-commands",children:"Sending Commands"}),"\n",(0,a.jsx)(t.p,{children:"Select a command by first selecting the target from the Select Target drop down. Changing the target automatically updates the Select Packet options to only display commands from that target. If the command has parameters a table is generated with all the parameters."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"INST COLLECT",src:n(7856).A+"",width:"2576",height:"1446"})}),"\n",(0,a.jsx)(t.p,{children:"Clicking on a parameter with States (like TYPE in the above example) brings up a drop down to select a state. Selecting a state populates the value field next to it. Sending a command updates the Status text and the Command History."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"States",src:n(9040).A+"",width:"2576",height:"1446"})}),"\n",(0,a.jsx)(t.p,{children:"You can directly edit the Command History to change a parameter value. Pressing Enter on the line will then execute the command. If the command has changed a new line will be entered in the Command History. Pressing Enter several times on the same line updates the Status text with the number of commands sent (3 in the next example)."}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"History",src:n(1931).A+"",width:"2576",height:"1446"})}),"\n",(0,a.jsx)(t.h3,{id:"hazardous-commands",children:"Hazardous Commands"}),"\n",(0,a.jsxs)(t.p,{children:["Sending ",(0,a.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#hazardous",children:"hazardous"})," commands will prompt the user whether to send the command."]}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"INST CLEAR",src:n(2229).A+"",width:"2576",height:"1512"})}),"\n",(0,a.jsxs)(t.p,{children:["Commands can also have hazardous ",(0,a.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#state",children:"states"})," (INST COLLECT with TYPE SPECIAL) which also prompt the user. In this example, we've also checked all the menu options to show ignored parameters, display state values in hex (see SPECIAL, 0x1), disabled range checking (DURATION 1000), and disabled parameter conversions."]}),"\n",(0,a.jsx)(t.p,{children:(0,a.jsx)(t.img,{alt:"INST COLLECT Hazardous",src:n(6214).A+"",width:"2632",height:"2016"})}),"\n",(0,a.jsxs)(t.p,{children:["Selecting Yes will send the command and update the history with all the parameters shown. Note that when writing Scripts all parameters are optional unless explicitly marked ",(0,a.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/command#required",children:"required"}),"."]})]})}function m(e={}){let{wrapper:t}={...(0,d.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(l,{...e})}):l(e)}},9546:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/mode_menu-04b9187b57a09ed12481a2699a86c7504fdc1c822579b4f762865ea90cb52dd3.png"},9040:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/collect_states-5418d5b4cb901577f2cbdeccceb254dd2e5b81b1f2c975fb15b5fc679cf23dbf.png"},3302:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/command_sender-83cf2e2343133c2883c405abd0b322f6d3d4a095c6ee800158a04c8eefe474ed.png"},1931:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/history-04aebef1a0fdaaacc5042e5b835f850b48ea04f4fe50271d9bb57803b442d6cd.png"},2229:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/inst_clear-48f37464d774363be4a5c1d30a48d4bc7803cb806a15d80dcd3741d7a9a37811.png"},7856:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/inst_collect-ef36e8a1e97fde625cde7a9c300c3db61aca30140f5431f089ce6a3e5da9d7f4.png"},6214:function(e,t,n){n.d(t,{A:()=>s});let s=n.p+"assets/images/inst_collect_hazardous-02857bda2b5e7e821d3f42d3301962ede2bb4379c469a9d62f4a0e686336f0c4.png"},5395:function(e,t,n){n.d(t,{R:()=>i,x:()=>o});var s=n(7140);let a={},d=s.createContext(a);function i(e){let t=s.useContext(d);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),s.createElement(d.Provider,{value:t},e.children)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5196"],{
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5196"],{9407:function(t,o,e){e.r(o),e.d(o,{metadata:()=>n,default:()=>m,frontMatter:()=>i,contentTitle:()=>r,toc:()=>d,assets:()=>c});var n=JSON.parse('{"id":"tools/handbooks","title":"Handbooks","description":"Format the command and telemetry definition into a webpage","source":"@site/docs/tools/handbooks.md","sourceDirName":"tools","slug":"/tools/handbooks","permalink":"/tools/staticdocs/docs/tools/handbooks","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/tools/handbooks.md","tags":[],"version":"current","frontMatter":{"title":"Handbooks","description":"Format the command and telemetry definition into a webpage","sidebar_custom_props":{"myEmoji":"\u{1F4D6}"}},"sidebar":"defaultSidebar","previous":{"title":"Data Viewer","permalink":"/tools/staticdocs/docs/tools/data-viewer"},"next":{"title":"Limits Monitor","permalink":"/tools/staticdocs/docs/tools/limits-monitor"}}'),s=e(5656),a=e(5395);let i={title:"Handbooks",description:"Format the command and telemetry definition into a webpage",sidebar_custom_props:{myEmoji:"\u{1F4D6}"}},r,c={},d=[{value:"Introduction",id:"introduction",level:2}];function l(t){let o={a:"a",h2:"h2",img:"img",p:"p",...(0,a.R)(),...t.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsxs)(o.p,{children:["Handbooks formats the COSMOS ",(0,s.jsx)(o.a,{href:"/tools/staticdocs/docs/configuration/command",children:"command"})," and ",(0,s.jsx)(o.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"telemetry"})," definitions into a nicely formatted webpage that can be exported to a PDF."]}),"\n",(0,s.jsx)(o.p,{children:(0,s.jsx)(o.img,{alt:"Handbooks",src:e(6110).A+"",width:"1270",height:"710"})}),"\n",(0,s.jsx)(o.p,{children:"You can select the targets you want to display and the number of columns to display on the page. You can then use the browser to Print the page. Most browsers have the capability to Save as PDF rather than print to save the resulting page as PDF."})]})}function m(t={}){let{wrapper:o}={...(0,a.R)(),...t.components};return o?(0,s.jsx)(o,{...t,children:(0,s.jsx)(l,{...t})}):l(t)}},6110:function(t,o,e){e.d(o,{A:()=>n});let n=e.p+"assets/images/handbooks-948da6f5aad7a4175441235f2aac82668f9233c60412e412439b2e2af0bd1a45.png"},5395:function(t,o,e){e.d(o,{R:()=>i,x:()=>r});var n=e(7140);let s={},a=n.createContext(s);function i(t){let o=n.useContext(a);return n.useMemo(function(){return"function"==typeof t?t(o):{...o,...t}},[o,t])}function r(t){let o;return o=t.disableParentContext?"function"==typeof t.components?t.components(s):t.components||s:i(t.components),n.createElement(a.Provider,{value:o},t.children)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["1548"],{1428:function(e,o,s){s.r(o),s.d(o,{metadata:()=>n,default:()=>h,frontMatter:()=>r,contentTitle:()=>c,toc:()=>d,assets:()=>l});var n=JSON.parse('{"id":"guides/troubleshooting","title":"Troubleshooting","description":"How to solve various issues we\'ve encountered","source":"@site/docs/guides/troubleshooting.md","sourceDirName":"guides","slug":"/guides/troubleshooting","permalink":"/tools/staticdocs/docs/guides/troubleshooting","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/troubleshooting.md","tags":[],"version":"current","frontMatter":{"title":"Troubleshooting","description":"How to solve various issues we\'ve encountered","sidebar_custom_props":{"myEmoji":"\u{1F914}"}},"sidebar":"defaultSidebar","previous":{"title":"Scripting API Guide","permalink":"/tools/staticdocs/docs/guides/scripting-api"},"next":{"title":"Development","permalink":"/tools/staticdocs/docs/development"}}'),t=s(5656),i=s(5395);let r={title:"Troubleshooting",description:"How to solve various issues we've encountered",sidebar_custom_props:{myEmoji:"\u{1F914}"}},c,l={},d=[];function a(e){let o={a:"a",code:"code",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.p,{children:["We've seen a number of issues deploying COSMOS via Docker in various types of installations from single server to the cloud. This page captures some of the subtle issues we've discovered and ways to solve the problem. NOTE: Don't forget to also search our ",(0,t.jsx)(o.a,{href:"https://github.com/OpenC3/cosmos/issues",children:"Github Issues"})," (hit '/' and start typing)."]}),"\n",(0,t.jsxs)(o.ol,{children:["\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:'After dozens of installed targets and interfaces, the CmdTlmServer logs indicate "unable to create thread". Microservices are crashing or not starting.'}),"\n",(0,t.jsxs)(o.p,{children:["This is typically due to hard limits on processes or file handles imposed by Linux. If you're on Podman, ensure you've followed the directions from the ",(0,t.jsx)(o.a,{href:"/docs/getting-started/podman",children:"Podman"})," page and have increased the ",(0,t.jsx)(o.code,{children:"pids_limit"})," in ",(0,t.jsx)(o.code,{children:"/etc/containers/containers.conf"}),". Also check your ",(0,t.jsx)(o.code,{children:"ulimit"})," variables by typing ",(0,t.jsx)(o.code,{children:"ulimit -a"})," and increase your file descriptors (",(0,t.jsx)(o.code,{children:"ulimit -t 65536"}),")."]}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:"COSMOS becomes slow or unresponsive especially as additional plugins are added"}),"\n",(0,t.jsxs)(o.p,{children:["You may be maxing out your system. If you're on Enterprise you can check the ",(0,t.jsx)(o.a,{href:"/docs/tools/systemhealth",children:"System Health Tool"}),". Exec into the operator container (runs all the microservices) and see what the utilization is. NOTE: The container name may be different but you find it with ",(0,t.jsx)(o.code,{children:"docker ps"}),"."]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-bash",children:"docker ps\ndocker exec -it cosmos-openc3-operator-1 sh\n$ htop\n"})}),"\n",(0,t.jsx)(o.p,{children:"Check your memory utilization and CPU utilization. Is a single core pegged? You may need to distribute your workload better."}),"\n",(0,t.jsx)(o.p,{children:"If you're running Docker Desktop (Windows or Mac OS) you can update the Settings / Resources to add additional CPUs or Memory."}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:'You\'re getting "too many files open" errors'}),"\n",(0,t.jsxs)(o.p,{children:["Check your ",(0,t.jsx)(o.code,{children:"ulimit"})," variables by typing ",(0,t.jsx)(o.code,{children:"ulimit -a"})," and increase your file descriptors ",(0,t.jsx)(o.code,{children:"ulimit -t 65536"}),". Note that you may want to put this in your ",(0,t.jsx)(o.code,{children:".bashrc"}),", ",(0,t.jsx)(o.code,{children:".zshrc"}),", etc to make this permanent."]}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:"You get networking errors (without certificates)"}),"\n",(0,t.jsxs)(o.p,{children:["Make sure you're using ",(0,t.jsx)(o.code,{children:"127.0.0.1"})," instead of ",(0,t.jsx)(o.code,{children:"localhost"}),". Sometimes we've seen ",(0,t.jsx)(o.code,{children:"localhost"})," get mapped to ",(0,t.jsx)(o.code,{children:"::1"})," (IPV6) instead of ",(0,t.jsx)(o.code,{children:"127.0.0.1"})," (IPV4) which typically breaks things."]}),"\n",(0,t.jsxs)(o.p,{children:["Check your ",(0,t.jsx)(o.code,{children:"/etc/resolve.conf"})," and make sure you don't have any ",(0,t.jsx)(o.code,{children:"search"})," entries. You should have simple ",(0,t.jsx)(o.code,{children:"nameserver"})," entries."]}),"\n",(0,t.jsxs)(o.p,{children:["If you're on RHEL 9.x with rootless Podman make sure you've followed the directions from the ",(0,t.jsx)(o.a,{href:"/docs/getting-started/podman",children:"Podman"})," page and have configured Podman to use Netavark for DNS."]}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:"You've enabled certificates and you're getting networking errors"}),"\n",(0,t.jsxs)(o.p,{children:["Make sure you've read both the ",(0,t.jsx)(o.a,{href:"/docs/configuration/ssl-tls",children:"SSL-TLS"})," docs and the ",(0,t.jsx)(o.a,{href:"https://github.com/OpenC3/cosmos-enterprise-project?tab=readme-ov-file#opening-to-the-network",children:"COSMOS Enterprise Project"})," instructions."]}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:"You're getting 404 errors, missing icons, missing tools or functionality"}),"\n",(0,t.jsxs)(o.p,{children:["This is typically because the init container did not finish successfully. First examine the docker logs. NOTE: The container name maybe different but you find it with ",(0,t.jsx)(o.code,{children:"docker ps -a"}),"."]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-bash",children:"docker ps -a\ndocker logs cosmos-openc3-cosmos-init-1\n"})}),"\n",(0,t.jsxs)(o.p,{children:["Next ensure the files are actually present by execing into the operator container and checking. NOTE: The container name may be different but you find it with ",(0,t.jsx)(o.code,{children:"docker ps"}),"."]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-bash",children:"docker ps\ndocker exec -it cosmos-openc3-operator-1 sh\n$ cd /gems/gems/\n$ ls\n$ cd openc3-tool-base-6.6.1.pre.beta0.20250718002117/tools/base\n$ ls\n"})}),"\n",(0,t.jsxs)(o.p,{children:["In the above example we're making sure the tools/base files are there. You can ",(0,t.jsx)(o.code,{children:"cd"})," into any of the tools and ensure the files are present."]}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:'On Windows, when using bind mounts in Docker compose, the system "locks up" and screens show "TooManyRequests" error'}),"\n",(0,t.jsx)(o.p,{children:"We've seen this on old versions of Docker Desktop when using bind mounts instead of named volumes. Our docker compose files use named volumes by default so be careful with bind mounts. We also recommend upgrading Docker Desktop and WLS2 if possible as this maybe OBE in newer versions of Docker Desktop / WSL2."}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsxs)(o.p,{children:["When exposing COSMOS to the network through http, Chrome ",(0,t.jsx)(o.a,{href:"https://developer.chrome.com/docs/devtools/open",children:"DevTools"}),' shows "Web crypto API is not available".']}),"\n",(0,t.jsxs)(o.p,{children:["Make sure to follow all the instructions in the ",(0,t.jsx)(o.a,{href:"https://github.com/OpenC3/cosmos-enterprise-project/blob/main/README.md",children:"COSMOS Enterprise Project README"}),". In this case you need to do the following:"]}),"\n",(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsx)(o.li,{children:"In Chrome go to: chrome://flags/#unsafely-treat-insecure-origin-as-secure"}),"\n",(0,t.jsx)(o.li,{children:"For Edge to to: edge://flags/#unsafely-treat-insecure-origin-as-secure"}),"\n",(0,t.jsx)(o.li,{children:"Add your http://<Your IP Address>:2900"}),"\n",(0,t.jsx)(o.li,{children:"Enable the Setting"}),"\n",(0,t.jsx)(o.li,{children:"Completely restart Chrome. On MacOS make sure the dot below the icon in chrome is gone by long pressing the icon and choosing Quit."}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(o.li,{children:["\n",(0,t.jsx)(o.p,{children:'When using your own certs, you see an error banner with "Token is invalid" with "Failed to open TCP connection to <KEYCLOAK URL> (execution expired)".'}),"\n",(0,t.jsxs)(o.p,{children:["We have seen this when a local firewall is blocking the 443 port to Keycloak. Keycloak itself can still be reachable at ",(0,t.jsx)(o.code,{children:"<KEYCLOAK URL>/auth"})," which makes it feel like this is not a firewall issue. However, if you exec into the ",(0,t.jsx)(o.code,{children:"cmd-tlm-api"})," container you should be able to curl the following Keycloak URL:"]}),"\n",(0,t.jsx)(o.pre,{children:(0,t.jsx)(o.code,{className:"language-bash",children:"docker ps\ndocker exec -it <CONTAINER ID FOR CMD_TLM_API> sh\n$ ping <KEYCLOAK URL>\n$ curl -vvv <KEYCLOAK URL>/realms/openc3/protocol/openid-connect/certs\n"})}),"\n",(0,t.jsx)(o.p,{children:"If this does not return you could be blocking the 443 port to Keycloak. Update your firewall settings and try again."}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(o.p,{children:["Encountering an issue not on this list? If you're a customer, please get in touch at ",(0,t.jsx)(o.a,{href:"mailto:support@openc3.com",children:"support@openc3.com"}),"."]})]})}function h(e={}){let{wrapper:o}={...(0,i.R)(),...e.components};return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},5395:function(e,o,s){s.d(o,{R:()=>r,x:()=>c});var n=s(7140);let t={},i=n.createContext(t);function r(e){let o=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function c(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),n.createElement(i.Provider,{value:o},e.children)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["6443"],{5798:function(e,t,s){s.r(t),s.d(t,{metadata:()=>n,default:()=>a,frontMatter:()=>l,contentTitle:()=>d,toc:()=>c,assets:()=>o});var n=JSON.parse('{"id":"guides/performance","title":"Performance","description":"Hardware requirements like memory and CPU","source":"@site/docs/guides/performance.md","sourceDirName":"guides","slug":"/guides/performance","permalink":"/tools/staticdocs/docs/guides/performance","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/performance.md","tags":[],"version":"current","frontMatter":{"title":"Performance","description":"Hardware requirements like memory and CPU","sidebar_custom_props":{"myEmoji":"\u{1F4CA}"}},"sidebar":"defaultSidebar","previous":{"title":"Monitoring","permalink":"/tools/staticdocs/docs/guides/monitoring"},"next":{"title":"Raspberry Pi","permalink":"/tools/staticdocs/docs/guides/raspberrypi"}}'),r=s(7259),i=s(9796);let l={title:"Performance",description:"Hardware requirements like memory and CPU",sidebar_custom_props:{myEmoji:"\u{1F4CA}"}},d="COSMOS Hardware Requirements",o={},c=[{value:"Memory",id:"memory",level:2},{value:"CPU",id:"cpu",level:2},{value:"Performance Comparison",id:"performance-comparison",level:2}];function h(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",section:"section",sup:"sup",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["The COSMOS architecture was created with scalability in mind. Our goal is to support an unlimited number of connections and use cloud technologies to scale. Only ",(0,r.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," supports Kubernetes and the various cloud platforms which allow this level of scalability. While true scalability is only achieved in COSMOS Enterprise, both Core and Enterprise have various levels of observability and configuration settings which can affect performance."]}),"\n",(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"cosmos-hardware-requirements",children:"COSMOS Hardware Requirements"})}),"\n",(0,r.jsx)(t.h2,{id:"memory",children:"Memory"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS can run on a Raspberry Pi up to a Kubernetes cluster in the cloud. On all platforms the key performance factor is the number and complexity of the targets and their defined packets. Targets can vary from simple targets taking 100 MB of RAM to complex targets taking 400 MB. The COSMOS Core containers require about 800 MB of RAM. A good rule of thumb is to average about 300 MB of RAM for targets. As an example data point, the COSMOS Demo has 4 targets, two complex (INST & INST2) and two relatively simple (EXAMPLE & TEMPLATED), and requires 800 MB of RAM (on top of the 800 MB of base container RAM)."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Base RAM MB Calculator = 800 + (num targets) * 300"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["In addition, the Redis streams contain the last 10 min of both raw and decommutated data from all targets. Thus you must wait ~15min to truly see what the high water memory mark will be. In the COSMOS Demo the INST & INST2 targets are fairly simple with four 1Hz packet of ~15 items and one 10Hz packet with 20 items. This only causes 50 MiB of redis RAM usage according to ",(0,r.jsx)(t.code,{children:"docker stats"}),". Installing the COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," with 10 packets with 1000 items each at 10Hz pushed the redis memory usage to about 350 MiB."]}),"\n",(0,r.jsx)(t.h2,{id:"cpu",children:"CPU"}),"\n",(0,r.jsx)(t.p,{children:"Another consideration is the CPU performance. In COSMOS Core, by default COSMOS spawns off 2 microservices per target. One combines packet logging and decommutation of the data and the other performs data reduction. In COSMOS Enterprise on Kubernetes, each process becomes an independent container that is deployed on the cluster allowing horizontal scaling."}),"\n",(0,r.jsxs)(t.p,{children:["The COSMOS command and telemetry API and script running API servers should have a dedicated core while targets can generally share cores. It's hard to provide a general rule of thumb with the wide variety of architectures, clock speeds, and core counts. The best practice is to install COSMOS with the expected load and do some monitoring with ",(0,r.jsx)(t.code,{children:"htop"})," to visualize the load on the various cores. Any time a single core gets overloaded (100%) this is a concern and system slowdown can occur."]}),"\n",(0,r.jsx)(t.h2,{id:"performance-comparison",children:"Performance Comparison"}),"\n",(0,r.jsxs)(t.p,{children:["Performance characterization was performed in Azure on a Standard D4s v5 (4 vcpus, 16 GiB memory) chosen to allow virtualization per ",(0,r.jsx)(t.a,{href:"https://docs.docker.com/desktop/vm-vdi/#turn-on-nested-virtualization-on-microsoft-hyper-v",children:"Docker"}),". COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise/releases/tag/v5.9.1",children:"5.9.1"})," Enterprise was installed on both Windows 11 Pro ",(0,r.jsx)(t.sup,{children:(0,r.jsx)(t.a,{href:"#user-content-fn-1",id:"user-content-fnref-1","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})})," and Ubuntu 22. Note: Enterprise was not utilizing Kubernetes, just Docker. Testing involved starting the COSMOS Demo, connecting all targets (EXAMPLE, INST, INST2, TEMPLATED), opening the following TlmViewer screens (ADCS, ARRAY, BLOCK, COMMANDING, HS, LATEST, LIMITS, OTHER, PARAMS, SIMPLE, TABS) and creating two TlmGrapher graphs consisting of INST HEALTH_STATUS TEMP[1-4] and INST ADCS POS[X,Y,Z] and INST ADCS VEL[X,Y,Z]. This was allowed to run for 1hr and results were collected using ",(0,r.jsx)(t.code,{children:"htop"}),":"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"12% 12% 10% 10%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.9G / 7.7G"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"7% 7% 8% 6%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.2G / 15.6G"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Windows was only allocated 8 GB of RAM due to the ",(0,r.jsx)(t.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig",children:".wslconfig"})," settings."]}),"\n",(0,r.jsx)(t.li,{children:"Since Ubuntu was running headless, the screens and graphs were brought up on another machine."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,r.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,r.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.16%"}),(0,r.jsx)(t.td,{children:"1.32%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"43.54MiB"}),(0,r.jsx)(t.td,{children:"51.38MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"10.16%"}),(0,r.jsx)(t.td,{children:"6.14%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"401.6MiB"}),(0,r.jsx)(t.td,{children:"392MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.17%"}),(0,r.jsx)(t.td,{children:"0.13%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"476.8MiB"}),(0,r.jsx)(t.td,{children:"476.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"21.27%"}),(0,r.jsx)(t.td,{children:"13.91%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.214GiB"}),(0,r.jsx)(t.td,{children:"1.207GiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"127.4MiB"}),(0,r.jsx)(t.td,{children:"117.1MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"105.2MiB"}),(0,r.jsx)(t.td,{children:"83.87MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.05%"}),(0,r.jsx)(t.td,{children:"1.89%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"46.22MiB"}),(0,r.jsx)(t.td,{children:"69.84MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.56%"}),(0,r.jsx)(t.td,{children:"0.72%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"12.82MiB"}),(0,r.jsx)(t.td,{children:"9.484MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"152.9MiB"}),(0,r.jsx)(t.td,{children:"169.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,r.jsx)(t.td,{children:"0.39%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"37.33MiB"}),(0,r.jsx)(t.td,{children:"41.02MiB"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,r.jsx)(t.li,{children:"redis-ephemeral isn't using much memory on the Core Demo with its small packets"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["At this point the COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," was installed with default settings which creates 10 packets with 1000 items each at 10Hz (110kB/s). After a 1 hr soak, htop now indicated:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"40% 35% 39% 42%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.64G / 7.7G"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"17% 20% 16% 18%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.74G / 15.6G"})]})]})]}),"\n",(0,r.jsx)(t.p,{children:"The larger packets and data rate of the LoadSim target caused both platforms to dramatically increase CPU utilization but the Linux machine stays quite performant."}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,r.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,r.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.09%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"44.3MiB"}),(0,r.jsx)(t.td,{children:"0.34MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"17.78%"}),(0,r.jsx)(t.td,{children:"6.18%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"407.9MiB"}),(0,r.jsx)(t.td,{children:"405.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.20%"}),(0,r.jsx)(t.td,{children:"0.12%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"480.2MiB"}),(0,r.jsx)(t.td,{children:"481.5MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"221.15%"}),(0,r.jsx)(t.td,{children:"66.72%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.6GiB"}),(0,r.jsx)(t.td,{children:"1.512GiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"136.6MiB"}),(0,r.jsx)(t.td,{children:"127.5MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"106.3MiB"}),(0,r.jsx)(t.td,{children:"84.87MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"19.63%"}),(0,r.jsx)(t.td,{children:"3.91%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"333.8MiB"}),(0,r.jsx)(t.td,{children:"370.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"7.42%"}),(0,r.jsx)(t.td,{children:"1.49%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"15.87MiB"}),(0,r.jsx)(t.td,{children:"11.81MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.10%"}),(0,r.jsx)(t.td,{children:"0.02%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"167.8MiB"}),(0,r.jsx)(t.td,{children:"179.2MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"35.4MiB"}),(0,r.jsx)(t.td,{children:"42.93MiB"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,r.jsx)(t.li,{children:"redis-ephemeral is now using much more RAM as it is storing the large LoadSim packets"}),"\n",(0,r.jsx)(t.li,{children:"Windows is using much more CPU power running the operator, cmd-tlm, and redis"}),"\n"]}),"\n",(0,r.jsx)(t.h1,{id:"conclusions",children:"Conclusions"}),"\n",(0,r.jsxs)(t.p,{children:["While it is easy to run COSMOS on any Docker platform, increasing the number and complexity of the targets requires choosing the correct hardware. Sizing can be approximated but the best solution is to install representative targets and use ",(0,r.jsx)(t.code,{children:"docker stats"})," and ",(0,r.jsx)(t.code,{children:"htop"})," to judge the CPU and memory pressure on the given hardware."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," on Kubernetes helps to eliminate the hardware sizing issue by scaling the cluster to meet the needs of the system. Check out ",(0,r.jsx)(t.a,{href:"https://openc3.com/news/scaling",children:"this recent talk"})," Ryan gave at GSAW showing how we scaled to over 160 satellites on a 4 node kubernetes cluster on EKS."]}),"\n",(0,r.jsx)("hr",{}),"\n","\n",(0,r.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,r.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{id:"user-content-fn-1",children:["\n",(0,r.jsx)(t.p,{children:"Full specs of the Windows Platform:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:"Windows 11 Pro\nDocker Desktop 4.22.0\nWSL version: 1.2.5.0\nKernel version: 5.15.90.1\nWSLg version: 1.0.51\nMSRDC version: 1.2.3770\nDirect3D version: 1.608.2-61064218\nDXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp\nWindows version: 10.0.22621.2134\n"})}),"\n",(0,r.jsx)(t.a,{href:"#user-content-fnref-1","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21A9"}),"\n"]}),"\n"]}),"\n"]})]})}function a(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},9796:function(e,t,s){s.d(t,{R:()=>l,x:()=>d});var n=s(6363);let r={},i=n.createContext(r);function l(e){let t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["6443"],{1765:function(e,t,s){s.r(t),s.d(t,{metadata:()=>n,default:()=>a,frontMatter:()=>l,contentTitle:()=>d,toc:()=>c,assets:()=>o});var n=JSON.parse('{"id":"guides/performance","title":"Performance","description":"Hardware requirements like memory and CPU","source":"@site/docs/guides/performance.md","sourceDirName":"guides","slug":"/guides/performance","permalink":"/tools/staticdocs/docs/guides/performance","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/guides/performance.md","tags":[],"version":"current","frontMatter":{"title":"Performance","description":"Hardware requirements like memory and CPU","sidebar_custom_props":{"myEmoji":"\u{1F4CA}"}},"sidebar":"defaultSidebar","previous":{"title":"Monitoring","permalink":"/tools/staticdocs/docs/guides/monitoring"},"next":{"title":"Raspberry Pi","permalink":"/tools/staticdocs/docs/guides/raspberrypi"}}'),r=s(5656),i=s(5395);let l={title:"Performance",description:"Hardware requirements like memory and CPU",sidebar_custom_props:{myEmoji:"\u{1F4CA}"}},d="COSMOS Hardware Requirements",o={},c=[{value:"Memory",id:"memory",level:2},{value:"CPU",id:"cpu",level:2},{value:"Performance Comparison",id:"performance-comparison",level:2}];function h(e){let t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",section:"section",sup:"sup",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["The COSMOS architecture was created with scalability in mind. Our goal is to support an unlimited number of connections and use cloud technologies to scale. Only ",(0,r.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," supports Kubernetes and the various cloud platforms which allow this level of scalability. While true scalability is only achieved in COSMOS Enterprise, both Core and Enterprise have various levels of observability and configuration settings which can affect performance."]}),"\n",(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"cosmos-hardware-requirements",children:"COSMOS Hardware Requirements"})}),"\n",(0,r.jsx)(t.h2,{id:"memory",children:"Memory"}),"\n",(0,r.jsx)(t.p,{children:"COSMOS can run on a Raspberry Pi up to a Kubernetes cluster in the cloud. On all platforms the key performance factor is the number and complexity of the targets and their defined packets. Targets can vary from simple targets taking 100 MB of RAM to complex targets taking 400 MB. The COSMOS Core containers require about 800 MB of RAM. A good rule of thumb is to average about 300 MB of RAM for targets. As an example data point, the COSMOS Demo has 4 targets, two complex (INST & INST2) and two relatively simple (EXAMPLE & TEMPLATED), and requires 800 MB of RAM (on top of the 800 MB of base container RAM)."}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Base RAM MB Calculator = 800 + (num targets) * 300"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["In addition, the Redis streams contain the last 10 min of both raw and decommutated data from all targets. Thus you must wait ~15min to truly see what the high water memory mark will be. In the COSMOS Demo the INST & INST2 targets are fairly simple with four 1Hz packet of ~15 items and one 10Hz packet with 20 items. This only causes 50 MiB of redis RAM usage according to ",(0,r.jsx)(t.code,{children:"docker stats"}),". Installing the COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," with 10 packets with 1000 items each at 10Hz pushed the redis memory usage to about 350 MiB."]}),"\n",(0,r.jsx)(t.h2,{id:"cpu",children:"CPU"}),"\n",(0,r.jsx)(t.p,{children:"Another consideration is the CPU performance. In COSMOS Core, by default COSMOS spawns off 2 microservices per target. One combines packet logging and decommutation of the data and the other performs data reduction. In COSMOS Enterprise on Kubernetes, each process becomes an independent container that is deployed on the cluster allowing horizontal scaling."}),"\n",(0,r.jsxs)(t.p,{children:["The COSMOS command and telemetry API and script running API servers should have a dedicated core while targets can generally share cores. It's hard to provide a general rule of thumb with the wide variety of architectures, clock speeds, and core counts. The best practice is to install COSMOS with the expected load and do some monitoring with ",(0,r.jsx)(t.code,{children:"htop"})," to visualize the load on the various cores. Any time a single core gets overloaded (100%) this is a concern and system slowdown can occur."]}),"\n",(0,r.jsx)(t.h2,{id:"performance-comparison",children:"Performance Comparison"}),"\n",(0,r.jsxs)(t.p,{children:["Performance characterization was performed in Azure on a Standard D4s v5 (4 vcpus, 16 GiB memory) chosen to allow virtualization per ",(0,r.jsx)(t.a,{href:"https://docs.docker.com/desktop/vm-vdi/#turn-on-nested-virtualization-on-microsoft-hyper-v",children:"Docker"}),". COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos-enterprise/releases/tag/v5.9.1",children:"5.9.1"})," Enterprise was installed on both Windows 11 Pro ",(0,r.jsx)(t.sup,{children:(0,r.jsx)(t.a,{href:"#user-content-fn-1",id:"user-content-fnref-1","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})})," and Ubuntu 22. Note: Enterprise was not utilizing Kubernetes, just Docker. Testing involved starting the COSMOS Demo, connecting all targets (EXAMPLE, INST, INST2, TEMPLATED), opening the following TlmViewer screens (ADCS, ARRAY, BLOCK, COMMANDING, HS, LATEST, LIMITS, OTHER, PARAMS, SIMPLE, TABS) and creating two TlmGrapher graphs consisting of INST HEALTH_STATUS TEMP[1-4] and INST ADCS POS[X,Y,Z] and INST ADCS VEL[X,Y,Z]. This was allowed to run for 1hr and results were collected using ",(0,r.jsx)(t.code,{children:"htop"}),":"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"12% 12% 10% 10%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.9G / 7.7G"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"7% 7% 8% 6%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.2G / 15.6G"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Windows was only allocated 8 GB of RAM due to the ",(0,r.jsx)(t.a,{href:"https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig",children:".wslconfig"})," settings."]}),"\n",(0,r.jsx)(t.li,{children:"Since Ubuntu was running headless, the screens and graphs were brought up on another machine."}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,r.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,r.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.16%"}),(0,r.jsx)(t.td,{children:"1.32%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"43.54MiB"}),(0,r.jsx)(t.td,{children:"51.38MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"10.16%"}),(0,r.jsx)(t.td,{children:"6.14%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"401.6MiB"}),(0,r.jsx)(t.td,{children:"392MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.17%"}),(0,r.jsx)(t.td,{children:"0.13%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"476.8MiB"}),(0,r.jsx)(t.td,{children:"476.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"21.27%"}),(0,r.jsx)(t.td,{children:"13.91%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.214GiB"}),(0,r.jsx)(t.td,{children:"1.207GiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"127.4MiB"}),(0,r.jsx)(t.td,{children:"117.1MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"105.2MiB"}),(0,r.jsx)(t.td,{children:"83.87MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.05%"}),(0,r.jsx)(t.td,{children:"1.89%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"46.22MiB"}),(0,r.jsx)(t.td,{children:"69.84MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.56%"}),(0,r.jsx)(t.td,{children:"0.72%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"12.82MiB"}),(0,r.jsx)(t.td,{children:"9.484MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"152.9MiB"}),(0,r.jsx)(t.td,{children:"169.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,r.jsx)(t.td,{children:"0.39%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"37.33MiB"}),(0,r.jsx)(t.td,{children:"41.02MiB"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,r.jsx)(t.li,{children:"redis-ephemeral isn't using much memory on the Core Demo with its small packets"}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:["At this point the COSMOS ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/openc3-cosmos-load-sim",children:"LoadSim"})," was installed with default settings which creates 10 packets with 1000 items each at 10Hz (110kB/s). After a 1 hr soak, htop now indicated:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Platform"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Core CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"RAM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Windows 11 Pro"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"40% 35% 39% 42%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.64G / 7.7G"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"Headless Ubuntu 22"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"17% 20% 16% 18%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"3.74G / 15.6G"})]})]})]}),"\n",(0,r.jsx)(t.p,{children:"The larger packets and data rate of the LoadSim target caused both platforms to dramatically increase CPU utilization but the Linux machine stays quite performant."}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"docker stats"})," was also run to show individual container cpu and memory usage:"]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"NAME"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows CPU %"}),(0,r.jsx)(t.th,{children:"Ubuntu CPU %"}),(0,r.jsx)(t.th,{style:{textAlign:"left"},children:"Windows MEM"}),(0,r.jsx)(t.th,{children:"Ubuntu MEM"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-traefik-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"4.09%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"44.3MiB"}),(0,r.jsx)(t.td,{children:"0.34MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-cmd-tlm-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"17.78%"}),(0,r.jsx)(t.td,{children:"6.18%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"407.9MiB"}),(0,r.jsx)(t.td,{children:"405.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-keycloak-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.20%"}),(0,r.jsx)(t.td,{children:"0.12%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"480.2MiB"}),(0,r.jsx)(t.td,{children:"481.5MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-operator-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"221.15%"}),(0,r.jsx)(t.td,{children:"66.72%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"1.6GiB"}),(0,r.jsx)(t.td,{children:"1.512GiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-cosmos-script-runner-api-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"136.6MiB"}),(0,r.jsx)(t.td,{children:"127.5MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-metrics-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.01%"}),(0,r.jsx)(t.td,{children:"0.01%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"106.3MiB"}),(0,r.jsx)(t.td,{children:"84.87MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-ephemeral-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"19.63%"}),(0,r.jsx)(t.td,{children:"3.91%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"333.8MiB"}),(0,r.jsx)(t.td,{children:"370.8MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-redis-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"7.42%"}),(0,r.jsx)(t.td,{children:"1.49%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"15.87MiB"}),(0,r.jsx)(t.td,{children:"11.81MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-minio-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.10%"}),(0,r.jsx)(t.td,{children:"0.02%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"167.8MiB"}),(0,r.jsx)(t.td,{children:"179.2MiB"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"cosmos-enterprise-project-openc3-postgresql-1"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"0.00%"}),(0,r.jsx)(t.td,{children:"0.00%"}),(0,r.jsx)(t.td,{style:{textAlign:"left"},children:"35.4MiB"}),(0,r.jsx)(t.td,{children:"42.93MiB"})]})]})]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"memory profiles are similar between the two platforms"}),"\n",(0,r.jsx)(t.li,{children:"redis-ephemeral is now using much more RAM as it is storing the large LoadSim packets"}),"\n",(0,r.jsx)(t.li,{children:"Windows is using much more CPU power running the operator, cmd-tlm, and redis"}),"\n"]}),"\n",(0,r.jsx)(t.h1,{id:"conclusions",children:"Conclusions"}),"\n",(0,r.jsxs)(t.p,{children:["While it is easy to run COSMOS on any Docker platform, increasing the number and complexity of the targets requires choosing the correct hardware. Sizing can be approximated but the best solution is to install representative targets and use ",(0,r.jsx)(t.code,{children:"docker stats"})," and ",(0,r.jsx)(t.code,{children:"htop"})," to judge the CPU and memory pressure on the given hardware."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://openc3.com/enterprise",children:"COSMOS Enterprise"})," on Kubernetes helps to eliminate the hardware sizing issue by scaling the cluster to meet the needs of the system. Check out ",(0,r.jsx)(t.a,{href:"https://openc3.com/news/scaling",children:"this recent talk"})," Ryan gave at GSAW showing how we scaled to over 160 satellites on a 4 node kubernetes cluster on EKS."]}),"\n",(0,r.jsx)("hr",{}),"\n","\n",(0,r.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,r.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{id:"user-content-fn-1",children:["\n",(0,r.jsx)(t.p,{children:"Full specs of the Windows Platform:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:"Windows 11 Pro\nDocker Desktop 4.22.0\nWSL version: 1.2.5.0\nKernel version: 5.15.90.1\nWSLg version: 1.0.51\nMSRDC version: 1.2.3770\nDirect3D version: 1.608.2-61064218\nDXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp\nWindows version: 10.0.22621.2134\n"})}),"\n",(0,r.jsx)(t.a,{href:"#user-content-fnref-1","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21A9"}),"\n"]}),"\n"]}),"\n"]})]})}function a(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},5395:function(e,t,s){s.d(t,{R:()=>l,x:()=>d});var n=s(7140);let r={},i=n.createContext(r);function l(e){let t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["9074"],{7927:function(e,t,n){n.r(t),n.d(t,{default:()=>ea});var a=n(5656),i=n(7140),r=n(3526),o=n(8051),l=n(8464),s=n(1789),c=n(6552),d=n(8033),u=n(1151),m=n(3705);function b(){let{shown:e,scrollToTop:t}=function({threshold:e}){let[t,n]=(0,i.useState)(!1),a=(0,i.useRef)(!1),{startScroll:r,cancelScroll:o}=(0,u.gk)();return(0,u.Mq)(({scrollY:t},i)=>{let r=i?.scrollY;r&&(a.current?a.current=!1:t>=r?(o(),n(!1)):t<e?n(!1):t+window.innerHeight<document.documentElement.scrollHeight&&n(!0))}),(0,m.$)(e=>{e.location.hash&&(a.current=!0,n(!1))}),{shown:t,scrollToTop:()=>r(0)}}({threshold:300});return(0,a.jsx)("button",{"aria-label":(0,d.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,r.A)("clean-btn",l.G.common.backToTopButton,"backToTopButton_xm72",e&&"backToTopButtonShow_HdDQ"),type:"button",onClick:t})}var h=n(8840),p=n(559),x=n(8262),f=n(295),j=n(7375);function _(e){return(0,a.jsx)("svg",{width:"20",height:"20","aria-hidden":"true",...e,children:(0,a.jsxs)("g",{fill:"#7a7a7a",children:[(0,a.jsx)("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),(0,a.jsx)("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})]})})}function g({onClick:e}){return(0,a.jsx)("button",{type:"button",title:(0,d.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,d.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,r.A)("button button--secondary button--outline","collapseSidebarButton_ph74"),onClick:e,children:(0,a.jsx)(_,{className:"collapseSidebarButtonIcon_pPzV"})})}var A=n(9440),v=n(1093);let k=Symbol("EmptyContext"),C=i.createContext(k);function N({children:e}){let[t,n]=(0,i.useState)(null),r=(0,i.useMemo)(()=>({expandedItem:t,setExpandedItem:n}),[t]);return(0,a.jsx)(C.Provider,{value:r,children:e})}var S=n(6595),T=n(6114),y=n(2189),I=n(1252),L=n(867),w=n(1257);function E({label:e}){return(0,a.jsx)("span",{title:e,className:"linkLabel_OLaQ",children:e})}function M({item:e,onItemClick:t,activePath:n,level:i,index:o,...c}){let{href:d,label:u,className:m,autoAddBaseUrl:b}=e,h=(0,s.w8)(e,n),p=(0,L.A)(d);return(0,a.jsx)("li",{className:(0,r.A)(l.G.docs.docSidebarItemLink,l.G.docs.docSidebarItemLinkLevel(i),"menu__list-item",m),children:(0,a.jsxs)(y.A,{className:(0,r.A)("menu__link",!p&&"menuExternalLink_i5bT",{"menu__link--active":h}),autoAddBaseUrl:b,"aria-current":h?"page":void 0,to:d,...p&&{onClick:t?()=>t(e):void 0},...c,children:[(0,a.jsx)(E,{label:u}),!p&&(0,a.jsx)(w.A,{})]})},u)}function B({collapsed:e,categoryLabel:t,onClick:n}){return(0,a.jsx)("button",{"aria-label":e?(0,d.T)({id:"theme.DocSidebarItem.expandCategoryAriaLabel",message:"Expand sidebar category '{label}'",description:"The ARIA label to expand the sidebar category"},{label:t}):(0,d.T)({id:"theme.DocSidebarItem.collapseCategoryAriaLabel",message:"Collapse sidebar category '{label}'",description:"The ARIA label to collapse the sidebar category"},{label:t}),"aria-expanded":!e,type:"button",className:"clean-btn menu__caret",onClick:n})}function H({label:e}){return(0,a.jsx)("span",{title:e,className:"categoryLinkLabel_TqXL",children:e})}function G(e){return 0===(0,s.Y)(e.item.items,e.activePath).length?(0,a.jsx)(D,{...e}):(0,a.jsx)(P,{...e})}function D({item:e,...t}){if("string"!=typeof e.href)return null;let{type:n,collapsed:i,collapsible:r,items:o,linkUnlisted:l,...s}=e,c={type:"link",...s};return(0,a.jsx)(M,{item:c,...t})}function P({item:e,onItemClick:t,activePath:n,level:o,index:c,...d}){let u,{items:m,label:b,collapsible:h,className:p,href:x}=e,{docs:{sidebar:{autoCollapseCategories:j}}}=(0,f.p)(),_=(u=(0,I.A)(),(0,i.useMemo)(()=>e.href&&!e.linkUnlisted?e.href:!u&&e.collapsible?(0,s.Nr)(e):void 0,[e,u])),g=(0,s.w8)(e,n),A=(0,T.ys)(x,n),{collapsed:N,setCollapsed:L}=(0,S.u)({initialState:()=>!!h&&!g&&e.collapsed}),{expandedItem:w,setExpandedItem:E}=function(){let e=(0,i.useContext)(C);if(e===k)throw new v.dV("DocSidebarItemsExpandedStateProvider");return e}(),M=(e=!N)=>{E(e?null:c),L(e)};return!function({isActive:e,collapsed:t,updateCollapsed:n,activePath:a}){let r=(0,v.ZC)(e),o=(0,v.ZC)(a);(0,i.useEffect)(()=>{let i=e&&!r,l=e&&r&&a!==o;(i||l)&&t&&n(!1)},[e,r,t,n,a,o])}({isActive:g,collapsed:N,updateCollapsed:M,activePath:n}),(0,i.useEffect)(()=>{h&&null!=w&&w!==c&&j&&L(!0)},[h,w,c,L,j]),(0,a.jsxs)("li",{className:(0,r.A)(l.G.docs.docSidebarItemCategory,l.G.docs.docSidebarItemCategoryLevel(o),"menu__list-item",{"menu__list-item--collapsed":N},p),children:[(0,a.jsxs)("div",{className:(0,r.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":A}),children:[(0,a.jsx)(y.A,{className:(0,r.A)("categoryLink_ElYC","menu__link",{"menu__link--sublist":h,"menu__link--sublist-caret":!x&&h,"menu__link--active":g}),onClick:n=>{t?.(e),h&&(x?A?(n.preventDefault(),M()):M(!1):(n.preventDefault(),M()))},"aria-current":A?"page":void 0,role:h&&!x?"button":void 0,"aria-expanded":h&&!x?!N:void 0,href:h?_??"#":_,...d,children:(0,a.jsx)(H,{label:b})}),x&&h&&(0,a.jsx)(B,{collapsed:N,categoryLabel:b,onClick:e=>{e.preventDefault(),M()}})]}),(0,a.jsx)(S.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:N,children:(0,a.jsx)(V,{items:m,tabIndex:N?-1:0,onItemClick:t,activePath:n,level:o+1})})]})}function W({item:e,level:t,index:n}){let{value:i,defaultStyle:o,className:s}=e;return(0,a.jsx)("li",{className:(0,r.A)(l.G.docs.docSidebarItemLink,l.G.docs.docSidebarItemLinkLevel(t),o&&["menuHtmlItem_Dtp7","menu__list-item"],s),dangerouslySetInnerHTML:{__html:i}},n)}function R({item:e,...t}){switch(e.type){case"category":return(0,a.jsx)(G,{item:e,...t});case"html":return(0,a.jsx)(W,{item:e,...t});default:return(0,a.jsx)(M,{item:e,...t})}}let V=(0,i.memo)(function({items:e,...t}){let n=(0,s.Y)(e,t.activePath);return(0,a.jsx)(N,{children:n.map((e,n)=>(0,a.jsx)(R,{item:e,index:n,...t},n))})});function F({path:e,sidebar:t,className:n}){let o=function(){let{isActive:e}=(0,A.M)(),[t,n]=(0,i.useState)(e);return(0,u.Mq)(({scrollY:t})=>{e&&n(0===t)},[e]),e&&t}();return(0,a.jsx)("nav",{"aria-label":(0,d.T)({id:"theme.docs.sidebar.navAriaLabel",message:"Docs sidebar",description:"The ARIA label for the sidebar navigation"}),className:(0,r.A)("menu thin-scrollbar","menu_EL20",o&&"menuWithAnnouncementBar_kWme",n),children:(0,a.jsx)("ul",{className:(0,r.A)(l.G.docs.docSidebarMenu,"menu__list"),children:(0,a.jsx)(V,{items:t,activePath:e,level:1})})})}let Y=i.memo(function({path:e,sidebar:t,onCollapse:n,isHidden:i}){let{navbar:{hideOnScroll:o},docs:{sidebar:{hideable:l}}}=(0,f.p)();return(0,a.jsxs)("div",{className:(0,r.A)("sidebar_oy8c",o&&"sidebarWithHideableNavbar_DpMJ",i&&"sidebarHidden_GtqH"),children:[o&&(0,a.jsx)(j.A,{tabIndex:-1,className:"sidebarLogo_oZZN"}),(0,a.jsx)(F,{path:e,sidebar:t}),l&&(0,a.jsx)(g,{onClick:n})]})});var z=n(2541),q=n(5284);let O=({sidebar:e,path:t})=>{let n=(0,q.M)();return(0,a.jsx)("ul",{className:(0,r.A)(l.G.docs.docSidebarMenu,"menu__list"),children:(0,a.jsx)(V,{items:e,activePath:t,onItemClick:e=>{"category"===e.type&&e.href&&n.toggle(),"link"===e.type&&n.toggle()},level:1})})},Z=i.memo(function(e){return(0,a.jsx)(z.GX,{component:O,props:e})});function Q(e){let t=(0,x.l)();return(0,a.jsxs)(a.Fragment,{children:[("desktop"===t||"ssr"===t)&&(0,a.jsx)(Y,{...e}),"mobile"===t&&(0,a.jsx)(Z,{...e})]})}function U({toggleSidebar:e}){return(0,a.jsx)("div",{className:"expandButton_pYup",title:(0,d.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,d.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:e,onClick:e,children:(0,a.jsx)(_,{className:"expandButtonIcon_gGXt"})})}let X={docSidebarContainer:"docSidebarContainer_HmQ6",docSidebarContainerHidden:"docSidebarContainerHidden_OWg8",sidebarViewport:"sidebarViewport_DwNg"};function J({children:e}){let t=(0,c.t)();return(0,a.jsx)(i.Fragment,{children:e},t?.name??"noSidebar")}function K({sidebar:e,hiddenSidebarContainer:t,setHiddenSidebarContainer:n}){let{pathname:o}=(0,p.zy)(),[s,c]=(0,i.useState)(!1),d=(0,i.useCallback)(()=>{s&&c(!1),!s&&(0,h.O)()&&c(!0),n(e=>!e)},[n,s]);return(0,a.jsx)("aside",{className:(0,r.A)(l.G.docs.docSidebarContainer,X.docSidebarContainer,t&&X.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(X.docSidebarContainer)&&t&&c(!0)},children:(0,a.jsx)(J,{children:(0,a.jsxs)("div",{className:(0,r.A)(X.sidebarViewport,s&&X.sidebarViewportHidden),children:[(0,a.jsx)(Q,{sidebar:e,path:o,onCollapse:d,isHidden:s}),s&&(0,a.jsx)(U,{toggleSidebar:d})]})})})}let $={docMainContainer:"docMainContainer_Fwt6",docMainContainerEnhanced:"docMainContainerEnhanced_lV6m",docItemWrapperEnhanced:"docItemWrapperEnhanced_yS4x"};function ee({hiddenSidebarContainer:e,children:t}){let n=(0,c.t)();return(0,a.jsx)("main",{className:(0,r.A)($.docMainContainer,(e||!n)&&$.docMainContainerEnhanced),children:(0,a.jsx)("div",{className:(0,r.A)("container padding-top--md padding-bottom--lg",$.docItemWrapper,e&&$.docItemWrapperEnhanced),children:t})})}function et({children:e}){let t=(0,c.t)(),[n,r]=(0,i.useState)(!1);return(0,a.jsxs)("div",{className:"docsWrapper_ObNm",children:[(0,a.jsx)(b,{}),(0,a.jsxs)("div",{className:"docRoot_ItuS",children:[t&&(0,a.jsx)(K,{sidebar:t.items,hiddenSidebarContainer:n,setHiddenSidebarContainer:r}),(0,a.jsx)(ee,{hiddenSidebarContainer:n,children:e})]})]})}var en=n(8149);function ea(e){let t=(0,s.B5)(e);if(!t)return(0,a.jsx)(en.A,{});let{docElement:n,sidebarName:i,sidebarItems:d}=t;return(0,a.jsx)(o.e3,{className:(0,r.A)(l.G.page.docsDocPage),children:(0,a.jsx)(c.V,{name:i,items:d,children:(0,a.jsx)(et,{children:n})})})}},8149:function(e,t,n){n.d(t,{A:()=>l});var a=n(5656);n(7140);var i=n(3526),r=n(8033),o=n(422);function l({className:e}){return(0,a.jsx)("main",{className:(0,i.A)("container margin-vert--xl",e),children:(0,a.jsx)("div",{className:"row",children:(0,a.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,a.jsx)(o.A,{as:"h1",className:"hero__title",children:(0,a.jsx)(r.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,a.jsx)("p",{children:(0,a.jsx)(r.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,a.jsx)("p",{children:(0,a.jsx)(r.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5561"],{6768:function(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>h,frontMatter:()=>a,contentTitle:()=>o,toc:()=>d,assets:()=>l});var i=JSON.parse('{"id":"configuration/format","title":"File Format","description":"Structure of a COSMOS file, including using ERB","source":"@site/docs/configuration/format.md","sourceDirName":"configuration","slug":"/configuration/format","permalink":"/tools/staticdocs/docs/configuration/format","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/format.md","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"title":"File Format","description":"Structure of a COSMOS file, including using ERB"},"sidebar":"defaultSidebar","previous":{"title":"Configuration","permalink":"/tools/staticdocs/docs/configuration"},"next":{"title":"Plugins","permalink":"/tools/staticdocs/docs/configuration/plugins"}}'),s=t(7259),r=t(9796);let a={sidebar_position:1,title:"File Format",description:"Structure of a COSMOS file, including using ERB"},o,l={},d=[{value:"Keyword / Parameters",id:"keyword--parameters",level:2},{value:"ERB",id:"erb",level:2},{value:"render",id:"render",level:3},{value:"Line Continuation",id:"line-continuation",level:2},{value:"String Concatenation",id:"string-concatenation",level:2}];function c(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"COSMOS configuration files are just text files. They can (and should) be checked into your configuration management system and thus can be easily diffed throughout their history. They support ERB syntax, partials, and various line continuations which make them extremely flexible."}),"\n",(0,s.jsx)(n.h2,{id:"keyword--parameters",children:"Keyword / Parameters"}),"\n",(0,s.jsx)(n.p,{children:"Each line of a COSMOS configuration file contains a single keyword followed by parameters. For example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'COMMAND TARGET COLLECT BIG_ENDIAN "Collect command"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The keyword is ",(0,s.jsx)(n.code,{children:"COMMAND"})," and the parameters are ",(0,s.jsx)(n.code,{children:"TARGET"}),", ",(0,s.jsx)(n.code,{children:"COLLECT"}),", ",(0,s.jsx)(n.code,{children:"BIG_ENDIAN"}),", and ",(0,s.jsx)(n.code,{children:'"Collect command"'}),". Keywords are parsed by COSMOS and parameters are checked for validity. Parameters can be required or optional although required parameters always come first. Some parameters have a limited set of valid values. For example, the ",(0,s.jsx)(n.code,{children:"COMMAND"})," keyword above has the following documentation:"]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"PARAMETER"}),(0,s.jsx)(n.th,{children:"DESCRIPTION"}),(0,s.jsx)(n.th,{children:"REQUIRED"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Target"}),(0,s.jsx)(n.td,{children:"Name of the target this command is associated with"}),(0,s.jsx)(n.td,{children:"True"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Command"}),(0,s.jsx)(n.td,{children:"Name of this command. Also referred to as its mnemonic. Must be unique to commands to this target. Ideally will be as short and clear as possible."}),(0,s.jsx)(n.td,{children:"True"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Endianness"}),(0,s.jsxs)(n.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)(n.code,{children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(n.td,{children:"True"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Description"}),(0,s.jsx)(n.td,{children:"Description of this command which must be enclosed with quotes"}),(0,s.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,s.jsxs)(n.p,{children:["The Target and Command parameters can be any string and are required. The Endianness parameter is required and must be ",(0,s.jsx)(n.code,{children:"BIG_ENDIAN"})," or ",(0,s.jsx)(n.code,{children:"LITTLE_ENDIAN"}),". Other values will cause an error when parsed. The Description parameter must be enclosed in quotes and is optional. All the COSMOS configuration files document their keyword and parameters in this fashion. In addition, Example Usage is provided similar to the example given above."]}),"\n",(0,s.jsx)(n.h2,{id:"erb",children:"ERB"}),"\n",(0,s.jsxs)(n.p,{children:["ERB stands for Embedded Ruby. ",(0,s.jsx)(n.a,{href:"https://github.com/ruby/erb",children:"ERB"})," is a templating system for Ruby which allows you to use Ruby logic and variables to generate text files. There are two basic forms of ERB:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-erb",children:"<% Ruby code -- no output %>\n<%= Ruby expression -- insert result %>\n"})}),"\n",(0,s.jsxs)(n.p,{children:["In a COSMOS ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"Telemetry"})," configuration file we could write the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-erb",children:'<% (1..5).each do |i| %>\n APPEND_ITEM VALUE<%= i %> 16 UINT "Value <%= i %> setting"\n<% end %>\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The first line is Ruby code which iterates from 1 up to and including 5 and places the value in the variable i. The code inside the block will be output to the file every time the iteration runs. The APPEND_ITEM line uses the value of i and directly outputs it to the file by using the ",(0,s.jsx)(n.code,{children:"<%="})," syntax. The result of the parsing will look like the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'APPEND_ITEM VALUE1 16 UINT "Value 1 setting"\nAPPEND_ITEM VALUE2 16 UINT "Value 2 setting"\nAPPEND_ITEM VALUE3 16 UINT "Value 3 setting"\nAPPEND_ITEM VALUE4 16 UINT "Value 4 setting"\nAPPEND_ITEM VALUE5 16 UINT "Value 5 setting"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS uses ERB syntax extensively in a Plugin's ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/plugins#plugintxt-configuration-file",children:"plugin.txt"})," configuration file."]}),"\n",(0,s.jsx)(n.h3,{id:"render",children:"render"}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS provides a method used inside ERB called ",(0,s.jsx)(n.code,{children:"render"})," which renders a configuration file into another configuration file. For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n <%= render "_ccsds_apid.txt", locals: {apid: 1} %>\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,s.jsx)(n.p,{children:"The render method takes a parameter which is the name of the configuration file to inject into the top level file. This file is required to start with underscore to avoid being processed as a regular configuration file. This file is called a partial since it's part of a larger file. For example, _ccsds_apid.txt is defined as follows:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:' APPEND_ID_ITEM CCSDSAPID 11 UINT <%= apid %> "CCSDS application process id"\n'})}),"\n",(0,s.jsx)(n.p,{children:"This would result in output as follows:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n APPEND_ID_ITEM CCSDSAPID 11 UINT 1 "CCSDS application process id"\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Note the variable ",(0,s.jsx)(n.code,{children:"apid"})," was set to 1 using the ",(0,s.jsx)(n.code,{children:"locals:"})," syntax. This is a very powerful way to add common headers and footer to every packet definition. See the INST target's cmd_tlm definitions in the ",(0,s.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/cmd_tlm",children:"Demo"})," for a more comprehensive example."]}),"\n",(0,s.jsx)(n.h2,{id:"line-continuation",children:"Line Continuation"}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS supports a line continuation character in configuration files. For a simple line continuation use the ampersand character: ",(0,s.jsx)(n.code,{children:"&"}),". For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN &\n "Health and status"\n'})}),"\n",(0,s.jsx)(n.p,{children:"This will strip the ampersand character and merge the two lines to result in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n'})}),"\n",(0,s.jsx)(n.p,{children:"Spaces around the second line are stripped so indentation does not matter."}),"\n",(0,s.jsx)(n.h2,{id:"string-concatenation",children:"String Concatenation"}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS supports two different string concatenation characters in configuration files. To concatenate strings with a newline use the plus character: ",(0,s.jsx)(n.code,{children:"+"}),". For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status" +\n "Additional description"\n'})}),"\n",(0,s.jsx)(n.p,{children:"The strings will be merged with a newline to result in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status\\nAdditional description"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["To concatenate strings without a newline use the backslash character: ",(0,s.jsx)(n.code,{children:"\\"}),". For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and status' \\\n 'Additional description'\n"})}),"\n",(0,s.jsx)(n.p,{children:"The strings will be merged without a newline to result in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and statusAdditional description'\n"})}),"\n",(0,s.jsx)(n.p,{children:"The string continuation characters work with both single or double quoted strings but note that both lines MUST use the same syntax. You can not concatenate a single quoted string with a double quoted string or vice versa. Also note the indentation of the second line does not matter as whitespace is stripped."})]})}function h(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},9796:function(e,n,t){t.d(n,{R:()=>a,x:()=>o});var i=t(6363);let s={},r=i.createContext(s);function a(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([["5561"],{2419:function(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>h,frontMatter:()=>a,contentTitle:()=>o,toc:()=>d,assets:()=>l});var i=JSON.parse('{"id":"configuration/format","title":"File Format","description":"Structure of a COSMOS file, including using ERB","source":"@site/docs/configuration/format.md","sourceDirName":"configuration","slug":"/configuration/format","permalink":"/tools/staticdocs/docs/configuration/format","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/format.md","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"sidebar_position":1,"title":"File Format","description":"Structure of a COSMOS file, including using ERB"},"sidebar":"defaultSidebar","previous":{"title":"Configuration","permalink":"/tools/staticdocs/docs/configuration"},"next":{"title":"Plugins","permalink":"/tools/staticdocs/docs/configuration/plugins"}}'),s=t(5656),r=t(5395);let a={sidebar_position:1,title:"File Format",description:"Structure of a COSMOS file, including using ERB"},o,l={},d=[{value:"Keyword / Parameters",id:"keyword--parameters",level:2},{value:"ERB",id:"erb",level:2},{value:"render",id:"render",level:3},{value:"Line Continuation",id:"line-continuation",level:2},{value:"String Concatenation",id:"string-concatenation",level:2}];function c(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.p,{children:"COSMOS configuration files are just text files. They can (and should) be checked into your configuration management system and thus can be easily diffed throughout their history. They support ERB syntax, partials, and various line continuations which make them extremely flexible."}),"\n",(0,s.jsx)(n.h2,{id:"keyword--parameters",children:"Keyword / Parameters"}),"\n",(0,s.jsx)(n.p,{children:"Each line of a COSMOS configuration file contains a single keyword followed by parameters. For example:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'COMMAND TARGET COLLECT BIG_ENDIAN "Collect command"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The keyword is ",(0,s.jsx)(n.code,{children:"COMMAND"})," and the parameters are ",(0,s.jsx)(n.code,{children:"TARGET"}),", ",(0,s.jsx)(n.code,{children:"COLLECT"}),", ",(0,s.jsx)(n.code,{children:"BIG_ENDIAN"}),", and ",(0,s.jsx)(n.code,{children:'"Collect command"'}),". Keywords are parsed by COSMOS and parameters are checked for validity. Parameters can be required or optional although required parameters always come first. Some parameters have a limited set of valid values. For example, the ",(0,s.jsx)(n.code,{children:"COMMAND"})," keyword above has the following documentation:"]}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"PARAMETER"}),(0,s.jsx)(n.th,{children:"DESCRIPTION"}),(0,s.jsx)(n.th,{children:"REQUIRED"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Target"}),(0,s.jsx)(n.td,{children:"Name of the target this command is associated with"}),(0,s.jsx)(n.td,{children:"True"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Command"}),(0,s.jsx)(n.td,{children:"Name of this command. Also referred to as its mnemonic. Must be unique to commands to this target. Ideally will be as short and clear as possible."}),(0,s.jsx)(n.td,{children:"True"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Endianness"}),(0,s.jsxs)(n.td,{children:["Indicates if the data in this command is to be sent in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)(n.code,{children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(n.td,{children:"True"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Description"}),(0,s.jsx)(n.td,{children:"Description of this command which must be enclosed with quotes"}),(0,s.jsx)(n.td,{children:"False"})]})]})]}),"\n",(0,s.jsxs)(n.p,{children:["The Target and Command parameters can be any string and are required. The Endianness parameter is required and must be ",(0,s.jsx)(n.code,{children:"BIG_ENDIAN"})," or ",(0,s.jsx)(n.code,{children:"LITTLE_ENDIAN"}),". Other values will cause an error when parsed. The Description parameter must be enclosed in quotes and is optional. All the COSMOS configuration files document their keyword and parameters in this fashion. In addition, Example Usage is provided similar to the example given above."]}),"\n",(0,s.jsx)(n.h2,{id:"erb",children:"ERB"}),"\n",(0,s.jsxs)(n.p,{children:["ERB stands for Embedded Ruby. ",(0,s.jsx)(n.a,{href:"https://github.com/ruby/erb",children:"ERB"})," is a templating system for Ruby which allows you to use Ruby logic and variables to generate text files. There are two basic forms of ERB:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-erb",children:"<% Ruby code -- no output %>\n<%= Ruby expression -- insert result %>\n"})}),"\n",(0,s.jsxs)(n.p,{children:["In a COSMOS ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/telemetry",children:"Telemetry"})," configuration file we could write the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-erb",children:'<% (1..5).each do |i| %>\n APPEND_ITEM VALUE<%= i %> 16 UINT "Value <%= i %> setting"\n<% end %>\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The first line is Ruby code which iterates from 1 up to and including 5 and places the value in the variable i. The code inside the block will be output to the file every time the iteration runs. The APPEND_ITEM line uses the value of i and directly outputs it to the file by using the ",(0,s.jsx)(n.code,{children:"<%="})," syntax. The result of the parsing will look like the following:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'APPEND_ITEM VALUE1 16 UINT "Value 1 setting"\nAPPEND_ITEM VALUE2 16 UINT "Value 2 setting"\nAPPEND_ITEM VALUE3 16 UINT "Value 3 setting"\nAPPEND_ITEM VALUE4 16 UINT "Value 4 setting"\nAPPEND_ITEM VALUE5 16 UINT "Value 5 setting"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS uses ERB syntax extensively in a Plugin's ",(0,s.jsx)(n.a,{href:"/tools/staticdocs/docs/configuration/plugins#plugintxt-configuration-file",children:"plugin.txt"})," configuration file."]}),"\n",(0,s.jsx)(n.h3,{id:"render",children:"render"}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS provides a method used inside ERB called ",(0,s.jsx)(n.code,{children:"render"})," which renders a configuration file into another configuration file. For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n <%= render "_ccsds_apid.txt", locals: {apid: 1} %>\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,s.jsx)(n.p,{children:"The render method takes a parameter which is the name of the configuration file to inject into the top level file. This file is required to start with underscore to avoid being processed as a regular configuration file. This file is called a partial since it's part of a larger file. For example, _ccsds_apid.txt is defined as follows:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:' APPEND_ID_ITEM CCSDSAPID 11 UINT <%= apid %> "CCSDS application process id"\n'})}),"\n",(0,s.jsx)(n.p,{children:"This would result in output as follows:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n APPEND_ID_ITEM CCSDSAPID 11 UINT 1 "CCSDS application process id"\n APPEND_ITEM COLLECTS 16 UINT "Number of collects"\n ...\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Note the variable ",(0,s.jsx)(n.code,{children:"apid"})," was set to 1 using the ",(0,s.jsx)(n.code,{children:"locals:"})," syntax. This is a very powerful way to add common headers and footer to every packet definition. See the INST target's cmd_tlm definitions in the ",(0,s.jsx)(n.a,{href:"https://github.com/OpenC3/cosmos/tree/main/openc3-cosmos-init/plugins/packages/openc3-cosmos-demo/targets/INST/cmd_tlm",children:"Demo"})," for a more comprehensive example."]}),"\n",(0,s.jsx)(n.h2,{id:"line-continuation",children:"Line Continuation"}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS supports a line continuation character in configuration files. For a simple line continuation use the ampersand character: ",(0,s.jsx)(n.code,{children:"&"}),". For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN &\n "Health and status"\n'})}),"\n",(0,s.jsx)(n.p,{children:"This will strip the ampersand character and merge the two lines to result in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status"\n'})}),"\n",(0,s.jsx)(n.p,{children:"Spaces around the second line are stripped so indentation does not matter."}),"\n",(0,s.jsx)(n.h2,{id:"string-concatenation",children:"String Concatenation"}),"\n",(0,s.jsxs)(n.p,{children:["COSMOS supports two different string concatenation characters in configuration files. To concatenate strings with a newline use the plus character: ",(0,s.jsx)(n.code,{children:"+"}),". For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status" +\n "Additional description"\n'})}),"\n",(0,s.jsx)(n.p,{children:"The strings will be merged with a newline to result in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Health and status\\nAdditional description"\n'})}),"\n",(0,s.jsxs)(n.p,{children:["To concatenate strings without a newline use the backslash character: ",(0,s.jsx)(n.code,{children:"\\"}),". For example:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and status' \\\n 'Additional description'\n"})}),"\n",(0,s.jsx)(n.p,{children:"The strings will be merged without a newline to result in:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-ruby",children:"TELEMETRY INST HEALTH_STATUS BIG_ENDIAN 'Health and statusAdditional description'\n"})}),"\n",(0,s.jsx)(n.p,{children:"The string continuation characters work with both single or double quoted strings but note that both lines MUST use the same syntax. You can not concatenate a single quoted string with a double quoted string or vice versa. Also note the indentation of the second line does not matter as whitespace is stripped."})]})}function h(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},5395:function(e,n,t){t.d(n,{R:()=>a,x:()=>o});var i=t(7140);let s={},r=i.createContext(s);function a(e){let n=i.useContext(r);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
|